Re: WaitForSingleObject() failing?
- From: "Alexander Grigoriev" <alegr@xxxxxxxxxxxxx>
- Date: Thu, 5 Jan 2006 20:40:27 -0800
You may have to wait for the thread if you want to exit the app (or delete
the objects it uses) before the thread finishes by itself.
It's always a good idea to keep track of the thread(s), to allow graceful
shutdown of those.
"Joseph M. Newcomer" <newcomer@xxxxxxxxxxxx> wrote in message
news:j39rr152gtuhr11jv36fevc1stdfu0l2fc@xxxxxxxxxx
> ****
> And how does this change the fundamental problem? The fundamental problem
> is that to do
> what you are trying to do, you MUST create the thread suspended, set its
> m_bAutoDelete
> flag to FALSE, and then resume the thread. However, a simpler solution is
> to ignore this
> entirely. You don't need to save the CWinThread object for the first
> thread; just do as I
> suggested, and have the termination of the thread PostMessage a request to
> start the
> second thread. Lose the WaitForSingleObject *entirely*, as it represents
> an untenable
> programming style.
> *****
.
- Follow-Ups:
- Re: WaitForSingleObject() failing?
- From: Joseph M . Newcomer
- Re: WaitForSingleObject() failing?
- References:
- WaitForSingleObject() failing?
- From: Davinder
- Re: WaitForSingleObject() failing?
- From: Davinder
- Re: WaitForSingleObject() failing?
- From: Joseph M . Newcomer
- WaitForSingleObject() failing?
- Prev by Date: RE: Web Browser Control on MFC View will crash application when view is destroied after loading XML file
- Next by Date: Re: Dialog Box Active
- Previous by thread: Re: WaitForSingleObject() failing?
- Next by thread: Re: WaitForSingleObject() failing?
- Index(es):
Relevant Pages
|
Loading