| 25 | } |
| 26 | |
| 27 | wchar_t* FindOwnExecutableName() |
| 28 | { |
| 29 | wchar_t* ourDirectory = new wchar_t[MAX_PATH]; |
| 30 | |
| 31 | GetModuleFileName(GetModuleHandle(NULL), ourDirectory, MAX_PATH); |
| 32 | wchar_t* lastSlash = wcsrchr(ourDirectory, L'\\'); |
| 33 | if (!lastSlash) { |
| 34 | delete[] ourDirectory; |
| 35 | return NULL; |
| 36 | } |
| 37 | |
| 38 | wchar_t* ret = _wcsdup(lastSlash + 1); |
| 39 | delete[] ourDirectory; |
| 40 | return ret; |
| 41 | } |
| 42 | |
| 43 | std::wstring FindLatestAppDir() |
| 44 | { |