Hi all,
I’ve created a modeless dialog from my main dialog as follows:
This container dialog creates a child dialog which I show inside the containerCode:m_pContainerDlg = new CDlgContainer(NULL, this); m_pContainerDlg->Create(CDlgContainer::IDD, GetDesktopWindow()); m_pContainerDlg ->ShowWindow(SW_SHOW);
From my child dialog I then create a modal dialog when a user clicks on a buttonCode:BOOL CDlgContainer::OnInitDialog() { // Create the child dialog and show it m_pChildDlg = new CChildDlg(this); m_pChildDlg->Create(IDD_DIRECTORY_DIALOG, this); return FALSE; }
My problem is that the CMyDlg is modal but to the main dialog and not to the container or the child dialog.Code:CChildDlg:: CChildDlg (CWnd* pParent /*=NULL*/) : m_pParent((CDlgContainer*)pParent), { } void CChildDlg::OnBnClickedBtn() { CMyDlg MyDlg; INT_PTR iResult = MyDlg.DoModal(pParent); }
Can anyone please advise??




Reply With Quote