473,397 Members | 2,068 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,397 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 5584
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.