]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/stdpaths.cpp
Make wxPASSWORD and wxPROCESS_ENTER really deprecated.
[wxWidgets.git] / src / msw / stdpaths.cpp
index f41673b352ca22914d4f443b754b62cf9934a4ac..5e9de59ee3b2ca0bb81cb22044589ca958e6e875 100644 (file)
@@ -106,6 +106,8 @@ static ShellFunctions gs_shellFuncs;
 
 static void ResolveShellFunctions()
 {
+#if wxUSE_DYNLIB_CLASS
+
     // start with the newest functions, fall back to the oldest ones
 #ifdef __WXWINCE__
     wxString shellDllName(_T("coredll"));
@@ -153,6 +155,7 @@ static void ResolveShellFunctions()
     // because we also link to it statically, so it's ok
 
     gs_shellFuncs.initialized = true;
+#endif
 }
 
 // ============================================================================
@@ -239,6 +242,26 @@ wxString wxStandardPaths::DoGetDirectory(int csidl)
     return dir;
 }
 
+/* static */
+wxString wxStandardPaths::GetAppDir()
+{
+    wxFileName fn(wxGetFullModuleName());
+
+    // allow running the apps directly from build directory in debug builds
+#ifdef __WXDEBUG__
+    wxString lastdir;
+    if ( fn.GetDirCount() )
+    {
+        lastdir = fn.GetDirs().Last();
+        lastdir.MakeLower();
+        if ( lastdir.Matches(_T("debug*")) || lastdir.Matches(_T("vc_msw*")) )
+            fn.RemoveLastDir();
+    }
+#endif // __WXDEBUG__
+
+    return fn.GetPath();
+}
+
 // ----------------------------------------------------------------------------
 // public functions
 // ----------------------------------------------------------------------------
@@ -257,7 +280,7 @@ wxString wxStandardPaths::GetDataDir() const
 {
     // under Windows each program is usually installed in its own directory and
     // so its datafiles are in the same directory as its main executable
-    return wxFileName(wxGetFullModuleName()).GetPath();
+    return GetAppDir();
 }
 
 wxString wxStandardPaths::GetUserDataDir() const
@@ -272,10 +295,11 @@ wxString wxStandardPaths::GetUserLocalDataDir() const
 
 wxString wxStandardPaths::GetPluginsDir() const
 {
-    return wxFileName(wxGetFullModuleName()).GetPath();
+    // there is no standard location for plugins, suppose they're in the same
+    // directory as the .exe
+    return GetAppDir();
 }
 
-
 // ============================================================================
 // wxStandardPathsWin16 implementation
 // ============================================================================