I’ve been having a problem serving up Google Maps web pages in a custom OCX control using Shell.Explorer.1.
I’ve isolated my problem in a very simple application. I have a main form with two buttons: “Marker†and “Polygonâ€. When I press “Marker†I open a new form containing an OCX control similar to the one in the WebBrowser tutorial. The browser serves up a hard drive residing, javascript encoded .htm file showing a Google Map with a marker. If I press “Polygonâ€, I open the same form containing the OCX control and the browser serves up a different .htm file, this time displaying a Google Map with a polygon. (The .htm files are identical with the exception of one adding a marker overlay, the other a polygon overlay). The web browser control’s form is modal, so I close it after each page is served up. The problem: After I serve up my polygon map, I can no longer serve up either the marker or polygon page. I do not have a problem opening the pages consecutively in Internet Explorer, nor do I have a problem opening the pages when the OCX web browser control resides in the main form.
What could the problem be? It seems like it must have something to do with the destruction of the web browser form or OCX control, plus a bad interaction with the javascript code in the polygon page. I know when it stops working, “navigation†to the page does not complete.
I've attached a .zip file containing the project.
Please help!
hmmm.... not sure what's going on there yet. It seems that if you load the form as non-modal then it works.
aResult = FRMBROWSER_SHOW(HWND_FRMMAIN, %FALSE) '<-- %FALSE rather than %TRUE
I'll keep looking to see why the modal form is failing.