- wxString strPath;
- ::GetModuleFileName(::GetModuleHandle(NULL),
- wxStringBuffer(strPath, MAX_PATH), MAX_PATH);
-
- // extract the dir name
- wxSplitPath(strPath, &strDir, NULL, NULL);
+ // extract the directory component of the program file name
+ wxSplitPath(wxGetFullModuleName(), &strDir, NULL, NULL);