8static inline char* wideToMulti(
int codePage,
const wchar_t* aw)
10 const int required = WideCharToMultiByte(codePage, 0, aw, -1, NULL, 0, NULL, NULL);
11 char* result =
new char[required];
12 WideCharToMultiByte(codePage, 0, aw, -1, result, required, NULL, NULL);
16extern "C" int APIENTRY
17WinMain(HINSTANCE, HINSTANCE, LPSTR ,
int )
20 wchar_t** argvW = CommandLineToArgvW(GetCommandLineW(), &argc);
23 char** argv =
new char*[argc + 1];
24 for(
int i = 0; i < argc; ++i)
25 argv[i] = wideToMulti(CP_ACP, argvW[i]);
28 const int exitCode = main(argc, argv);
29 for(
int i = 0; i < argc && argv[i]; ++i)