This is my first real venture into multithreading. I have tried placing
Try...Catch blocks around the 'DirectorySearcher' declaration and also placed
debug.print statements either side. No exceptions are being reported and the
post debug.print statement also doesn't get executed.
If each thread is dieing is there a way to report this back to the main
application thread?
[quoted text, click to view] "Chris Chilvers" wrote:
> On Sun, 30 Apr 2006 23:52:01 -0700, Michael
> <Michael@discussions.microsoft.com> wrote:
>
> >Hi,
> >
> >I am trying to create a multithreaded VB 2005 application which attempts to
> >create a new thread per Domain Controller (DC) in my environment. Each thread
> >connects to its allocated DC and enumerates all computer objects and extracts
> >the 'LastLogon' property. The results from each thread is then consolidated
> >so that I can get the true lastlogon date for each computer object.
> >
> >However in my routine thats get actioned per thread, I have used the
> >following line which seems to halt each thread and doesn't progress to the
> >next line of code:
> >
> >
> >Dim searcher As New DirectorySearcher("LDAP://" + dc.Domain.ToString & "/" &
> >dc.Name)
> >
> >Where dc is defined as ActiveDirectory.DomainController.
> >
> >This is my method of connecting directly to a specific domain controller.
> >Why would this process halt when it works fine if I do not use
> >multithreading? Is there a better way of connecting directly to a domain
> >controller that would get around this problem?
> >
> >Thanks,
> >Michael.
> >
>
> Could this method call be failing whilst multithreading and generating
> an exception? As once moved to another thread this can cause the thread
> to silently die.
On Sun, 30 Apr 2006 23:52:01 -0700, Michael
[quoted text, click to view] <Michael@discussions.microsoft.com> wrote:
>Hi,
>
>I am trying to create a multithreaded VB 2005 application which attempts to
>create a new thread per Domain Controller (DC) in my environment. Each thread
>connects to its allocated DC and enumerates all computer objects and extracts
>the 'LastLogon' property. The results from each thread is then consolidated
>so that I can get the true lastlogon date for each computer object.
>
>However in my routine thats get actioned per thread, I have used the
>following line which seems to halt each thread and doesn't progress to the
>next line of code:
>
>
>Dim searcher As New DirectorySearcher("LDAP://" + dc.Domain.ToString & "/" &
>dc.Name)
>
>Where dc is defined as ActiveDirectory.DomainController.
>
>This is my method of connecting directly to a specific domain controller.
>Why would this process halt when it works fine if I do not use
>multithreading? Is there a better way of connecting directly to a domain
>controller that would get around this problem?
>
>Thanks,
>Michael.
>
Could this method call be failing whilst multithreading and generating
an exception? As once moved to another thread this can cause the thread