added wxInitialize() overload taking char**, to make use from main() easier

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2009-07-30 07:42:54 +00:00
parent f90c861996
commit a3bc27e40a
2 changed files with 25 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv);
// 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);
#if wxUSE_UNICODE && wxABI_VERSION >= 20811
extern bool WXDLLIMPEXP_BASE wxInitialize(int argc = 0, char **argv = NULL);
#endif
// clean up -- the library can't be used any more after the last call to
// wxUninitialize()
@@ -78,6 +81,13 @@ public:
m_ok = wxInitialize(argc, argv);
}
#if wxUSE_UNICODE && wxABI_VERSION >= 20811
wxInitializer(int argc = 0, char **argv = NULL)
{
m_ok = wxInitialize(argc, argv);
}
#endif // wxUSE_UNICODE
// has the initialization been successful? (explicit test)
bool IsOk() const { return m_ok; }

View File

@@ -479,6 +479,21 @@ bool wxInitialize(int argc, wxChar **argv)
return wxEntryStart(argc, argv);
}
#if wxUSE_UNICODE
bool wxInitialize(int argc, char **argv)
{
wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit);
if ( gs_initData.nInitCount++ )
{
// already initialized
return true;
}
return wxEntryStart(argc, argv);
}
#endif // wxUSE_UNICODE
void wxUninitialize()
{
wxCRIT_SECT_LOCKER(lockInit, gs_initData.csInit);