Microsoft Windows CE 3.0  

CMsgThread::WaitForThreadExit

Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Blocks until the thread exits.

BOOL WaitForThreadExit(
LPDWORD
lpdwExitCode
);

Parameters

lpdwExitCode
Exit code returned by the thread.

Return Values

Returns either TRUE or FALSE, the meaning of which is determined by the class supplying the overridden CMsgThread::ThreadMessageProcmember function and the calling member function.

Remarks

Ensure that the worker thread has exited completely before completing the destruction of your derived class; otherwise, the thread might still execute after your dynamic-link library (DLL) has been unloaded from the address space of the process. Even if the only instruction left to exit is a single-return instruction, this would cause an exception. The only reliable way to ensure that the thread has exited is to signal the thread to exit (using a privately negotiated CMsgobject sent to the CMsgThread::PutThreadMsgmember function) and then call this member function. You should do this in the destructor for your derived class.