X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7eb872f4d67141f723745f04b478dda03907d4b6..b4e0b521e0878a495c570af3d68b40c82b4a92b3:/src/msw/utils.cpp diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index eb91843d61..e7506b0908 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -94,11 +94,6 @@ #endif #endif -// 260 was taken from windef.h -#ifndef MAX_PATH - #define MAX_PATH 260 -#endif - // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -434,12 +429,8 @@ const wxChar* wxGetHomeDir(wxString *pstr) } else // fall back to the program directory { - 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); } #endif // UNIX/Win