Convert argv[] to Unicode
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@3098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -690,7 +690,17 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
|
wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
|
||||||
|
|
||||||
wxTheApp->argc = argc;
|
wxTheApp->argc = argc;
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxTheApp->argv = new wxChar*[argc+1];
|
||||||
|
int mb_argc = 0;
|
||||||
|
while (mb_argc < argc) {
|
||||||
|
wxTheApp->argv[mb_argc] = wxStrdup(wxConvLibc.cMB2WX(argv[mb_argc]));
|
||||||
|
mb_argc++;
|
||||||
|
}
|
||||||
|
wxTheApp->argv[mb_argc] = (wxChar *)NULL;
|
||||||
|
#else
|
||||||
wxTheApp->argv = argv;
|
wxTheApp->argv = argv;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxString name(wxFileNameFromPath(argv[0]));
|
wxString name(wxFileNameFromPath(argv[0]));
|
||||||
wxStripExtension( name );
|
wxStripExtension( name );
|
||||||
@@ -781,7 +791,7 @@ wxApp::GetStdIcon(int which) const
|
|||||||
return wxIcon(warning_xpm);
|
return wxIcon(warning_xpm);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxFAIL_MSG("requested non existent standard icon");
|
wxFAIL_MSG(_T("requested non existent standard icon"));
|
||||||
// still fall through
|
// still fall through
|
||||||
|
|
||||||
case wxICON_HAND:
|
case wxICON_HAND:
|
||||||
|
@@ -690,7 +690,17 @@ int wxEntry( int argc, char *argv[] )
|
|||||||
wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
|
wxCHECK_MSG( wxTheApp, -1, _T("wxWindows error: no application object") );
|
||||||
|
|
||||||
wxTheApp->argc = argc;
|
wxTheApp->argc = argc;
|
||||||
|
#if wxUSE_UNICODE
|
||||||
|
wxTheApp->argv = new wxChar*[argc+1];
|
||||||
|
int mb_argc = 0;
|
||||||
|
while (mb_argc < argc) {
|
||||||
|
wxTheApp->argv[mb_argc] = wxStrdup(wxConvLibc.cMB2WX(argv[mb_argc]));
|
||||||
|
mb_argc++;
|
||||||
|
}
|
||||||
|
wxTheApp->argv[mb_argc] = (wxChar *)NULL;
|
||||||
|
#else
|
||||||
wxTheApp->argv = argv;
|
wxTheApp->argv = argv;
|
||||||
|
#endif
|
||||||
|
|
||||||
wxString name(wxFileNameFromPath(argv[0]));
|
wxString name(wxFileNameFromPath(argv[0]));
|
||||||
wxStripExtension( name );
|
wxStripExtension( name );
|
||||||
@@ -781,7 +791,7 @@ wxApp::GetStdIcon(int which) const
|
|||||||
return wxIcon(warning_xpm);
|
return wxIcon(warning_xpm);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
wxFAIL_MSG("requested non existent standard icon");
|
wxFAIL_MSG(_T("requested non existent standard icon"));
|
||||||
// still fall through
|
// still fall through
|
||||||
|
|
||||||
case wxICON_HAND:
|
case wxICON_HAND:
|
||||||
|
Reference in New Issue
Block a user