From 0180c588015a42d7e091ebe5191841b0e1167438 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 Oct 2013 10:34:19 +0000 Subject: [PATCH] Call SetErrorMode() for all Windows applications, not just wxMSW ones. This suppresses default system error message boxes when trying to load an invalid DLL in wxGTK/Windows. Closes #15559. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/appbase.cpp | 4 ++++ src/msw/app.cpp | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index da6f2948ef..68113d9956 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -173,6 +173,10 @@ wxAppConsoleBase::~wxAppConsoleBase() bool wxAppConsoleBase::Initialize(int& WXUNUSED(argc), wxChar **WXUNUSED(argv)) { +#if defined(__WINDOWS__) && !defined(__WXWINCE__) + SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); +#endif + return true; } diff --git a/src/msw/app.cpp b/src/msw/app.cpp index cadcdaaead..9d9b1ce161 100644 --- a/src/msw/app.cpp +++ b/src/msw/app.cpp @@ -646,12 +646,6 @@ bool wxApp::Initialize(int& argc, wxChar **argv) SHInitExtraControls(); #endif -#ifndef __WXWINCE__ - // Don't show a message box if a function such as SHGetFileInfo - // fails to find a device. - SetErrorMode(SEM_FAILCRITICALERRORS|SEM_NOOPENFILEERRORBOX); -#endif - wxOleInitialize(); #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)