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对话框。
那是因为在 CFdfDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的
如果你要加你要弹出的对话框,可以到CFdfDlg里的确定,取消按钮的单击事件里进行添加
那是因为在 CFdfDlg dlg; m_pMainWnd = &dlg; int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的
MessageBox(NULL, "dfdfd", "dfdf", MB_OK);
但它是不会显示出来的,因为没有窗口的句柄。
{
// 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对话框。
CFdfDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的
CFdfDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();CFdfDlg的OnOk默认就执行关闭对话框操作了。你要重载CFdfDlg的OnOk才可以的