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__)