X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/226c11c0767b3dfded410b8c8be8cf0d9444d136..3c96417a099e8c99e9635a9aba2ce05b8f5572f7:/src/msw/main.cpp?ds=sidebyside diff --git a/src/msw/main.cpp b/src/msw/main.cpp index 512287bf44..75eb058746 100644 --- a/src/msw/main.cpp +++ b/src/msw/main.cpp @@ -61,13 +61,16 @@ #define HINSTANCE HANDLE #endif +// defined in common/init.cpp +extern int wxEntryReal(int& argc, wxChar **argv); + // ============================================================================ // implementation: various entry points // ============================================================================ #if wxUSE_BASE -#ifdef __VISUALC__ +#if wxUSE_ON_FATAL_EXCEPTION && 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 @@ -90,16 +93,13 @@ #endif // __VISUALC__/!__VISUALC__ // ---------------------------------------------------------------------------- -// wrapper wxEntry catching all Win32 exceptions occuring in a wx program +// 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 -// defined in common/init.cpp -extern int wxEntryReal(int& argc, wxChar **argv); - // global pointer to exception information, only valid inside OnFatalException, // used by wxStackWalker and wxCrashReport extern EXCEPTION_POINTERS *wxGlobalSEInformation = NULL; @@ -219,13 +219,18 @@ int wxEntry(int& argc, wxChar **argv) { wxFatalExit(); - // this code is unreachable but put it here to suppress warnings +#if !defined(_MSC_VER) || defined(__WXDEBUG__) || (defined(_MSC_VER) && _MSC_VER <= 1200) + // this code is unreachable but put it here to suppress warnings in some compilers + // and disable for others to supress warnings too return -1; +#endif // !__VISUALC__ in release build } } #else // !wxUSE_ON_FATAL_EXCEPTION +#if defined(__VISUALC__) && !defined(__WXWINCE__) + static void wxSETranslator(unsigned int WXUNUSED(code), EXCEPTION_POINTERS * WXUNUSED(ep)) { @@ -233,6 +238,8 @@ wxSETranslator(unsigned int WXUNUSED(code), EXCEPTION_POINTERS * WXUNUSED(ep)) throw; } +#endif // __VISUALC__ + int wxEntry(int& argc, wxChar **argv) { DisableAutomaticSETranslator(); @@ -311,7 +318,7 @@ extern "C" // DLL entry point BOOL WINAPI -DllMain(HANDLE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved)) +DllMain(HINSTANCE hModule, DWORD fdwReason, LPVOID WXUNUSED(lpReserved)) { // Only call wxEntry if the application itself is part of the DLL. // If only the wxWidgets library is in the DLL, then the