CPrintDialog problem
-
I'm losing all my hair on this one. In my app, I create a CPrintDialog like this:
CPrintDialog dlg(FALSE); dlg.DoModal();
which is very basic stuff. Running this, the dialog appears. When I select the printer properties, the app closes itself without a message! So I created a new app with the MFC wizard. In this app, I've put the same code. And guess what: no problems at all. The printer properties are shown without a problem. To make things worse, I only have this problem in NT SP6. No problem in W2K. Haven't tested this on other windows versions... In debugging, I get an assertion. Pressing retry on the assertion: call stack:AfxWndProc(HWND__ * 0x0012e870, unsigned int 1240072, unsigned int 1239180, long 1239124) line 365 + 25 bytes AfxWndProcBase(HWND__ * 0x0012e870, unsigned int 1240072, unsigned int 1239180, long 1239124) line 220 + 21 bytes
function:///////////////////////////////////////////////////////////////////////////// // The WndProc for all CWnd's and derived classes LRESULT CALLBACK AfxWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam) { // special message which identifies the window as using AfxWndProc if (nMsg == WM_QUERYAFXWNDPROC) return 1; // all other messages route through message map CWnd* pWnd = CWnd::FromHandlePermanent(hWnd); ASSERT(pWnd != NULL); // ASSERT FAIL HERE ASSERT(pWnd->m_hWnd == hWnd); return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam); }
Any ideas? I'm thinking of some conflicting resources... New and improved: kwakkelflap.com