How can I get application's starting directory?
Printable View
How can I get application's starting directory?
CString GetExePath()
{
CString path;
LPSTR buf = path.GetBuffer(_MAX_PATH);
//Get exe path
VERIFY(::GetModuleFileName(NULL, buf, _MAX_PATH));
path.ReleaseBuffer();
// path.MakeLower();
return path.Left(path.ReverseFind('\\'));
}