X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c8c7cc23e709bebc7dba5d6e1bbf62b4a556184..4e75b65f7c801f98fd75e0863d29d59e4b12b6fb:/include/wx/app.h diff --git a/include/wx/app.h b/include/wx/app.h index ccc781568e..887ddbdaad 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -92,7 +92,7 @@ public: // class OnInit() to do it. virtual bool OnInit(); - // this is here only temproary hopefully (FIXME) + // this is here only temporary hopefully (FIXME) virtual bool OnInitGui() { return true; } // This is the replacement for the normal main(): all program work should @@ -121,7 +121,7 @@ public: // event loop: it may return true to continue running the event loop or // false to stop it (in the latter case it may rethrow the exception as // well) - virtual bool OnExceptionInMainLoop() { throw; } + virtual bool OnExceptionInMainLoop(); // Called when an unhandled C++ exception occurs inside OnRun(): note that // the exception type is lost by now, so if you really want to handle the @@ -613,47 +613,17 @@ public: { wxApp::SetInitializerFunction(fn); } }; -// Here's a macro you can use if your compiler really, really wants main() to -// be in your main program (e.g. hello.cpp). Now IMPLEMENT_APP should add this -// code if required. +// the code below defines a IMPLEMENT_WXWIN_MAIN macro which you can use if +// your compiler really, really wants main() to be in your main program (e.g. +// hello.cpp). Now IMPLEMENT_APP should add this code if required. #define IMPLEMENT_WXWIN_MAIN_CONSOLE \ int main(int argc, char **argv) { return wxEntry(argc, argv); } -#if !wxUSE_GUI || !defined(__WXMSW__) - #define IMPLEMENT_WXWIN_MAIN \ - IMPLEMENT_WXWIN_MAIN_CONSOLE -#elif defined(__WXMSW__) - // we need HINSTANCE declaration to define WinMain() - #include "wx/msw/wrapwin.h" - - #ifndef SW_SHOWNORMAL - #define SW_SHOWNORMAL 1 - #endif - - // WinMain() is always ANSI, even in Unicode build, under normal Windows - // but is always Unicode under CE - #ifdef __WXWINCE__ - typedef wchar_t *wxCmdLineArgType; - #else - typedef char *wxCmdLineArgType; - #endif - - #define IMPLEMENT_WXWIN_MAIN \ - extern int wxEntry(HINSTANCE hInstance, \ - HINSTANCE hPrevInstance = NULL, \ - wxCmdLineArgType pCmdLine = NULL, \ - int nCmdShow = SW_SHOWNORMAL); \ - extern "C" int WINAPI WinMain(HINSTANCE hInstance, \ - HINSTANCE hPrevInstance, \ - wxCmdLineArgType lpCmdLine, \ - int nCmdShow) \ - { \ - return wxEntry(hInstance, hPrevInstance, lpCmdLine, nCmdShow); \ - } -#else - #define IMPLEMENT_WXWIN_MAIN -#endif +// port-specific header could have defined it already in some special wau +#ifndef IMPLEMENT_WXWIN_MAIN + #define IMPLEMENT_WXWIN_MAIN IMPLEMENT_WXWIN_MAIN_CONSOLE +#endif // defined(IMPLEMENT_WXWIN_MAIN) #ifdef __WXUNIVERSAL__ #include "wx/univ/theme.h"