Yea i have been banging my head against the wall looking for an answer for days, and all my searching turned up nothing helpful! Finally I decide to ask for help on a forum and a little search window pops up with possibly useful threads, so i click this one and it gave me a strange half working link to working code. I had to figure where the url was supposed to be going
(april '07 geoPegger, by the way) before i could even get the code. but once i found it i trialed and erred to figure it out.
sorry i had to tell someone about my problems cause theres noone here who will listen
any ways
I looked at the working code and copied his header into mine.
You need to include system.security.permissions, and specify some things in your class declaration. Here is mine
Code Snippet
Imports System.Security.Permissions
<PermissionSet(SecurityAction.Demand, Name:="FullTrust")> _
<System.Runtime.InteropServices.ComVisibleAttribute(True)> _
Public Class Form1
You must also specify the objectForScripting,
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
wbVEMap.ObjectForScripting = Me
wbVEMap.Navigate("file:///C:/VirtualEarthProject/VirtualEarth.html") ' I have my script in its own html file
' it works either way
End Sub
Then finally, because i want to put it all in one place so anybody else banging their head against a wall can
hopefully stop, in your script simply callwindow.external.methodName(params) to access "methodName" in your vb code.
note: IDispatch is totally unneeded and i hate MSDN for telling me i might need to implement it
I hope that helps
Josh