?
Solved

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

Posted on 2009-05-04
4
Medium Priority
?
707 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
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

764 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