I have a problem with exiting from my application.
In the InitInstance of my Application (CProgramApp) class I do a DoModal on a CDialog (CProgramDlg).
*** InitInstance code snip ***
m_pMainWnd = dlg = new CProgramDlg();
int nResponse = dlg->DoModal();
if (nResponse == IDOK)
else if (nResponse == IDCANCEL)
When my code has run to the end in my CProgramApp and I type
I get an error "user breakpoint at...." and if I debug I can see this assertion failure:
CWnd* pWnd = CWnd::FromHandlePermanent(hWnd);
ASSERT(pWnd != NULL);
(pWnd is a null pointer here!)
What did I forget???