Jump to content
  • Advertisement
Sign in to follow this  
derek7

Untitled

This topic is 4353 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
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!