VB6 User

Hi Gurus,

My VB6 application, created a webbrowser control and loaded a page from a local html file and hooked a event handler function in the VB application to a button's onclick event in the html page. (using callbyname)

I followed this document "Handling Events in Visual Basic Applications"(http://msdn2.microsoft.com/en-us/library/Aa752045.aspx) from MSDN to do the hook. The hook is done in the WebBrowser1_DocumentComplete function:

cfForward.Set_Destination Me, "ButtonHandler_Procedure"
WebBrowser1.Document.All("btnDone").onclick = cfForward

The application also reloaded the page if needed so the hook may be called many times as the page was reloaded.

My application worked fine with IE6. But with IE7, application reported a automation error then crashed after loaded the html page 2-3 times.

Please help.

Re: Internet Explorer Web Development VB event handling is different in IE7?


I am seeing a similar deal. I have VB6 utilizing the WebBrowser object by direct placement on my form.

I installed the Visual Studio 2005 with Net 2.0 Framework, but I am not utilizing any Net Framework coding in my application. I decided against using the dot net framework, because I did not want to force users of my software to upgrade to dot net to use my software.

The software is actually a browser application helper type deal. I have successfully navigated from Page 1 to 4 without problem, dropping data into my website forms. I then send several fields to the website form at page 5, deliberately leaving one field off the page to trigger the form telling me that I left off one field of info. This was done so that I can answer the drop down box as well.

So on page 5, I have the form partially filled out on a website. I fill in the info to finish the process and click submit at the bottom of the page. This is the first time I am actually using a submit button on the destination website. The info is successfully transfered to the website and as soon as the Thank You webpage finishes loading, the software triggers a runtime error in every instance.

Sometimes, I get runtime error -2 and sometimes runtime error -3. More often than not, I get a runtime error -1. These runtime errors ALWAYS crash the application.

I check the website where I was sending my info, and in every case, the information is passed to the server exactly as it should have been. But, my browser application is now dead and I have to restart it to visit another website.

Any help would be appreciated. I have been trying to troubleshoot this for more than a week. Thank you in advance for your help.

Re: Internet Explorer Web Development VB event handling is different in IE7?

VB6 User

I think I resolved the problem.

Before, the button event I was handling was OnSubmit. Now I changed it to OnClick.

This will not trigger a WebBrowser_DocumentComplete event. And the runtime error is gone.