Combine Studio change for get program file full path.

This commit is contained in:
XiaoFeng 2015-11-19 15:21:14 +08:00
parent b8ebd51561
commit f4d317f1fd
1 changed files with 7 additions and 1 deletions

View File

@ -137,7 +137,13 @@ static void _checkPath()
if (s_resourcePath.empty())
{
WCHAR *pUtf16ExePath = nullptr;
_get_wpgmptr(&pUtf16ExePath);
#ifdef CC_STUDIO_ENABLED_VIEW
WCHAR utf16Path[CC_MAX_PATH] = { 0 };
GetModuleFileNameW(NULL, utf16Path, CC_MAX_PATH - 1);
pUtf16ExePath = &(utf16Path[0]);
#else
_get_wpgmptr(&pUtf16ExePath); // CocoStudio Notice : This function won't work under studio, will cause a assert in system library
#endif
// We need only directory part without exe
WCHAR *pUtf16DirEnd = wcsrchr(pUtf16ExePath, L'\\');