thientung / winforms-geplugin-control-library

Automatically exported from code.google.com/p/winforms-geplugin-control-library
GNU General Public License v3.0
0 stars 0 forks source link

don't see GEPluginCtrls working from VB.NET #76

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hallo. I hope here would be where to place my issue. If not, pls move the 
message in the right place.

Well, as from summary these are the steps I have tried with no success:

1. created a new 32-bit solution from VB.NET 2010 Express adding 
<PlatformTarget>x86</PlatformTarget> to the .vbproj file
2. added a reference to FC.GEPluginCtrls.dll
3. inserted a GeWebBrowser control on the form
4. at the top of the code, added:
    Imports FC.GEPluginCtrls 
   then, in the Load event, put this code:
    InitializeComponent() 
    GeWebBrowser1.LoadEmbeddedPlugin() 
    Do 
    Loop Until GeWebBrowser1.PluginIsReady = False 
    GeWebBrowser1.CreateInstance(ImageryBase.Earth) 
    MessageBox.Show("All done.")

The result is nothing displayed into GeWebBrowser control: Project compiles and 
starts with no warnings, but it remains empty.

I'm using the current version of GEPluginsCtls downloaded from this site, with 
G.E. 6.1 on Windows 7 64-bit.

Please ask if further information are needed in order to investigate the 
problem. Thanks in advance for reply.
Sergio

Original issue reported on code.google.com by sergio.s...@gmail.com on 24 Mar 2012 at 7:49

GoogleCodeExporter commented 9 years ago
The code you have there is very odd indeed. There is no need to set up a loop 
at all. Also, there is no need to call CreateInstance as the call to 
LoadEmbeddedPlugin already does this. Your code will constantly keep reloading 
the plugin as you have...

"load plugin -> loop until ready -> when ready - load plugin"

To load the GEWebBrowser control in VB you would do something like:

Option Strict Off 
Public Class Form1
    Private Dim _ge as Object = Nothing
Private Sub GeWebBrowser1_PluginReady( ByVal sender As System.Object,  ByVal e 
As FC.GEPluginCtrls.GEEventArgs) Handles GeWebBrowser1.PluginReady
        _ge = e.ApiObject ' reference to the Google Earth Plugin object
        MessageBox.Show(_ge.getApiVersion()) ' _ge is the plugin -use it just as in the javascript api...
End Sub

Private Sub Form1_Load( ByVal sender As System.Object,  ByVal e As 
System.EventArgs) Handles MyBase.Load
        GeWebBrowser1.LoadEmbeddedPlugin() ' load the plugin
End Sub
End Class

Original comment by fraser.c...@gmail.com on 1 May 2012 at 3:52