]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/utils.cpp
added wxGetFullModuleName(); use it instead of calling ::GetModuleFileName() directly
[wxWidgets.git] / src / msw / utils.cpp
index eb91843d616c5aef2a67f8ed3144457ea7b0479a..e7506b0908e67b76913445c83b42868f424726c2 100644 (file)
     #endif
 #endif
 
     #endif
 #endif
 
-// 260 was taken from windef.h
-#ifndef MAX_PATH
-    #define MAX_PATH  260
-#endif
-
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // constants
 // ----------------------------------------------------------------------------
@@ -434,12 +429,8 @@ const wxChar* wxGetHomeDir(wxString *pstr)
     }
     else // fall back to the program directory
     {
     }
     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
 
     }
 #endif  // UNIX/Win