主对话框返回IDOK后,我再创建一个对话框,domodal,可是这时候这个对话框会直接退出。请问这是怎么回事?           CPngWindowDlg dlg;
m_pMainWnd = &dlg;
SetDialogBkColor(RGB(100,100,100), RGB(0, 0, 0));
int nResponse = dlg.DoModal();
PngwindowSever  pngSeverDlg;
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with OK
m_pMainWnd = &pngSeverDlg;
int   nRes = pngSeverDlg.DoModal(); //Domodal后会直接退出
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
//  dismissed with Cancel

}