472,799 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

COMException when using Interop.SHDocVw

I have an application that loads IE and iterates through web pages to
retrieve information from the page then activates specific controls to
retrieve the next page and iterate through that page for it's information,
etc, etc.

I have found many articles from people getting COMException errors when
trying to use Interop.SHDocVw from a windows service, so it's pretty
apparent to me that this is a difficult application to build, but I have yet
to find an article that explains either an alternative way to retrieve
information from a web page or that explains how to get Interop.SHDocVw to
work from an agent. I have tried running the agent under my own user account
that is a member of the machine Administrators group but I still get the
error. I have included the error below if someone can make more sense out
of it then I can.

Thanks in advance,
Jay A. Moritz
Predictable Outcomes

Timestamp: 7/8/2005 2:58:04 AM
Message: HandlingInstanceID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime.InteropServices.COMException' occurred
and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime.InteropServices.COMException, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(System.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBrowser2.Navigate2(Object& URL, Object&
Flags, Object& TargetFrameName, Object& PostData, Object& Headers)
at
pOrchestrator.DataLinks.HTMLParser.GetHTMLFromBrow ser(InternetExplorer& ie,
Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDuration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHan dling,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
AppDomainName : porchestratoragent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.Exception
Machine: HP-BIZ2
Application Domain: porchestratoragent.exe
Process Id: 2788
Process Name: c:\program files\porchestrator agent\porchestratoragent.exe
Win32 Thread Id: 1640
Thread Name:
Extended Properties:
Nov 21 '05 #1
3 5539
ShDocVw is not a server type component but a client type ActiveX component,
that means it should be properly hosted inside a visual control like a Form.
Services aren't able to host ActiveX controls.

Willy.

"Jay A. Moritz" <jm*****@predictableoutcomes.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
I have an application that loads IE and iterates through web pages to
retrieve information from the page then activates specific controls to
retrieve the next page and iterate through that page for it's information,
etc, etc.

I have found many articles from people getting COMException errors when
trying to use Interop.SHDocVw from a windows service, so it's pretty
apparent to me that this is a difficult application to build, but I have
yet to find an article that explains either an alternative way to retrieve
information from a web page or that explains how to get Interop.SHDocVw to
work from an agent. I have tried running the agent under my own user
account that is a member of the machine Administrators group but I still
get the error. I have included the error below if someone can make more
sense out of it then I can.

Thanks in advance,
Jay A. Moritz
Predictable Outcomes

Timestamp: 7/8/2005 2:58:04 AM
Message: HandlingInstanceID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime.InteropServices.COMException'
occurred and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime.InteropServices.COMException, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(System.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBrowser2.Navigate2(Object& URL, Object&
Flags, Object& TargetFrameName, Object& PostData, Object& Headers)
at
pOrchestrator.DataLinks.HTMLParser.GetHTMLFromBrow ser(InternetExplorer&
ie, Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDuration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHan dling,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
AppDomainName : porchestratoragent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.Exception
Machine: HP-BIZ2
Application Domain: porchestratoragent.exe
Process Id: 2788
Process Name: c:\program files\porchestrator agent\porchestratoragent.exe
Win32 Thread Id: 1640
Thread Name:
Extended Properties:

Nov 21 '05 #2
Thank you Willy, but it does lead to a second question:

How do I get information out of a web page when I need to do it from a
windows service? Do you know of an object/class I can use?

Thanks in advance,
Jay A. Moritz
"Willy Denoyette [MVP]" <wi*************@telenet.be> wrote in message
news:OG**************@tk2msftngp13.phx.gbl...
ShDocVw is not a server type component but a client type ActiveX
component, that means it should be properly hosted inside a visual control
like a Form. Services aren't able to host ActiveX controls.

Willy.

"Jay A. Moritz" <jm*****@predictableoutcomes.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
I have an application that loads IE and iterates through web pages to
retrieve information from the page then activates specific controls to
retrieve the next page and iterate through that page for it's information,
etc, etc.

I have found many articles from people getting COMException errors when
trying to use Interop.SHDocVw from a windows service, so it's pretty
apparent to me that this is a difficult application to build, but I have
yet to find an article that explains either an alternative way to
retrieve information from a web page or that explains how to get
Interop.SHDocVw to work from an agent. I have tried running the agent
under my own user account that is a member of the machine Administrators
group but I still get the error. I have included the error below if
someone can make more sense out of it then I can.

Thanks in advance,
Jay A. Moritz
Predictable Outcomes

Timestamp: 7/8/2005 2:58:04 AM
Message: HandlingInstanceID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime.InteropServices.COMException'
occurred and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime.InteropServices.COMException, mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(System.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBrowser2.Navigate2(Object& URL, Object&
Flags, Object& TargetFrameName, Object& PostData, Object& Headers)
at
pOrchestrator.DataLinks.HTMLParser.GetHTMLFromBrow ser(InternetExplorer&
ie, Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDuration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Practices.EnterpriseLibrary.ExceptionHan dling,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
AppDomainName : porchestratoragent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.Exception
Machine: HP-BIZ2
Application Domain: porchestratoragent.exe
Process Id: 2788
Process Name: c:\program files\porchestrator agent\porchestratoragent.exe
Win32 Thread Id: 1640
Thread Name:
Extended Properties:


Nov 21 '05 #3
Jay,

You can use by instance the HTTPWebrequest/response classes

\\\
Module main
Public Sub main()
Dim myReg As Net.HttpWebRequest = _
DirectCast(Net.WebRequest.Create("http://www.google.com"), _
Net.HttpWebRequest)
Dim myResp As Net.HttpWebResponse = _
DirectCast(myReg.GetResponse(), Net.HttpWebResponse)
Dim myStream As IO.Stream = myResp.GetResponseStream()
Dim myreader As New IO.StreamReader(myStream)
Dim mystring As String = myreader.ReadToEnd()
myResp.Close()
End Sub
End Module
///

I hope this helps a little bit?

Cor
Nov 21 '05 #4

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

Similar topics

1
by: Jason Garland \(Secure Access Pty Ltd\) | last post by:
Hi I am trying to work out how to either create a strong name wrapper for AxInterop.SHDocVw.dll I have researched the following : - 'Wrapper Assembly Key' but this is apparently for c#...
14
by: Nak | last post by:
Hi there I'm trying to use the Microsoft Web Browser within a strong names .NET assembly that I have written. Unfortunately I am getting the following linker problem as the Interop DLL that was...
2
by: shonend | last post by:
**** sorry about the length of the message. If you can't read the whole thing and still willing to help, read the last 2 paragraphs where the main problem is described. The introduction story is...
7
by: Doe | last post by:
Okay, I've given up on using the "new" WebBrowser in 2005 to do what I want to do -- tabbed browsing. It seems I really need RegisterAsBrowser and Application to get each instance of a browser...
0
by: And | last post by:
I use shdocvw InternetExplorer Object to open a pdf file and then I want to automatically save it but the web site from wich I'm downloading the file doesn't allows to save the file using the...
0
by: David P. Donahue | last post by:
This is the first time I've had any problems viewing a report in any of my applications, so I'm not sure where to begin. But when I try to render my report in a report viewer, the application...
1
by: umeshatpromact | last post by:
Hello!, I got following exception when using COM component for EXCEL object in ASP .Net. I have added reference of "Microsoft.Office.Interop.Excel.dll" I deployed an application on local...
6
by: nagar | last post by:
In certain occasions I get an exception when trying to read the shown path for the active explorer window When I instantiate the object SHDocVw.ShellWindows shell = new ShellWindowsClass(); ...
2
by: ortega23 | last post by:
Hi, I am trying to obtain the column number of the parent of a cell, if the cell is a linked cell (i.e. its value depends on another cells value). I try to read "Precedents"(parent cells) of...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.