+#if wxUSE_EXCEPTIONS
+
+// ----------------------------------------------------------------------------
+// exception handling
+// ----------------------------------------------------------------------------
+
+bool wxApp::OnExceptionInMainLoop()
+{
+ // ask the user about what to do: use the Win32 API function here as it
+ // could be dangerous to use any wxWindows code in this state
+ switch (
+ ::MessageBox
+ (
+ NULL,
+ _T("An unhandled exception occurred. Press \"Abort\" to \
+terminate the program,\r\n\
+\"Retry\" to exit the program normally and \"Ignore\" to try to continue."),
+ _T("Unhandled exception"),
+ MB_ABORTRETRYIGNORE |
+ MB_ICONERROR|
+ MB_TASKMODAL
+ )
+ )
+ {
+ case IDABORT:
+ throw;
+
+ default:
+ wxFAIL_MSG( _T("unexpected MessageBox() return code") );
+ // fall through
+
+ case IDRETRY:
+ return false;
+
+ case IDIGNORE:
+ return true;
+ }
+}
+
+#endif // wxUSE_EXCEPTIONS