MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / FindRootAppDir

Function FindRootAppDir

src/StubExecutable/StubExecutable.cpp:11–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace std;
10
11wchar_t* FindRootAppDir()
12{
13 wchar_t* ourDirectory = new wchar_t[MAX_PATH];
14
15 GetModuleFileName(GetModuleHandle(NULL), ourDirectory, MAX_PATH);
16 wchar_t* lastSlash = wcsrchr(ourDirectory, L'\\');
17 if (!lastSlash) {
18 delete[] ourDirectory;
19 return NULL;
20 }
21
22 // Null-terminate the string at the slash so now it's a directory
23 *lastSlash = 0x0;
24 return ourDirectory;
25}
26
27wchar_t* FindOwnExecutableName()
28{

Callers 1

FindLatestAppDirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected