Use wide strings in util::executable_path()
This commit is contained in:
parent
ef85eec178
commit
d41c53193d
1 changed files with 2 additions and 2 deletions
|
|
@ -14,10 +14,10 @@ namespace psemek::util
|
||||||
std::filesystem::path executable_path()
|
std::filesystem::path executable_path()
|
||||||
{
|
{
|
||||||
#if defined WIN32
|
#if defined WIN32
|
||||||
std::string result(256, '\0');
|
std::wstring result(256, '\0');
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
GetModuleFileNameA(NULL, result.data(), result.size());
|
GetModuleFileNameW(NULL, result.data(), result.size());
|
||||||
auto error = GetLastError();
|
auto error = GetLastError();
|
||||||
if (error == ERROR_SUCCESS)
|
if (error == ERROR_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue