我认为因为
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
其中的IDOK事实上就响应了关闭这个程序的消息了,那么你就不可能再调用另一个窗口,你如果自己弄一个BUTTON,我想就不会这样子了
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
其中的IDOK事实上就响应了关闭这个程序的消息了,那么你就不可能再调用另一个窗口,你如果自己弄一个BUTTON,我想就不会这样子了
解决方案 »
- 分享我淘到的一些VC例子
- 超难问题:MFC2005的控件没有anchor属性,怎么实现?!
- 我编译出来的文件超大,怎么办?
- 我做了一个基于MFC的程序,现在想把它做成ActiveX控件,可以在 Web 中运行,就像是整个程序嵌入到网页中一样,请问有没有直接的方法可以
- 请问像Flashget(未注册版本)工具栏下方的网页广告条是如何实现的
- 对话框的一系列问题
- 多线程(N个)的周期调度,细节技术问题!!!
- 两个头文件互相包含的问题
- VB写的DLL支不支持内存驻留?
- 如何在service中显示一个MessageBox
- vc高手看过来!如何实现通过程序拨号(专线猫)请给出例子!急.急.急!
- windows内存问题!
SecDlg dd;
nResponse = dd.DoModal();
加在OnOK()中
肯定行
delete this;
SecDlg dd;
nResponse = dd.DoModal();
加在OnOK()中
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (dlg.DoModal == IDOK)
{
SecDlg dd;
dd.DoModal(); //返回 -1
}
else
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
return FALSE;
}
email: [email protected]
应该是:
CMainDlg dlg;
m_pMainWnd = &dlg;
if (dlg.DoModal() == IDOK)//直接调用
{
SecDlg dd;
dd.DoModal(); //返回 -1
}
else
{
// TODO: Place code here to handle when the g is
}
return FALSE;
}
在显示第二个窗口前,消息队列里还压着一个WM_QUIT。把它扔掉第二个对话框就出来了。
CMyApp::InitInstance()
{
CMainDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
MSG msg;
while( PeekMessage(&msg, NULL, WM_QUIT, WM_QUIT, PM_REMOVE) );
SecDlg dd;
m_pMainWnd = ⅆ //这个是必须的
nResponse = dd.DoModal();
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
return FALSE;
}