Re: Batch file and MFC (Properly Terminating Application)



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? And also,
Joseph may not like magic number '0' in EndDialog. Is there an
alternative, ie, user defined IDEND datatype?
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.

.



Relevant Pages


Loading