Strange things happen in my C++-MFC-application:
At this position on the call stack I throw a user-defined exception:
> ProducerUD.exe!Gui::Dialogs::BuildDialog::OnCancel() Zeile 604 C++
mfc71ud.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x0013ee04, unsigned int nID=0x00000002, int nCode=0x00000000, void (void)* pfn=0x7c295980, ....) Zeile 89 C++
mfc71ud.dll!CCmdTarget::OnCmdMsg(unsigned int nID=0x00000002, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 396 + 0x27 C++
mfc71ud.dll!CDialog::OnCmdMsg(unsigned int nID=0x00000002, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 88 + 0x18 C++
mfc71ud.dll!CWnd::OnCommand(unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 2550 C++
mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622, long * pResult=0x0013d9e8) Zeile 1759 + 0x1c C++
mfc71ud.dll!CWnd::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 1745 + 0x1e C++
zlzwfud.dll!Zeta::Windows::Forms::Specialized::DialogBase::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 221 C++
mfc71ud.dll!AfxCallWndProc(CWnd * pWnd=0x0013ee04, HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 241 + 0x1a C++
mfc71ud.dll!AfxWndProc(HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 389 C++
mfc71ud.dll!AfxWndProcBase(HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00000111, unsigned int wParam=0x00000002, long lParam=0x00460622) Zeile 209 + 0x15 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_DispatchClientMessage@20() + 0x4d
user32.dll!___fnDWORD@4() + 0x24
ntdll.dll!_KiUserCallbackDispatcher@12() + 0x13
user32.dll!_NtUserMessageCall@28() + 0xc
user32.dll!_SendMessageW@16() + 0x49
comctl32.dll!_Button_NotifyParent@8() + 0x3d
comctl32.dll!_Button_ReleaseCapture@8() + 0xd7
comctl32.dll!_Button_WndProc@16() + 0x842
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_DispatchMessageWorker@8() + 0xdc
user32.dll!_DispatchMessageW@4() + 0xf
user32.dll!_IsDialogMessageW@8() + 0xdb
mfc71ud.dll!CWnd::IsDialogMessageW(tagMSG * lpMsg=0x001640e8) Zeile 200 C++
mfc71ud.dll!CWnd::PreTranslateInput(tagMSG * lpMsg=0x001640e8) Zeile 4512 C++
mfc71ud.dll!CDialog::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 83 C++
zlzwfud.dll!Zeta::Windows::Forms::EnhancedDialog::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 194 C++
mfc71ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x004b09e4, tagMSG * pMsg=0x001640e8) Zeile 3129 + 0x12 C++
mfc71ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 238 + 0x12 C++
mfc71ud.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 795 + 0x9 C++
mfc71ud.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 257 + 0xf C++
mfc71ud.dll!AfxInternalPumpMessage() Zeile 183 + 0x18 C++
mfc71ud.dll!CWinThread::PumpMessage() Zeile 916 C++
ZpCommonCoreud.dll!Common::Gui::CoreGuiHelper::Pump(const bool throwStopException=true) Zeile 286 + 0x1e C++
ZpCommonCoreud.dll!Common::Gui::CoreGuiHelper::Pump() Zeile 340 + 0x9 C++
ProducerUD.exe!Gui::Dialogs::BuildDialog::PumpMessages() Zeile 492 + 0x8 C++
ProducerUD.exe!Gui::Dialogs::BuildDialog::Log(const ATL::CStringT<unsigned short,StrTraitMFC_DLL<unsigned short,ATL::ChTraitsCRT<unsigned short> > > & text={...}) Zeile 497 + 0xd C++
ZpRenderingud.dll!Rendering::RenderEngine::Implementation::CheckForTemplateFileChanges() Zeile 454 + 0x4a C++
ZpRenderingud.dll!Rendering::RenderEngine::BuildProjectFolder(const long projectFolderID=0x0000006c) Zeile 1097 C++
ProducerUD.exe!Gui::Dialogs::BuildDialog::OnStartProcessing(unsigned int p1=0x00000000, long p2=0x00000000) Zeile 232 + 0x18 C++
mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000, long * pResult=0x0013ea40) Zeile 2013 + 0x11 C++
mfc71ud.dll!CWnd::WindowProc(unsigned int message=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000) Zeile 1745 + 0x1e C++
zlzwfud.dll!Zeta::Windows::Forms::Specialized::DialogBase::WindowProc(unsigned int message=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000) Zeile 221 C++
mfc71ud.dll!AfxCallWndProc(CWnd * pWnd=0x0013ee04, HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000) Zeile 241 + 0x1a C++
mfc71ud.dll!AfxWndProc(HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000) Zeile 389 C++
mfc71ud.dll!AfxWndProcBase(HWND__ * hWnd=0x0116057a, unsigned int nMsg=0x00008003, unsigned int wParam=0x00000000, long lParam=0x00000000) Zeile 209 + 0x15 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_DispatchMessageWorker@8() + 0xdc
user32.dll!_DispatchMessageW@4() + 0xf
mfc71ud.dll!AfxInternalPumpMessage() Zeile 188 C++
mfc71ud.dll!CWinThread::PumpMessage() Zeile 916 C++
mfc71ud.dll!AfxPumpMessage() Zeile 195 + 0xb C++
mfc71ud.dll!CWnd::RunModalLoop(unsigned long dwFlags=0x00000004) Zeile 4566 + 0x5 C++
mfc71ud.dll!CDialog::DoModal() Zeile 527 + 0xc C++
zlzwfud.dll!Zeta::Windows::Forms::EnhancedDialog::DoModal() Zeile 113 + 0x8 C++
zlzwfud.dll!Zeta::Windows::Forms::Specialized::DialogBase::ShowModal() Zeile 69 + 0x8 C++
ProducerUD.exe!Framework::ProducerMainWindow::ExecuteGuiBuild() Zeile 1639 + 0x15 C++
ProducerUD.exe!Framework::ProducerMainWindow::OnBuild() Zeile 1745 C++
mfc71ud.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x03f18588, unsigned int nID=0x00008008, int nCode=0x00000000, void (void)* pfn=0x004031d4, ....) Zeile 89 C++
mfc71ud.dll!CCmdTarget::OnCmdMsg(unsigned int nID=0x00008008, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 396 + 0x27 C++
mfc71ud.dll!CFrameWnd::OnCmdMsg(unsigned int nID=0x00008008, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 897 + 0x18 C++
mfc71ud.dll!CWnd::OnCommand(unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 2550 C++
mfc71ud.dll!CFrameWnd::OnCommand(unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 320 C++
mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000, long * pResult=0x0013f4dc) Zeile 1759 + 0x1c C++
ProducerUD.exe!CXTPFrameWndBase<CFrameWnd>::OnWndMsg(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000, long * pResult=0x0013f4dc) Zeile 177 C++
mfc71ud.dll!CWnd::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 1745 + 0x1e C++
ProducerUD.exe!Framework::ProducerMainWindow::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 442 C++
mfc71ud.dll!AfxCallWndProc(CWnd * pWnd=0x03f18588, HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 241 + 0x1a C++
mfc71ud.dll!AfxWndProc(HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 389 C++
mfc71ud.dll!AfxWndProcBase(HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 209 + 0x15 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_CallWindowProcAorW@24() + 0x51
user32.dll!_CallWindowProcW@20() + 0x1b
XTP9510Libud.dll!CXTPHookManager::HookWndProc(HWND__ * hWnd=0x004b09e4, unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 106 + 0x1c C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_CallWindowProcAorW@24() + 0x51
user32.dll!_CallWindowProcW@20() + 0x1b
ZpCommonCoreud.dll!Common::Gui::SubclassWindow::WindowProc(unsigned int msg=0x00000111, unsigned int wp=0x00018008, long lp=0x00000000) Zeile 147 + 0x5c C++
ZpCommonCoreud.dll!Common::Gui::HookWndProc(HWND__ * hwnd=0x004b09e4, unsigned int msg=0x00000111, unsigned int wp=0x00018008, long lp=0x00000000) Zeile 219 + 0x19 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_DispatchClientMessage@20() + 0x4d
user32.dll!___fnDWORD@4() + 0x24
ntdll.dll!_KiUserCallbackDispatcher@12() + 0x13
user32.dll!_NtUserTranslateAccelerator@12() + 0xc
mfc71ud.dll!CFrameWnd::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 203 + 0x1b C++
ProducerUD.exe!CXTPFrameWndBase<CFrameWnd>::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 144 + 0xc C++
ProducerUD.exe!Framework::ProducerMainWindow::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 1142 C++
mfc71ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x004b09e4, tagMSG * pMsg=0x001640e8) Zeile 3129 + 0x12 C++
mfc71ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 238 + 0x12 C++
mfc71ud.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 795 + 0x9 C++
mfc71ud.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 257 + 0xf C++
mfc71ud.dll!AfxInternalPumpMessage() Zeile 183 + 0x18 C++
mfc71ud.dll!CWinThread::PumpMessage() Zeile 916 C++
mfc71ud.dll!CWinThread::Run() Zeile 637 + 0xb C++
mfc71ud.dll!CWinApp::Run() Zeile 701 C++
mfc71ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020dfc, int nCmdShow=0x00000001) Zeile 49 + 0xb C++
ProducerUD.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020dfc, int nCmdShow=0x00000001) Zeile 25 C++
ProducerUD.exe!wWinMainCRTStartup() Zeile 390 + 0x39 C
kernel32.dll!_BaseProcessStart@4() + 0x23 Now the exception is correctly catched by my application and it continues to work, but when leaving the main message handler at this point:
> ProducerUD.exe!Framework::ProducerMainWindow::OnBuild() Zeile 1748 C++
mfc71ud.dll!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x03f18588, unsigned int nID=0x00008008, int nCode=0x00000000, void (void)* pfn=0x004031d4, ....) Zeile 89 C++
mfc71ud.dll!CCmdTarget::OnCmdMsg(unsigned int nID=0x00008008, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 396 + 0x27 C++
mfc71ud.dll!CFrameWnd::OnCmdMsg(unsigned int nID=0x00008008, int nCode=0x00000000, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000) Zeile 897 + 0x18 C++
mfc71ud.dll!CWnd::OnCommand(unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 2550 C++
mfc71ud.dll!CFrameWnd::OnCommand(unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 320 C++
mfc71ud.dll!CWnd::OnWndMsg(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000, long * pResult=0x0013f4dc) Zeile 1759 + 0x1c C++
ProducerUD.exe!CXTPFrameWndBase<CFrameWnd>::OnWndMsg(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000, long * pResult=0x0013f4dc) Zeile 177 C++
mfc71ud.dll!CWnd::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 1745 + 0x1e C++
ProducerUD.exe!Framework::ProducerMainWindow::WindowProc(unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 442 C++
mfc71ud.dll!AfxCallWndProc(CWnd * pWnd=0x03f18588, HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 241 + 0x1a C++
mfc71ud.dll!AfxWndProc(HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 389 C++
mfc71ud.dll!AfxWndProcBase(HWND__ * hWnd=0x004b09e4, unsigned int nMsg=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 209 + 0x15 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_CallWindowProcAorW@24() + 0x51
user32.dll!_CallWindowProcW@20() + 0x1b
XTP9510Libud.dll!CXTPHookManager::HookWndProc(HWND__ * hWnd=0x004b09e4, unsigned int message=0x00000111, unsigned int wParam=0x00018008, long lParam=0x00000000) Zeile 106 + 0x1c C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_CallWindowProcAorW@24() + 0x51
user32.dll!_CallWindowProcW@20() + 0x1b
ZpCommonCoreud.dll!Common::Gui::SubclassWindow::WindowProc(unsigned int msg=0x00000111, unsigned int wp=0x00018008, long lp=0x00000000) Zeile 147 + 0x5c C++
ZpCommonCoreud.dll!Common::Gui::HookWndProc(HWND__ * hwnd=0x004b09e4, unsigned int msg=0x00000111, unsigned int wp=0x00018008, long lp=0x00000000) Zeile 219 + 0x19 C++
user32.dll!_InternalCallWinProc@20() + 0x28
user32.dll!_UserCallWinProcCheckWow@32() + 0xb7
user32.dll!_DispatchClientMessage@20() + 0x4d
user32.dll!___fnDWORD@4() + 0x24
ntdll.dll!_KiUserCallbackDispatcher@12() + 0x13
user32.dll!_NtUserTranslateAccelerator@12() + 0xc
mfc71ud.dll!CFrameWnd::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 203 + 0x1b C++
ProducerUD.exe!CXTPFrameWndBase<CFrameWnd>::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 144 + 0xc C++
ProducerUD.exe!Framework::ProducerMainWindow::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 1142 C++
mfc71ud.dll!CWnd::WalkPreTranslateTree(HWND__ * hWndStop=0x004b09e4, tagMSG * pMsg=0x001640e8) Zeile 3129 + 0x12 C++
mfc71ud.dll!AfxInternalPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 238 + 0x12 C++
mfc71ud.dll!CWinThread::PreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 795 + 0x9 C++
mfc71ud.dll!AfxPreTranslateMessage(tagMSG * pMsg=0x001640e8) Zeile 257 + 0xf C++
mfc71ud.dll!AfxInternalPumpMessage() Zeile 183 + 0x18 C++
mfc71ud.dll!CWinThread::PumpMessage() Zeile 916 C++
mfc71ud.dll!CWinThread::Run() Zeile 637 + 0xb C++
mfc71ud.dll!CWinApp::Run() Zeile 701 C++
mfc71ud.dll!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020dfc, int nCmdShow=0x00000001) Zeile 49 + 0xb C++
ProducerUD.exe!wWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, wchar_t * lpCmdLine=0x00020dfc, int nCmdShow=0x00000001) Zeile 25 C++
ProducerUD.exe!wWinMainCRTStartup() Zeile 390 + 0x39 C
kernel32.dll!_BaseProcessStart@4() + 0x23 Something gets wrong and I end up with the following call stack:
> cccccccc()
ntdll.dll!ExecuteHandler2@20() + 0x26
ntdll.dll!ExecuteHandler@20() + 0x24
ntdll.dll!_KiUserExceptionDispatcher@8() + 0xe Alternatively, when not installing a customer error handler with _se_set_translator , I end up with the following call stack:
> cccccccc() Which, of course leads to those ugly access violations and terminates my application.
Question:
Is anyone of you aware of some circumstances where it could be unsafe to throw exception during processing windows messages? Maybe I throw away some window handle where the associated WindowProc still tries to send messages to that window? Or something similar? Or something completely different?
I'm really really clueless
--
Affordable Windows-based CMS for only 99 €: try www.zeta-producer.com for free!
|