X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d76a558d4d5216b0590907b92d3182f82057c1ae..3cfde7c049bddf6fd3b4c2e35a6b8ecdcdc1d74f:/src/msw/main.cpp diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 80c14d917a..5c11efd693 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -69,7 +69,15 @@ extern int wxEntryCleanupReal(int& argc, wxChar **argv); #if wxUSE_BASE -#if wxUSE_ON_FATAL_EXCEPTION && defined(__VISUALC__) && !defined(__WXWINCE__) +// ---------------------------------------------------------------------------- +// wrapper wxEntry catching all Win32 exceptions occurring in a wx program +// ---------------------------------------------------------------------------- + +// wrap real wxEntry in a try-except block to be able to call +// OnFatalException() if necessary +#if wxUSE_ON_FATAL_EXCEPTION + +#if defined(__VISUALC__) && !defined(__WXWINCE__) // VC++ (at least from 4.0 up to version 7.1) is incredibly broken in that // a "catch ( ... )" will *always* catch SEH exceptions in it even though // it should have never been the case... to prevent such catches from @@ -91,14 +99,6 @@ extern int wxEntryCleanupReal(int& argc, wxChar **argv); #define DisableAutomaticSETranslator() #endif // __VISUALC__/!__VISUALC__ -// ---------------------------------------------------------------------------- -// wrapper wxEntry catching all Win32 exceptions occurring in a wx program -// ---------------------------------------------------------------------------- - -// wrap real wxEntry in a try-except block to be able to call -// OnFatalException() if necessary -#if wxUSE_ON_FATAL_EXCEPTION - // global pointer to exception information, only valid inside OnFatalException, // used by wxStackWalker and wxCrashReport extern EXCEPTION_POINTERS *wxGlobalSEInformation = NULL; @@ -186,7 +186,7 @@ bool wxHandleFatalExceptions(bool doit) wxString name = wxString::Format ( _T("%s_%s_%lu.dmp"), - wxTheApp ? (const wxChar*)wxTheApp->GetAppName().c_str() + wxTheApp ? (const wxChar*)wxTheApp->GetAppDisplayName().c_str() : _T("wxwindows"), wxDateTime::Now().Format(_T("%Y%m%dT%H%M%S")).c_str(), ::GetCurrentProcessId() @@ -214,21 +214,8 @@ int wxEntry(int& argc, wxChar **argv) #else // !wxUSE_ON_FATAL_EXCEPTION -#if defined(__VISUALC__) && !defined(__WXWINCE__) - -static void -wxSETranslator(unsigned int WXUNUSED(code), EXCEPTION_POINTERS * WXUNUSED(ep)) -{ - // see wxSETranslator() version for wxUSE_ON_FATAL_EXCEPTION above - throw; -} - -#endif // __VISUALC__ - int wxEntry(int& argc, wxChar **argv) { - DisableAutomaticSETranslator(); - return wxEntryReal(argc, argv); } @@ -332,7 +319,7 @@ struct wxMSWCommandLineArguments argv = new wxChar *[argc + 1]; for ( int i = 0; i < argc; i++ ) { - argv[i] = wxStrdup(args[i]); + argv[i] = wxStrdup(args[i].wx_str()); } // argv[] must be NULL-terminated