CFreeSenderDlg dlg;
m_pMainWnd = &dlg
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
::MessageBox(0,"ok",0,0);
}
else if (nResponse == IDCANCEL)
{
::MessageBox(0,"ok",0,0); // not pop up;
CDialog c(IDD_ABOUTBOX);
c.DoModal(); // not pop up;
}
else
{
::MessageBox(0,"操你妈,在那",0,0);
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
Found a hack-around on CodeProject:
It's obviously a MFC problem. You're using a dialog based app and MFC sets the apps main window handle to your dialog (but doesn't actually need it).
If you simply comment the line:
m_pMainWnd = &dlg
to this:
//m_pMainWnd = &dlg
before the call to DoModal all your messageboxes and dialogs after DoModal should work without problems.
It's obviously a MFC problem. You're using a dialog based app and MFC sets the apps main window handle to your dialog (but doesn't actually need it).
If you simply comment the line:
m_pMainWnd = &dlg
to this:
//m_pMainWnd = &dlg
before the call to DoModal all your messageboxes and dialogs after DoModal should work without problems.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement