X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fcross_windows.cc;h=200b724854731b2582110f752d45abf87921831b;hb=ff639b3cf30afcc097bfd21d39c8d15f466cadd6;hp=12fb5efa03659108b0a190a0afb0976fe7332ecc;hpb=8a8c977c12fc65f1f50ea05099387e0fc8840e7d;p=dcpomatic.git diff --git a/src/lib/cross_windows.cc b/src/lib/cross_windows.cc index 12fb5efa0..200b72485 100644 --- a/src/lib/cross_windows.cc +++ b/src/lib/cross_windows.cc @@ -29,6 +29,7 @@ #include "exceptions.h" #include "dcpomatic_assert.h" #include "util.h" +#include #include #include extern "C" { @@ -43,10 +44,11 @@ extern "C" { #include #include #undef DATADIR -#include -#include -#include #include +#include +#include +#include +#include #include #include #include @@ -656,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()); + } +} +