解决方案 »

  1.   

    MessageBox是CWnd类的函数。应用程序类不认识,把它当成是API函数了。而API的MessageBox和CWnd类的MessageBox函数的区别是API的MessageBox函数多要一个参数,就是第一个参数HWND,即窗口句柄
      

  2.   

    可以在里面
    MessageBox(NULL, "dfdfd", "dfdf", MB_OK);
    但它是不会显示出来的,因为没有窗口的句柄。
      

  3.   

    if (nResponse == IDOK)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with OK
    MessageBox(NULL, "IDOK", "caption", MB_OK);
    }
    else if (nResponse == IDCANCEL)
    {
    // TODO: Place code here to handle when the dialog is
    //  dismissed with Cancel
    MessageBox(NULL, "IDCANCEL", "caption", MB_OK);
    }
    当按“确定”或“取消”的时候,没有弹出msg对话框。
      

  4.   

    那是因为在
    CFdfDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的
      

  5.   

    如果你要加你要弹出的对话框,可以到CFdfDlg里的确定,取消按钮的单击事件里进行添加
      

  6.   

    那是因为在
    CFdfDlg dlg;
    m_pMainWnd = &dlg;
    int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的