473,388 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Internet Explorer control

Hi everyone

I'm having a couple of problems with the Internet Explorer
browser control. I'm using VS.NET 2003 on Win2k SP4 with IE6.

First, let me briefly describe how it's used in my project.

1. I have a DLL containing a form which hosts the IE
Browser control, using the AxInterop stuff that is
generated when you add a reference to the COM ShDocVw
library. This form is basically just a web browser
which I can control programmatically.

Public Sub ShowURL(ByVal sURL As String)
If Not Me.Visible Then Me.Show

Try
browser.Navigate(sURL)
Catch ex As Exception
System.Diagnostics.Debug.WriteLine(ex.Message)
End Try
End Sub

2. I have a DLL containing a UserControl. Under certain
conditions, this control will make use of the web
browser form described above:

Private Sub ShowDetails( ... )
Dim sDetailsURL As String = ...
...
Dim dlgBrowser As frmBrowser = New frmBrowser
dlgBrowser.ShowURL(sDetailsURL)
End Sub

3. I have a DLL containing a form, which uses the
UserControl described above.

4. Finally, there is an EXE which will instantiate the form
and display it.

Okay... on to the problems.

[A] If I open the form (#3 in the above list) in the Forms
Designer, it complains that it can't instantiate the
control (#2):

An exception occurred while trying to create an
instance of MyControlLib.ctlMyControl. The exception
was "File or assembly name AxInterop.SHDocVw, or one
of its dependencies, was not found.".

The control works fine at run time though!

I have tried putting a ShDocVw reference in the project
(#3) where the form resides, but this doesn't help.

[b] When the browser control's Navigate function is called
by ShowURL, I get this error:

First-chance exception at 0x7c57e592 (KERNEL32.DLL) in
MyApp.exe: 0x000006BA: The RPC server is unavailable.

Strangely, even though there's a try-catch around the
Navigate call, execution breaks here, and I see the
above error message in a dialog box (the type you
might see when your native C/C++ code segfaults).

I'll paste the stack dump at the end of this message.

Here's the weird part. If I comment out the Navigate
call in ShowURL(), but then allow the user to enter a
URL in a textbox, click on a Go button, and call
Navigate from there... everything works fine.

Any advice would be greatly appreciated. Thanks.

-- graham
The following is the contents of the Call Stack window when
the "RPC server is unavailable" exception occurs.

KERNEL32.DLL!RaiseException() + 0x55
rpcrt4.dll!RpcRaiseException() + 0x1d
NETAPI32.DLL!NetpSetFileSecurity() + 0x3db
NTLANMAN.DLL!NPGetResourceInformation() + 0x41d
NTLANMAN.DLL!NPGetResourceInformation() + 0x127
mpr.dll!WNetGetResourceInformationW() + 0xed
mpr.dll!WNetGetConnectionW() + 0x1b9
mpr.dll!WNetGetConnectionW() + 0x15f
SHELL32.DLL!Control_FillCache_RunDLLW() + 0x14c0
SHELL32.DLL!SHGetIconOverlayIndexA() + 0x15369
SHELL32.DLL!SHGetIconOverlayIndexA() + 0x3531
SHELL32.DLL!ShellExec_RunDLLW() + 0x3a86
SHELL32.DLL!ShellExec_RunDLLW() + 0x3d4a
SHELL32.DLL!SHGetIconOverlayIndexA() + 0x3531
SHELL32.DLL!SHGetFileInfoW() + 0x2f0
SHELL32.DLL!DllCanUnloadNow() + 0x36
SHDOCVW.DLL!DllCanUnloadNow() + 0x7f
SHDOCVW.DLL!DllCanUnloadNow() + 0x309
SHDOCVW.DLL!DllGetClassObject() + 0x4141
SHDOCVW.DLL!DllGetClassObject() + 0x8571
SHDOCVW.DLL!DllGetClassObject() + 0x8166
SHDOCVW.DLL!HlinkFrameNavigateNHL() + 0x496e
SHDOCVW.DLL!DllRegisterWindowClasses() + 0xdf9d
axinterop.shdocvw.dll!AxSHDocVw.AxWebBrowser.Navig ate(string
uRL = "file://c:/foo.txt", System.Object flags =
{System.Reflection.Missing}, System.Object targetFrameName
= {System.Reflection.Missing}, System.Object postData =
{System.Reflection.Missing}, System.Object headers =
{System.Reflection.Missing}) + 0x5d bytes


Nov 21 '05 #1
2 3089
Just an update:

1. I'm now seeing the "crash" any time I call Navigate.
It doesn't matter whether I wait for the user to click
a Go button... it dies in exactly the same way.

2. I've eliminated a few layers, just for debugging, so I
am down to two projects:

- a DLL project containing the web browser form
- an EXE project which attempts to instantiate that
form and call its ShowURL function

BTW, I do not believe that the two problems that I
described are closely related... their only relation, IMHO,
is that they both have to do with the IE browser control.

-- graham
Nov 21 '05 #2
> An exception occurred while trying to create an
instance of MyControlLib.ctlMyControl. The exception
was "File or assembly name AxInterop.SHDocVw, or one
of its dependencies, was not found.".


Solution: Don't try to instantiate the browser form inside
the usercontrol's New() function.

Instead, I now instantiate the browser form the first time
it is needed. The forms designer now seems to be happy.

-- graham
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Raymond H. | last post by:
Hello, I create a vb4 project which can also naviger on Internet via the WebBrowser control which I put on my form. My question is: if this program is installed on a station having already...
3
by: Oldbitcollector | last post by:
I'm a still new to visual basic, and I've hit a problem I can't find a workaround for. I'm attempting to open and close an Internet Explorer window using visual basic 6. I've got the open...
0
by: MilanB | last post by:
Hello Need to create Windows Control that will be used within Internet Explorer (like ActiveX before). The propose of this control is to implement Internet Explorer interface IAuthenticate. ...
7
by: husamal_ahmadi | last post by:
Hi everyBody: I have this question which really drive me cruzy, By using VB.Net: How can I let the internet explorer navigate in the same window either by using win32 API or by using...
0
by: Friskusen | last post by:
I have a control library written in Vb.Net and now i am very eager to use the controls with Internet explorer, using the object tag, something like this: <object id="MyButton1"...
3
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review...
1
by: Apu Nahasapeemapetilon | last post by:
Hello and thank you in advance for your help. Can anyone think of a reason why this code would work properly on one PC, but not another? I've got a System.Windows.Forms.UserControl that...
3
by: laredotornado | last post by:
Hi, This problem only affects PC IE. On a secured page (a page visited via https), there is a link that reads -- "Download HTML File". The link connects to this page <?php...
9
by: Etayki | last post by:
Hi! I am new to VB.net and I am using the Visual Basic 2005 Express Edition I have two questions: 1. I am trying to write an application that will automate Internet Explorer and store data...
1
by: yawnmoth | last post by:
http://www.frostjedi.com/terra/scripts/demo/download2.php Whenever I get that page, I get the following error: --------------------- Internet Explorer cannot download download2.php from...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.