Advertisement Jump to content
Sign in to follow this  


This topic is 4590 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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;

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!