Gurus,
My main dialog creates a modal dialog which in turn creates another modal dialog when the user click on a button.
/////////////////////////////
// Main Dialog //
////////////////////////////
||
///////////////////////////
// Modal DLG 1 //
//////////////////////////
||
///////////////////////////
// Modal DLG 2 //
//////////////////////////
How can I close BOTH created modals from my main dialog ??Code:void CMyModalDlg1::OnBnClick() { CMyModalDlg2 ModalDlg2(); INT_PTR iResult = ModalDlg2.DoModal(); .... }
I've tried:
ModalDlg1 is closed after calling CloseBothDialog() but it ModalDlg2 was created by Modal1, the dialog will not terminate.Code:void CModalDlg1::CloseDialog() { EndDialog( 0 ); } void CMainDlg::CloseBothDialogs() { if ( m_pModalDlg1 ) m_pModalDlg1->CModalDlg1(); }
Any advice??
Many thanks!!!




Reply With Quote