C++ and GEPlugin

1,220 views
Skip to first unread message

ThiBer

unread,
Jan 23, 2011, 4:05:24 PM1/23/11
to KML Developer Support - Google Earth Plug-in
Hi,

I (nearly) succeed in building a desktop C++ application embedding a
GE view.

But I did that using the "earth.idl" file, compiled to "earth.h" and
"earth*.c" with widl (the Wine IDL compiler). Then with a bit a CoXXX
API (that I don't know), it works : the 3D window of GoogleEarth is
reparented in my app, but the GoogleEarth process is running.

I'd rather use GEPlugin. It is installed. But I don't know how to use
it, I have no IDL file for it.
Visual Studio Express 2010 C# knows how to build a CLR DLL wrapper
around the native GEPlugin DLL, then it could be possible to embbed
GEPlugin in a C# desktop app.

How one can extract the C++ header information of the GEPlugin DLL
entries ?

Thank you.

StarTraX

unread,
Jan 23, 2011, 6:49:30 PM1/23/11
to KML Developer Support - Google Earth Plug-in
For what it's worth, I that that way lies madness!
After many hours/deays of experimenting with the API directly from my
VB .NET application, I have concluded that the only way to interface
with the plugin is via javascript. Although the API can be exposed
to .NET, it's not a complete interface, the documentation is
inadequate and there are some serious flaws.
I have had much success in my .NET app using a webBrowser, HTML and
embedded javascript. Learning js is a bit of a pain, but it's
surprisingly powerful, fast and rewarding.

Zoran

unread,
Jan 24, 2011, 2:35:17 AM1/24/11
to KML Developer Support - Google Earth Plug-in
Hello,

I could not agree.

Very powerfull VB.NET or C# or... any .NET application can be built if
you are using GEPlugin .NET interop.

There is no need to program with javascript in case you are building
desktop app.

It exposes to your .NET app GEPlugin API.

How to create Interop?

Tlbimp.exe /out:Interop.GEPlugin.dll /namespace:GEPlugin /
machine:X86 /verbose "C:\Program Files (x86)\Google\Google Earth\plugin
\ie\6.0.0.1735\plugin_ax.dll"

GTrek

unread,
Jan 24, 2011, 3:58:10 PM1/24/11
to KML Developer Support - Google Earth Plug-in
Hi Zoran,

Now that's interesting.... Where can I get the class documentation
from I wonder ?

John
www.gtrek.co.uk

GTrek

unread,
Jan 24, 2011, 4:00:42 PM1/24/11
to KML Developer Support - Google Earth Plug-in
Zoran,

What does interop.GEPlugin.dll give you that plugin_ax.dll does not ?

John


On Jan 24, 7:35 am, Zoran wrote:

ThiBer

unread,
Jan 24, 2011, 7:00:22 PM1/24/11
to google-earth-...@googlegroups.com
Thank you all, I am affraid I am really too new to COM and others M$ magix.

Searching MSDN, I found "oleview.exe + iviewers.dll". With them, I have now an ILD file extracted from the "plugin_ax.dll".
Changed "single" to "float", ... but I cannot compile it to a .h/.cpp wrapper. I tried with WIDL (from WINE) and MIDL (from VS Express 2000 => Windows SDKs).

Anybody knows how to build the wrapper ? What changes do I have to do to the IDL file ?

The last error from MIDL is :

.\GEPlugin.idl(259) : error MIDL2272 : (async) interface must derive from another (async) interface : [ Interface 'IGEEventEmitter'  ]
midl : error MIDL9008 : internal compiler problem - See documentation for suggestions on how to find a workaround.


ThiBer

unread,
Jan 24, 2011, 7:02:17 PM1/24/11
to google-earth-...@googlegroups.com
I would like to use GEPlugin from native code. With VS Express 2010, I think I could use it with managed (C#) code. VS produces a managed DLL wrapper when importing "plugin_ax.dll".

ThiBer

unread,
Jan 28, 2011, 12:49:51 PM1/28/11
to KML Developer Support - Google Earth Plug-in


On 25 jan, 01:00, ThiBer wrote:
> Anybody knows how to build the wrapper ? What changes do I have to do to the
> IDL file ?

I added "#define single float" and move some Ixxx definitions so as
not having forward references.
Then I have a compilable "geplugin.idl" (using MIDL), and a C stub/
wrapper/client is generated.

Zoran

unread,
Feb 5, 2011, 11:34:11 AM2/5/11
to google-earth-...@googlegroups.com
Hello John,
 
 
I am programming in NET managed world and InterOp gives you VS intellisense to explore exposed interface.
I suggest you visit this link with the great sample project - GEPlugin with C#.
By the way I think that GE API COM is not supported by GoogleEarth team anymore.
 
 
Prety nice code there.
 
Thanks.
Zoran.
Reply all
Reply to author
Forward
0 new messages