Visual Basic 6 And Internet Explorer 7
I am currently moving over to C# .NET for all my desktop programming but I have some legacy apps written in Visual Basic 6 that use the WebBrowser Control extensively. Plus, sometimes you dont want the overhead of .NET 2.0 just to knock out a quick app so Visual Basic 6.0 works perfectly in some scenarios.
Since I installed Internet Explorer 7 all references to the library that holds the Web Browser control are broken. I see lots of people around the net are having the same issues and there is a simple solution.
All you have to do is click Project and then Components, click Browse... and locate shdocvw.dll in the System 32 directory. This will restore the IDE back to referencing the correct .dll for the WebBrowser control and all other projects will load fine from then on.
UPDATE - Saturday 28th October 2006I ran into a slight issue that took a while to figure out.
On the development machine, the VB6 IDE threw a strange error after the Navigate2 method is called. This error was something like "Runtime Exception -1 (FFFFFFF)". I couldnt figure out what it was because when I compiled the app and ran it outside VB IDE I didnt get the error. After a while I remembered that when I installed IE7 (I did this twice to see what would change on my machine) it reset some basic security settings. One of these is "Allow scripting of the WebBrowser Control". This was the culprit. If I checked this on, the IDE didnt throw the error.
Another thing to stress is that the end user of your application will have no problems if your VB6 App uses the WebBrowser control. Even if you have IE6 and they have IE7, your app is compatible.
As Tim mentions in the comments section, there are too many people knocking IE7 and having petty flame wars when in actual fact the impact of IE7 on legacy apps is minimal with the right information. Overall I am extremely happy with IE7 and am beginning to appreciate the effort Microsoft have put into it.
Comments
I've been sifting through stacks of little flame wars about how old VB6 is, which language to convert to, what to uninstall if you don't like it... they're all missing the point. I've got VB6, .NET 1.1 and .NET 2.0 - all running various production programs. My job, in this case, was to move to IE7 on a development machine to prove that we shouldn't have problems with continued support at client locations where we have no control over what edition of IE they use! It was not a good experience to find that the project wouldn't load properly post-IE7.
I have updated the entry above with something else I noticed.
Dan.
Im having the same problems with VB6 and IE7.
Please could you give me some more details about how your 2 fixes are implemeted.
I set the component to shdocvw.dll but that didnt stop the runtime error.
I then tried to find the scripting thing in IE>Tools>custom> but Im not certain which one it is.
Thanks in advance
Al
You're my savior ...
Your solution saved me a great amount of time!
You're NOT my savior :)
Thanks in advance
However, these solutions did not solve my problem. I still got this error after clicking a listbox link 2-4 times: "Run-Time error '-2 (fffffffe)'".
The solution to my problem was changing some registry settings, which is not changed by just changing the reference from ieframe.dll to shdocvw.dll in vb6.
Here is the key to change:
HKEY_CLASSES_ROOTCLSID{8856F961-340A-11D0-A96B-00C04FD705A2}
There are 2 keys in the subdirectories that needs changing, one is under "InProcServer32", the other is under "ToolboxBitmap32". Just change iframe.dll to shdocvw.dll wherever you see it. Good luck!
With this change I do not need to modify any script settings.
greg
WebBrowser1.ExecWB OLECMDID_PAGESETUP, 0, Null, Null
The error originally showed against OLECMDID_PAGESETUP, now it shows against .ExecWB
Has anyone else experienced this?
IE 7 fails to work with applications built with Iframes..i do have this problem any solution for this TIM ...like some functions were not working...The application is in .net fully javascript C# oriented...
Thank you very much. Was facing the same problem, and this post helped to overcome it.
Regards
Jeff
Keep you your good work.
Thanks!!!
finally DOOD
I've been looking hours to solve that problem. And your reg solution worked. Cheers!
Additional guidance regarding registry setting by dagger was very helpful as the setting from IE7 didn't worked for me. Changing registry setting along with IE7 setting worked perfectly.
thanks