Created
February 12, 2014 08:30
-
-
Save rzhukov/8951859 to your computer and use it in GitHub Desktop.
Gets path to application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CString GetAppPath() | |
{ | |
CString fullPath; | |
DWORD pathLen = ::GetModuleFileName( NULL, fullPath.GetBufferSetLength(MAX_PATH+1), MAX_PATH); // hmod of zero gets the main EXE | |
fullPath.ReleaseBuffer( pathLen ); | |
PathRemoveFileSpec(fullPath.GetBuffer()); | |
fullPath.ReleaseBuffer(); | |
return fullPath; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment