// 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);
// 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);
No comments:
Post a Comment