closing the opened dialog from cchildframe::OnClose()
-
Hi all, My application is an MDI application I have an "open" button in one dialog box , which upon click, opens up a child window . But one i close the child window , i need to close the dialog also . I know that i should handle within the CChildFrame::OnClose() function,but i dont't know how to get the dialog handle and close it. I have tried creating CMydialog *dlg in the CChildFrame class and invoking dlg->ShowWindow(SW_CLOSE), but the dialog is not closing Could you please tell me how to overcome this problem
-
Hi all, My application is an MDI application I have an "open" button in one dialog box , which upon click, opens up a child window . But one i close the child window , i need to close the dialog also . I know that i should handle within the CChildFrame::OnClose() function,but i dont't know how to get the dialog handle and close it. I have tried creating CMydialog *dlg in the CChildFrame class and invoking dlg->ShowWindow(SW_CLOSE), but the dialog is not closing Could you please tell me how to overcome this problem
Try dlg->DestroyWindow() instead. You also have to delete dlg at some point unless you've taken the steps to make the modeless dialog self deleting. Mark