非模态对话框:
if (m_dlg==NULL)
{
m_dlg=new CPutInLib;
m_dlg->Create(IDD_Dlg_MedicPutLib,NULL);
m_dlg->ShowWindow(SW_SHOW);
m_dlg->CenterWindow();//对话框居中显示
}
在父对话框销毁窗体时释放:
if (m_dlg!=NULL)
{
delete m_dlg;
m_dlg=NULL;
}
模态对话框:
CLogInDlg dlg;
dlg.DoModal();