X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Flib%2Fcross_windows.cc;h=200b724854731b2582110f752d45abf87921831b;hp=0549615787214dbd0ce4ef18b31ced6b5df78aca;hb=bbe336ee97c86c424f8f94e0f947f8e3b20e7123;hpb=2695f450ca00654cef8709e4e3cfb4cf5de48fc7 diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index 054961578..200b72485 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -44,10 +44,11 @@ extern "C" { #include #include #undef DATADIR -#include -#include -#include #include +#include +#include +#include +#include #include #include #include @@ -657,3 +658,17 @@ show_in_file_manager (boost::filesystem::path, boost::filesystem::path select) return (reinterpret_cast(r) <= 32); } + +ArgFixer::ArgFixer(int, char**) +{ + auto cmd_line = GetCommandLineW(); + auto wide_argv = CommandLineToArgvW(cmd_line, &_argc); + + _argv_strings.resize(_argc); + _argv = new char*[_argc]; + for (int i = 0; i < _argc; ++i) { + _argv_strings[i] = wchar_to_utf8(wide_argv[i]); + _argv[i] = const_cast(_argv_strings[i].c_str()); + } +} +