Re: Batch file and MFC (Properly Terminating Application)
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Wed, 07 Feb 2007 11:32:14 -0500
See below...
On 7 Feb 2007 06:34:32 -0800, "one-trick-pony" <worldofpain.aamir@xxxxxxxxx> wrote:
void CDummy1Dlg::OnClose()****
{
// TODO: Add your control notification handler code here
running = FALSE;
WaitForSingleObject(myWorkerThread->m_hThread,INFINITE);
delete myWorkerThread; <<PROGRAM CRASHES HERE
EndDialog(0); //
CDummy1Dlg::OnClose();
}
Thanks Scott- It works. Is this legal? Are we using brute force to
shut it down or would this be considered graceful shutdown?
Actuall, what we're seeing here is an instance of graceful shutdown. Brute force is
TerminateThread.
****
And also,****
Joseph may not like magic number '0' in EndDialog. Is there an
alternative, ie, user defined IDEND datatype?
IDOK
****
At this point in time, I would like to thank all of you guys whoJoseph M. Newcomer [MVP]
helped me toward becoming better coder and gave me new prespectives.
I will continue to study. Like with any other skill, to sharpen it
one must practice over and over.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- Follow-Ups:
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- References:
- Re: Batch file and MFC (Properly Terminating Application)
- From: Scott McPhillips [MVP]
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- From: Scott McPhillips [MVP]
- Re: Batch file and MFC (Properly Terminating Application)
- From: Joseph M . Newcomer
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- From: Scott McPhillips [MVP]
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- From: Scott McPhillips [MVP]
- Re: Batch file and MFC (Properly Terminating Application)
- From: one-trick-pony
- Re: Batch file and MFC (Properly Terminating Application)
- Prev by Date: Re: OT - Productivity level?
- Next by Date: Re: Main Icon Problem..
- Previous by thread: Re: Batch file and MFC (Properly Terminating Application)
- Next by thread: Re: Batch file and MFC (Properly Terminating Application)
- Index(es):