Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

863 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

28 Experts available now in Live!

Get 1:1 Help Now