Solved

VB6: Web Browser Control run-time error "-2"

Posted on 2009-05-04
4
702 Views
Last Modified: 2012-06-27
I am using a Web Browser control in a VB6 program, and I am consistently getting a Run-time error -2 when I attempt to click on certain web pages.  The behavior is consistent: I am in a page that I've navigated to by typing in the address, and then I click on an item inside the browser to redirect myself, and the error shows up.  I am able to switch to the site when using Internet Explorer, which tells me that the site I'm attempting does exist.  I am flustered by this error, and have been trying to solve it all day.  I'm hoping one of you has encountered the same problem and come up with a solution.  Thanks, ~Peter Ferber
0
Comment
Question by:PeterFrb
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:robinu
ID: 24302226
Can you have a look at
http://social.msdn.microsoft.com/Forums/en-US/iewebdevelopment/thread/21935021-1dc7-445b-a829-b02489009aab

and see if this helps you? Especially exchanging the Microsoft Internet Controls from
ieframe.dll to shdocvw.dll ?
0
 

Author Comment

by:PeterFrb
ID: 24306876
Thank you for this, and this is definitely the area that needs changing.  

My problem is that when I can download shdocvw.dll as a reference but not as a component.  The component is what I need to drag and drop an internet control into my form, and the only correct component extension appears to be "*.ocx".  I find it odd that after selecting "Microsfoft Internet Controls" from the Component list, the default file name is "ieframe.dll"; but, having chosen it and exited from the Componant List box, when I go to revisit the selection, the choice shows up as "shdocvw.dll".  

The fact that it changes does not convince me that I am, in fact, pointing to the correct file.  And when I use the browser to force the system to point to my file of choice, I get an error saying that the file is not a valid component.  I further do not understand what shdocvw.dll provides me when I use it as a reference vs a component.

In short, while I believe I have made progress, I still need support getting this to work and answering my questions.

2nd question: I am also doing development work in VB.Net 2008.  If there is a superior object model to use, I'd be glad to bag this and purse an upgrade.
~Peter Ferber
0
 

Accepted Solution

by:
PeterFrb earned 0 total points
ID: 24307399
Oh, happy day!  The problem is really in Explorer 7.0, and Microsoft has helpfully upgraded Explorer to 8.0.  Merely performing the upgrade solved the problem, that I tried the better of two days to solve.
~Peter
0
 
LVL 16

Expert Comment

by:robinu
ID: 24311504
I am glad it's working now. Unfortunately I can't help you much with the 2nd question about vb.net 2008.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now