Re: is thread still running
- From: "Doug Harrison [MVP]" <dsh@xxxxxxxx>
- Date: Mon, 16 May 2005 23:28:44 -0500
On Tue, 17 May 2005 07:06:17 +0200, z f wrote:
> ok,
>
> then how do i destroy the instance created with AfxBeginThread?
http://groups-beta.google.com/group/microsoft.public.vc.mfc/msg/10f8a2138b08f866?hl=en
<q>
If you set m_bAutoDelete to false, you assume the
responsibility for deleting the CWinThread,
</q>
So, you would do something like this (pseudocode):
pThread = AfxBeginThread(...CREATE_SUSPENDED...);
pThread->m_bAutoDelete = false;
pThread->ResumeThread();
....
WaitForSingleObject(pThread->m_hThread, INFINITE);
....
delete pThread;
--
Doug Harrison
Microsoft MVP - Visual C++
.
- References:
- is thread still running
- From: ziggy
- Re: is thread still running
- From: Doug Harrison [MVP]
- Re: is thread still running
- From: z f
- is thread still running
- Prev by Date: Re: SQLDriverConnect() gives "user breakpoint" and no more help
- Next by Date: Re: concurrently typing in two edit box
- Previous by thread: Re: is thread still running
- Next by thread: How to view HTML page in a dialog
- Index(es):
Relevant Pages
|