Re: Batch file and MFC (Properly Terminating Application)

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Whoops! I missed that...
joe

On Wed, 07 Feb 2007 11:25:30 -0500, "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
wrote:

one-trick-pony 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?

Not legal - a function calling itself causes infinite recursion, leading
to stack overflow. If this is not a typo, remove the call to
CDummy1Dlg::OnClose();
Joseph M. Newcomer [MVP]
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.


Quantcast