example:
// i create thread like that
::AfxBeginThread(..) // returns a CWinThread *
// My question is, in this case how can i use a mechanism like thread.join()
??
thanks in advance..
my_thread = AfxBeginThread(...);
..
.
::WaitForSingleObject(my_thread, INFINITE);
// WaitForSingleObject seems OK, any comments??
WaitForSingleObject(my_thread->m_hThread, INFINITE);
--
Scott McPhillips [VC++ MVP]
CWinThread* pthr = AfxBeginThread(..., CREATE_SUSPENDED, ...);
pthr->m_bAutoDelete = FALSE;
...
::WaitForSingleObject(pthr->m_hThread, INFINITE);
delete pthr;
"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:%23VZkWWF...@TK2MSFTNGP15.phx.gbl...
Use WaitForSingleObject and related functions. See this message for much
more on this and other MFC multithreading issues:
http://groups-beta.google.com/group/microsoft.public.vc.mfc/msg/10f8a2138b08f866?hl=en
--
Doug Harrison
Microsoft MVP - Visual C++