X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fwindows%2Fmain.cpp;fp=source%2Fcore%2Fwindows%2Fmain.cpp;h=a0816a4d02025084f11c16be207b24a0a362b5f3;hb=609c9a508cfdc7b42c46c4f21d17639204165a00;hp=0000000000000000000000000000000000000000;hpb=b4806214e905752617691f851717033fd3f266c2;p=libs%2Fcore.git diff --git a/source/core/windows/main.cpp b/source/core/windows/main.cpp new file mode 100644 index 0000000..a0816a4 --- /dev/null +++ b/source/core/windows/main.cpp @@ -0,0 +1,35 @@ +#include +#include +#include +#include "application.h" + +using namespace std; +using namespace Msp; + +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/) +{ + int argc = 0; + LPWSTR *argv_w = CommandLineToArgvW(GetCommandLineW(), &argc); + + unsigned max_size = 0; + for(int i=0; i(argv_buf); + char *argv_ptr = argv_buf+(argc+1)*sizeof(char *); + for(int i=0; i(argv_w[i]), wcslen(argv_w[i])*2); + arg = StringCodec::transcode(arg); + copy(arg.begin(), arg.end(), argv_ptr); + argv_ptr += arg.size(); + *argv_ptr++ = 0; + } + + LocalFree(argv_w); + int exit_code = Msp::Application::run(argc, argv, hInstance); + delete[] argv_buf; + return exit_code; +}