|
Question : How my Dialog is gone!!
|
|
I'm just edit a little on my Dialog source code, It can built and can run but It exits immediately!!! I've traced which line is the reason and I found it in some part on "c:\...\mfc\src\dlgcore.cpp" ...
int CDialog::DoModal() { . .
TRY { // create modeless dialog AfxHookWindowCreate(this); This line is my problem -->> if (CreateDlgIndirect(lpDialogTemplate, CWnd::FromHandle(hWndParent), hInst)) { if (m_nFlags & WF_CONTINUEMODAL) { // enter modal loop DWORD dwFlags = MLF_SHOWONIDLE; if (GetStyle() & DS_NOIDLEMSG) dwFlags |= MLF_NOIDLEMSG; VERIFY(RunModalLoop(dwFlags) == m_nModalResult); }
// hide the window before enabling the parent, etc. if (m_hWnd != NULL) SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW| SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_NOZORDER); } } Jump to here --> CATCH_ALL(e) { DELETE_EXCEPTION(e); m_nModalResult = -1; } END_CATCH_ALL
if (bEnableParent) ::EnableWindow(hWndParent, TRUE); if (hWndParent != NULL && ::GetActiveWindow() == m_hWnd) ::SetActiveWindow(hWndParent);
// destroy modal window DestroyWindow(); PostModal();
// unlock/free resources as necessary if (m_lpszTemplateName != NULL || m_hDialogTemplate != NULL) UnlockResource(hDialogTemplate); if (m_lpszTemplateName != NULL) FreeResource(hDialogTemplate);
return m_nModalResult; }
It return -1, so sorry but I really don't know How do I solve the problem!? My OS is Win2K using VC++ 6.0 SP4 and This is a second time I found this same problem!
Thanks you for your time, really thanks
[email protected]
|
|
Answer : How my Dialog is gone!!
|
|
Check this: If you deleted a control that had a member variable (defined within the class wizard), you also must delete these member variable.
|
|
|
|