I am trying to port a 32bit application to 64 bit. The calculations appear to run correctly, but I cannot configure the views properly. I am using MFC, C++ and OpenGL, Intel 10.0.027 compiler inside VS2005 on a W7 x64 machine.
When the crash happens, I get the following message: "First-chance exception at 0xffffffff8043b1b6 in 3DApp.exe: 0xC0000005: Access violation at location 0xffffffff8043b1b6" and this is the stack trace:
ffffffff8043b1b6()
user32.dll!UserCallWinProcCheckWow() + 0x11d bytes
user32.dll!DispatchMessageWorker() + 0x12a bytes
3DApp.exe!AfxInternalPumpMessage() Line 183 C++
3DApp.exe!CWinThread::PumpMessage() Line 896 C++
3DApp.exe!CWinThread::Run() Line 625 + 0x13 bytes C++
NOTE PLEASE why is UserCallWinProcCheckWow called, I thought Wow suffix was only for emulating 32 bit applications on 64 bit computer
Obviously, somewhere a 64 bit pointer gets treated as a 32 bit pointer, but I cannot pin point where that happens. I loaded debug symbols from microsoft, which show the top of the call stack.
Any help greatly appreciated. Leon
EDIT
The code calling DispatchMessage is:
if (pState->m_msgCur.message != WM_KICKIDLE && !AfxPreTranslateMessage(&(pState->m_msgCur)))
{
::TranslateMessage(&(pState->m_msgCur));
::DispatchMessage(&(pState->m_msgCur));
}
The pointers of pState appear to be 64 bit at this stage.
State of pState->m_msgCu:
I have just fixed an issue with the same behavior. The bug was in passing parameters to SetWindowLongPtr( GWLP_WNDPROC ), pointer to WndProc was improperly casted to LONG instead of correct LONG_PTR. This way, bad pointer to WndProc was put into internal OS WND struct, so any following call to the HWND's WndProc crashed.
It looks like the the problem is happening in a call to DispatchMessage inside MFC. It would be helpful if you'd post the parameters to this call.
OK, 0x00000022 is the WM_CHILDACTIVATE mesasage. It takes no parameters, so it can't be a problem with those. The only other possible cause that springs to mind is that the window prodedure isn't valid. For example, the DLL that contains it could have been unloaded or the window could have been subclassed with an invalid address.
User contributions licensed under CC BY-SA 3.0