// With standard string
char szAppPath[MAX_PATH] = "";
char szAppDirectory[MAX_PATH] = "";
::GetModuleFileName(0, szAppPath, sizeof(szAppPath) - 1);
// Extract directory
strncpy(szAppDirectory, szAppPath, strrchr(szAppPath, '\\') - szAppPath);
szAppDirectory[strlen(szAppDirectory)] = '\0';

No comments:
Post a Comment