12345678
wstring Location() { wstring fulllocation; wstring location; GetModuleFileName(NULL, (WCHAR*)fulllocation.c_str(), MAX_PATH); int last_slash = fulllocation.find_last_of(L"/\\"); location = fulllocation.substr(0, last_slash); return location; }
find_last_of((WCHAR*)"/\\");
GetModuleFileName(NULL, (WCHAR*)fulllocation.c_str(), MAX_PATH); //NO
12345678910111213
std::wstring Location() { wchar_t buff[MAX_PATH+10]={0}; GetModuleFileNameW(NULL, buff, MAX_PATH); std::wstring fulllocation(buff); int last_slash = fulllocation.find_last_of(L"\\"); fulllocation = fulllocation.substr(0, last_slash); return fulllocation; }