Groups | Blog | Home
all groups > dotnet myservices > february 2005 >

dotnet myservices : SHDocVw


SLE
2/14/2005 2:04:29 PM
Hi there,

The following code does not work from a .NET service:

Private Sub EnumIEWindows()
Dim sw As SHDocVw.ShellWindows
Dim ie As InternetExplorer

Try
sw = New SHDocVw.ShellWindows

For Each ie In sw
Debug.WriteLine(DateTime.Now & " " & ie.LocationURL)
Next
Catch ex As Exception
(cut)
Finally
sw = Nothing
ie = Nothing
End Try
End Sub

The above code *does* work from a console/forms application on the same
machine. The service runs under local system account, with desktop
interaction. Changing it into e.g. the local Administrator does not help.

The following exception is thrown:

System.Runtime.InteropServices.COMException (0x80040154): COM object
with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not valid or
not registered.

Any clues?


Thanks,

--
Lee Gillie
2/21/2005 10:18:12 PM
[quoted text, click to view]

Try changing your service (at least temporarily) to use the same logon
username / password you use. This would be a domain logon, and have
access to the network. The local system account does not have access to
the network.

AddThis Social Bookmark Button