Solved

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

Posted on 2009-05-04
4
704 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

777 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