Problem with DoModal()
-
Please specify in detail , whether it is a Modal or Modeless dialog , and what do u mean by When u DoModal it sends WM_DESTROY message. Abhishek Srivastava Software Engg (VC++) India ,Noida Mobile no 9891492921 :)
-
It is a Modal dialog. What i mean is when i call DoModal(), it comes to OnDestroy() member function of the dialog window.
-
Press F9 on destroy, press F5 and then open the callstack and check what's happening Papa while (TRUE) Papa.WillLove ( Bebe ) ;
It crashes at: hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, pParentWnd->GetSafeHwnd(), AfxDlgProc); in DLGCORE.CPP hInst,lpDialogTemplate has the proper values. pParentWnd=NULL; AfxDlgProc has some value. After this it will go to OnDestroy() instead of OnInitDialog()
-
It crashes at: hWnd = ::CreateDialogIndirect(hInst, lpDialogTemplate, pParentWnd->GetSafeHwnd(), AfxDlgProc); in DLGCORE.CPP hInst,lpDialogTemplate has the proper values. pParentWnd=NULL; AfxDlgProc has some value. After this it will go to OnDestroy() instead of OnInitDialog()
-
Hi, I have a dialog based appliaction, Which was working fine. All of a sudden it started crashing at DoModal(). When i call DoModal() it send WM_DESTROY message. Could anyone please tell me what is wrong? Regards Neha
-
Hi, case 1 CDialog oCDialog; if(oCDialog.DoModal()==IDOK) { } case 2 CDialog *pCDialog; pCDialog = new pCDialog;
-
Did u change the resource file just before it started crashing? Papa while (TRUE) Papa.WillLove ( Bebe ) ;
-
Hi, I have a dialog based appliaction, Which was working fine. All of a sudden it started crashing at DoModal(). When i call DoModal() it send WM_DESTROY message. Could anyone please tell me what is wrong? Regards Neha
-
what i meant by enumerting the cases was that if you do not create the dialog box within if condition then the WM_DESTROY will get generated and it will destroy you dialog box. if you don't wanna use if condition to create a dialog box then you will have to allocate memory to the dialog box pointer with new opeator. i hope this solves your prob.