// CMyDialog inherits from CDialog void CMyFrame::OnBnClickedCreate() { CMyDialog* dlg = new CMyDialog(); dlg->Create( IDD_MYDIALOG, m_thisFrame ); d
If you manually call Create on a dialog, you have to manually Destroy it as well. When using DoModal() this isn't necessary.
Create
Destroy
DoModal()
From MSDN:
Use the CWnd::DestroyWindow function to destroy a dialog box created by the Create function.