DavidGreenfield
asked on
How to create a Thread Handler
How can I create an array? of threads that are accessible from forms and classes within my application??
I am putting
Public thread_handler() As Thread
in my form and adding threads using
Dim count As New Integer
If thread_handler Is Nothing Then count = 0 Else count = UBound(thread_handler) + 1
ReDim Preserve thread_handler(count)
thread_handler(count) = t 'add thread to thread handler
but is this correct and is there a better way as I am having some problems with checking threads (where activex objects aren't returning information) ie.
Error: COM object that has been separated from its underlying RCW cannot be used.
System.Runtime.InteropServ ices.Inval idComObjec tException : COM object that has been separated from its underlying RCW cannot be used
and I think its because of the way I am handling them???
Thanks
I am putting
Public thread_handler() As Thread
in my form and adding threads using
Dim count As New Integer
If thread_handler Is Nothing Then count = 0 Else count = UBound(thread_handler) + 1
ReDim Preserve thread_handler(count)
thread_handler(count) = t 'add thread to thread handler
but is this correct and is there a better way as I am having some problems with checking threads (where activex objects aren't returning information) ie.
Error: COM object that has been separated from its underlying RCW cannot be used.
System.Runtime.InteropServ
and I think its because of the way I am handling them???
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.