]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/filename.cpp
we don't use wxUSE_FILENAME any longer
[wxWidgets.git] / src / common / filename.cpp
index e53a24eafe35fc42f11e99695ba411d21a1678e6..674265b46280b8846b957e7e69cc1d408fb8bd4d 100644 (file)
 
 // For GetShort/LongPathName
 #ifdef __WIN32__
-#include <windows.h>
-#include "wx/msw/winundef.h"
+#include "wx/msw/wrapwin.h"
+#endif
+
+#ifdef __WXWINCE__
+#include "wx/msw/private.h"
 #endif
 
 #if defined(__WXMAC__)
@@ -564,8 +567,22 @@ wxFileName::CreateTempFileName(const wxString& prefix, wxFile *fileTemp)
     // use the directory specified by the prefix
     SplitPath(prefix, &dir, &name, NULL /* extension */);
 
-#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
+#if defined(__WXWINCE__)
+    if (dir.empty())
+    {
+        // FIXME. Create \temp dir?
+        dir = wxT("\\");
+    }
+    path = dir + wxT("\\") + prefix;
+    int i = 1;
+    while (wxFileExists(path))
+    {
+        path = dir + wxT("\\") + prefix ;
+        path << i;
+        i ++;
+    }
 
+#elif defined(__WINDOWS__) && !defined(__WXMICROWIN__)
 #ifdef __WIN32__
     if ( dir.empty() )
     {
@@ -1284,7 +1301,7 @@ wxString wxFileName::GetFullPath( wxPathFormat format ) const
 // Return the short form of the path (returns identity on non-Windows platforms)
 wxString wxFileName::GetShortPath() const
 {
-#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__)
+#if defined(__WXMSW__) && defined(__WIN32__) && !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
     wxString path(GetFullPath());
     wxString pathOut;
     DWORD sz = ::GetShortPathName(path, NULL, 0);