// In a dialog-based MFC application, it appears that one cannot pop
// up a message box after displaying one or more dialog boxes
// (see also MFC KBase article #Q138681):
BOOL CMyWinApp::InitInstance()
{
m_pMainWnd = NULL; // needed to prevent WM_QUIT
CMyDialog1 dlg1;
dlg1.DoModal(); // succeeds
CMyDialog2 dlg2;
dlg2.DoModal(); // succeeds
if ( ::MessageBox(NULL, "View results ?", "App",
MB_ICONINFORMATION | MB_YESNO) == IDYES )
{
// the message box fails to display;
// it flashes briefly and disappears
// without accepting user input
// the following code always executes:
int x;
x = 0; // whatever
}
// How can I force the message box to display?Quote:}
Thank you,
Alex