1. construct same as model
CModelessTest
2.
pModelessTest = new CModelessTest;
pModelessTest->Create(IDD_MODELESS,this);
pModelessTest->ShowWindow(SW_SHOWNORMAL);
3. derived the following functions:
void CModelessTest::PostNcDestroy()
{
// TODO: Add your specialized code here and/or call the base class
delete this;
}
BOOL CModelessTest::Create(UINT nID, CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(nID, pParentWnd);
}
void CModelessTest::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
CDialog::OnOK();
DestroyWindow();
}