Re: Batch file and MFC (Properly Terminating Application)



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 who
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.
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.