> For some reason WaitForSingleObject(hThread) locks up. I'll try > CoWaitForMultipleHandles with hThread. >
Possibly the code in the file plug-in in dll_detach may be give you some helpful ideas. It is shutting down any threads which are in wait state from file.runwait. I understand that you have the same situation that a worker thread may be in the wait state and you need to shut it down. This code does that. If your worker thread is not normally in the wait state, then would need to augment this idea. For PowerPro, if the thread happened not to be in the wait state, now that I look at it, there is actually a potential deadlock, since the thread's function could sendmessage to powerpro itself (ie the thread that has just send an event and is now wait for thread to die). I should be checking for the unload event before that, but it seems this error has never been reported so I am assuming it is too rare to worry about. Possibly not the situation for you.
