Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-04
4
Medium Priority
?
708 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:Robin
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:Robin
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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
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.
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…
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…
Suggested Courses

618 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