B
Bmack500
Hello, and Thanks in advance!
Using: Vstudio 2005, XP, .NET 2.0
I'm getting the following error when running my code below. I'm
passing an object array which contains other variables. It happens
immediately when it hits the "For" loop:
Unable to cast COM object of type 'System.__ComObject' to interface
type 'IDirectorySearch'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{109BA8EC-92F0-11D0-A790-00C04FD8D5A8}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
I also have a problem where in my "New" method, it gives me a late
binding error with option strict on.
I'm basically creating multiple threads from this thread to go and do
some time consuming work, which doesn't require much processing power
or resources.
Option Strict Off
Imports System.Text.RegularExpressions
Public Class controlThreadClass
Dim svrInfo As serverInfo
Dim mtDict As Dictionary(Of Integer, String)
Dim svrResults As System.DirectoryServices.SearchResultCollection
Dim threadList As System.Collections.ArrayList
Dim objSrvr As System.DirectoryServices.SearchResult
Public Sub New(ByVal obj As Object)
svrInfo = DirectCast(obj(0), serverInfo)
mtDict = DirectCast(obj(1), Dictionary(Of Integer, String))
svrResults = DirectCast(obj(2),
System.DirectoryServices.SearchResultCollection)
End Sub
Public Sub ControlThread()
'This thread keeps the UI responsive and manages the
serverThread threads
Dim i2 As Integer = 1
Dim sThread As System.Threading.Thread
Dim creds As New secCreds
Dim su As New SwitchUser
Dim serverThread As serverThreadClass
Dim serverThreadVals As Object
Dim strVal As String
'Here's where my error occurs, as soon as you hit the "For" loop...
For Each objSrvr In svrResults
....other code here.....
End If
i2 += 1
Next
End Sub
End Class
Using: Vstudio 2005, XP, .NET 2.0
I'm getting the following error when running my code below. I'm
passing an object array which contains other variables. It happens
immediately when it hits the "For" loop:
Unable to cast COM object of type 'System.__ComObject' to interface
type 'IDirectorySearch'. This operation failed because the
QueryInterface call on the COM component for the interface with IID
'{109BA8EC-92F0-11D0-A790-00C04FD8D5A8}' failed due to the following
error: No such interface supported (Exception from HRESULT: 0x80004002
(E_NOINTERFACE)).
I also have a problem where in my "New" method, it gives me a late
binding error with option strict on.
I'm basically creating multiple threads from this thread to go and do
some time consuming work, which doesn't require much processing power
or resources.
Option Strict Off
Imports System.Text.RegularExpressions
Public Class controlThreadClass
Dim svrInfo As serverInfo
Dim mtDict As Dictionary(Of Integer, String)
Dim svrResults As System.DirectoryServices.SearchResultCollection
Dim threadList As System.Collections.ArrayList
Dim objSrvr As System.DirectoryServices.SearchResult
Public Sub New(ByVal obj As Object)
svrInfo = DirectCast(obj(0), serverInfo)
mtDict = DirectCast(obj(1), Dictionary(Of Integer, String))
svrResults = DirectCast(obj(2),
System.DirectoryServices.SearchResultCollection)
End Sub
Public Sub ControlThread()
'This thread keeps the UI responsive and manages the
serverThread threads
Dim i2 As Integer = 1
Dim sThread As System.Threading.Thread
Dim creds As New secCreds
Dim su As New SwitchUser
Dim serverThread As serverThreadClass
Dim serverThreadVals As Object
Dim strVal As String
'Here's where my error occurs, as soon as you hit the "For" loop...
For Each objSrvr In svrResults
....other code here.....
End If
i2 += 1
Next
End Sub
End Class