473,804 Members | 2,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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: HandlingInstanc eID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime .InteropService s.COMException' occurred
and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime. InteropServices .COMException, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(Syste m.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBro wser2.Navigate2 (Object& URL, Object&
Flags, Object& TargetFrameName , Object& PostData, Object& Headers)
at
pOrchestrator.D ataLinks.HTMLPa rser.GetHTMLFro mBrowser(Intern etExplorer& ie,
Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDu ration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Pract ices.Enterprise Library.Excepti onHandling,
Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null
AppDomainName : porchestratorag ent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.E xception
Machine: HP-BIZ2
Application Domain: porchestratorag ent.exe
Process Id: 2788
Process Name: c:\program files\porchestr ator agent\porchestr atoragent.exe
Win32 Thread Id: 1640
Thread Name:
Extended Properties:
Nov 21 '05 #1
3 5609
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*****@predic tableoutcomes.c om> wrote in message
news:eZ******** ******@TK2MSFTN GP12.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: HandlingInstanc eID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime .InteropService s.COMException'
occurred and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime. InteropServices .COMException, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(Syste m.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBro wser2.Navigate2 (Object& URL, Object&
Flags, Object& TargetFrameName , Object& PostData, Object& Headers)
at
pOrchestrator.D ataLinks.HTMLPa rser.GetHTMLFro mBrowser(Intern etExplorer&
ie, Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDu ration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Pract ices.Enterprise Library.Excepti onHandling,
Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null
AppDomainName : porchestratorag ent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.E xception
Machine: HP-BIZ2
Application Domain: porchestratorag ent.exe
Process Id: 2788
Process Name: c:\program files\porchestr ator agent\porchestr atoragent.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******** ******@tk2msftn gp13.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*****@predic tableoutcomes.c om> wrote in message
news:eZ******** ******@TK2MSFTN GP12.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: HandlingInstanc eID: 8b1ce84e-9041-4b7d-a1b3-0a7be47db2b7
An exception of type 'System.Runtime .InteropService s.COMException'
occurred and was caught.
-------------------------------------------------------------------------------------------
07/08/2005 02:58:04
Type : System.Runtime. InteropServices .COMException, mscorlib,
Version=1.0.500 0.0, Culture=neutral , PublicKeyToken= b77a5c561934e08 9
Message : The object invoked has disconnected from its clients.
Source : Interop.SHDocVw
Help link :
ErrorCode : -2147417848
TargetSite : Void Navigate2(Syste m.Object ByRef, System.Object ByRef,
System.Object ByRef, System.Object ByRef, System.Object ByRef)
Stack Trace : at SHDocVw.IWebBro wser2.Navigate2 (Object& URL, Object&
Flags, Object& TargetFrameName , Object& PostData, Object& Headers)
at
pOrchestrator.D ataLinks.HTMLPa rser.GetHTMLFro mBrowser(Intern etExplorer&
ie, Collection SiteRules, SiteURL SiteURL, Boolean IsFirstPage, Int32
MaxNavigationDu ration)

Additional Info:

MachineName : HP-BIZ2
TimeStamp : 7/8/2005 6:58:04 AM
FullName : Microsoft.Pract ices.Enterprise Library.Excepti onHandling,
Version=1.0.0.0 , Culture=neutral , PublicKeyToken= null
AppDomainName : porchestratorag ent.exe
ThreadIdentity :
WindowsIdentity : NT AUTHORITY\LOCAL SERVICE

Category: General
Priority: 0
EventId: 100
Severity: Error
Title:pSystem.E xception
Machine: HP-BIZ2
Application Domain: porchestratorag ent.exe
Process Id: 2788
Process Name: c:\program files\porchestr ator agent\porchestr atoragent.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.HttpWebRequ est = _
DirectCast(Net. WebRequest.Crea te("http://www.google.com" ), _
Net.HttpWebRequ est)
Dim myResp As Net.HttpWebResp onse = _
DirectCast(myRe g.GetResponse() , Net.HttpWebResp onse)
Dim myStream As IO.Stream = myResp.GetRespo nseStream()
Dim myreader As New IO.StreamReader (myStream)
Dim mystring As String = myreader.ReadTo End()
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
2603
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# projects only - i tried tlbimp.exe but i get
14
4482
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 created does not have a strong name, "Unable to emit assembly: Referenced assembly 'Interop.SHDocVw' does not have a strong name"
2
3743
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 mentioned to, as much clear as possible, give a picture in what environment the problems rise**** Hello experts! I would appreciate if you can address this problem I have and give a hint what could be wrong.
7
6795
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 working on each tab (and those methods are not available in 2005). I found some code on MSDN forums, but the extention didn't really cover RegisterAsBrowser. Someone told me how to do it, but it's in c and basically over my head. Even though he...
0
2489
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 webrequest command so my idea is to save it using the save command from the internet explorer but it still doen't work! The code I am using is the following: Private Sub BtnSave_Click() Dim eQuery As OLECMDID
0
3118
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 throws the output at the end of this message. My question, I guess, is what is this Keycode it's talking about? ----------BEGIN PASTE---------- See the end of this message for details on invoking
1
5463
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 server When i create an instance of Application class, i am getting following detailed error:
6
6188
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(); it generates the exception. This doesn't happen every time. I can provide more code if needed.
2
2456
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 a "Range"(selection of a single cell in this case) for each cell in my table to access parents of the linked cells.
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10578
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10332
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10077
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7620
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6853
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5522
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.