X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/264972539817115bdfe987e080f8449cad1757eb..6c0e710f008370d8c0039b3aa859b8eb65d6de12:/include/wx/init.h diff --git a/include/wx/init.h b/include/wx/init.h index 8ceae027c8..90304ef918 100644 --- a/include/wx/init.h +++ b/include/wx/init.h @@ -13,7 +13,7 @@ #define _WX_INIT_H_ #include "wx/defs.h" -#include "wx/wxchar.h" +#include "wx/chartype.h" // ---------------------------------------------------------------------------- // wxEntry helper functions which allow to have more fine grained control @@ -55,13 +55,17 @@ extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv); // ---------------------------------------------------------------------------- // Using the library without (explicit) application object: you may avoid using -// DECLARE_APP and IMPLEMENT_APP macros and call the functions below instead at +// wxDECLARE_APP and wxIMPLEMENT_APP macros and call the functions below instead at // the program startup and termination // ---------------------------------------------------------------------------- // initialize the library (may be called as many times as needed, but each // call to wxInitialize() must be matched by wxUninitialize()) -extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, wxChar **argv = NULL); +extern bool WXDLLIMPEXP_BASE wxInitialize(); +extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, wxChar **argv); +#if wxUSE_UNICODE +extern bool WXDLLIMPEXP_BASE wxInitialize(int argc, char **argv); +#endif // clean up -- the library can't be used any more after the last call to // wxUninitialize() @@ -73,10 +77,22 @@ class WXDLLIMPEXP_BASE wxInitializer { public: // initialize the library - wxInitializer(int argc = 0, wxChar **argv = NULL) + wxInitializer() + { + m_ok = wxInitialize(); + } + + wxInitializer(int argc, wxChar **argv) + { + m_ok = wxInitialize(argc, argv); + } + +#if wxUSE_UNICODE + wxInitializer(int argc, char **argv) { m_ok = wxInitialize(argc, argv); } +#endif // wxUSE_UNICODE // has the initialization been successful? (explicit test) bool IsOk() const { return m_ok; }