When you start your thread, you chose what procedure it starts... However
you can pass in a state object (using thread pool) or set whatever
properties you want to a custom class using the Thread.Start method (which
has no parameters allowed to be sent in, but you can just set these in
properities)
The easiest way to do it from that point is adding a andling to
Application.Exit, Application.Exception, and Application.ThreadException
that will then notify the class that is running on the separate thread that
something died. and go from there. But you still need to have a loop that
says
While not bHasExited
'WARNING put in a sleep timer here because it will eat up a lot of cycle
time just looping.
Wend
"Marty" <xm******@hotmail.com> wrote in message
news:oGwfd.8352$df2.3864@edtnps89...
Hi,
When creating a thread, how do I make it loop until a specific condition
happen to make it end?
Just for instance, I want a thread to loop until (appl. is closed) to
perform actions on items within a collection.
Does it need a callback function?
Thanks you
Marty