MCPcopy Create free account
hub / github.com/NVIDIA-RTX/RTXPT / GetExeDirectory

Function GetExeDirectory

Rtxpt/SampleCommon/SplashScreen.cpp:86–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84#include <string>
85
86static std::wstring GetExeDirectory()
87{
88 wchar_t path[MAX_PATH];
89
90 DWORD len = GetModuleFileNameW(nullptr, path, MAX_PATH);
91 if (len == 0 || len == MAX_PATH)
92 {
93 return L"";
94 }
95
96 // Strip filename
97 for (DWORD i = len; i > 0; --i)
98 {
99 if (path[i - 1] == L'\\' || path[i - 1] == L'/')
100 {
101 path[i - 1] = L'\0';
102 break;
103 }
104 }
105
106 return std::wstring(path);
107}
108
109static bool FileExists(const std::wstring& path)
110{

Callers 1

FindSplashPngPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected