2025-04-27 07:49:33 -04:00

72 lines
3.5 KiB
Plaintext

I have a MFC COleControl based ActiveX control which brings up a CPropertySheet based wizard in NT 4, SP 3, with Visual C++ 6.0. The controls are hosted in IE 4 web pages. If the user opens a second IE window via "File New Window ctrl-n" and brings up the wizard from each control and interacts with both of thw wizards we are seeing a MFC failure in the function CWnd::FromHandlePermanent.
I am able to repro the problem with a small do nothing control which brings up a small do nothing wizard which is shared out as \\a-judypo1\wiztest.
Below I have a repro scenario, the Afx function where the failure occurs and the complete stack at failure.
Question:
Does anyone know what is causing the failure and if there is a work around?
To repro failure:
Load project from \\a-judypo1\wiztest into Visual C++ 6.0.
Run it.
Open a second IE window via "File New Window ctrl-n" from the IE menu.
Click on the control to bring up the wizard from both IE windows.
Overlap the wizards and do "Next", and "Back", and move the windows around unitl you see the failure. I do not have a precise repro here and you will just have to manipulate things until it fails. The message being processed at the time of failure is usually WM_TIMER but I also see the failure less often on the WM_MOUSEMOVE message.
CWnd member function FromHandlePermanent fails in AfxWndProc:
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); <---- THIS FAILS!
ASSERT(pWnd != NULL);
ASSERT(pWnd->m_hWnd == hWnd);
return AfxCallWndProc(pWnd, hWnd, nMsg, wParam, lParam);
}
Stack at failure:
AfxWndProc(HWND__ * 0x004d04fc, unsigned int 0x0000000f, unsigned int 0x00000000, long 0x00000000) line 365 + 25 bytes
AfxWndProcDllStatic(HWND__ * 0x004d04fc, unsigned int 0x0000000f, unsigned int 0x00000000, long 0x00000000) line 57 + 21 bytes
USER32! DispatchClientMessage@20 + 42 bytes
USER32! __fnDWORD@4 + 36 bytes
NTDLL! KiUserCallbackDispatcher@12 + 19 bytes
AfxWndProcDllStatic(HWND__ * 0x1001a9b8, unsigned int 0x0169fb4c, unsigned int 0x0169fc40, long 0x0169fbd4) line 55
USER32! 77e712d8()
USER32! DispatchMessageA@4 + 11 bytes
CWinThread::PumpMessage() line 846
CWnd::RunModalLoop(unsigned long 0x00000004) line 3478 + 19 bytes
CPropertySheet::DoModal() line 827 + 12 bytes
CWizTestCtrl::OnLButtonUp(unsigned int 0x00000000, CPoint {x=0x0000003e y=0x00000027}) line 257 + 28 bytes
CWnd::OnWndMsg(unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e, long * 0x0169fd6c) line 1964
CWnd::WindowProc(unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e) line 1585 + 30 bytes
COleControl::WindowProc(unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e) line 1720 + 20 bytes
AfxCallWndProc(CWnd * 0x01542a70 {CWizTestCtrl hWnd=???}, HWND__ * 0x003e04be, unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x003e04be, unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e) line 368
AfxWndProcDllStatic(HWND__ * 0x003e04be, unsigned int 0x00000202, unsigned int 0x00000000, long 0x0027003e) line 57 + 21 bytes
USER32! DispatchMessageWorker@8 + 135 bytes
USER32! DispatchMessageA@4 + 11 bytes
SHDOCVW! 70767b19()
SHDOCVW! 707679ac()
KERNEL32! BaseThreadStart@8 + 81 bytes
Judy Powell