Skip to content

Instantly share code, notes, and snippets.

@xkyii
Created July 11, 2011 05:26
Show Gist options
  • Save xkyii/1075348 to your computer and use it in GitHub Desktop.
Save xkyii/1075348 to your computer and use it in GitHub Desktop.
GetModuleDirectory
CString GetModuleDirectory(void)
{
TCHAR tempstr[1024];
::GetModuleFileName(AfxGetInstanceHandle(),tempstr,sizeof(tempstr));
CString mulu;
mulu.Format(_T("%s"),tempstr);
mulu = mulu.Left(mulu.ReverseFind('\\')+1);
return mulu;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment