]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/filedlg.cpp
wxMSW::wxTreeCtrl has multiple selection too (somewhat documented)
[wxWidgets.git] / src / msw / filedlg.cpp
index f2b7231c4db84e8095fef9ef9f328e43d0135bcc..79c17ba8650794b0c99e82b467a497f8dda34f92 100644 (file)
@@ -28,6 +28,7 @@
     #include "wx/dialog.h"
     #include "wx/filedlg.h"
     #include "wx/intl.h"
+    #include "wx/log.h"
 #endif
 
 #include <windows.h>
@@ -341,9 +342,23 @@ int wxFileDialog::ShowModal(void)
             }
         }
 
-    } // END: if ( success )
+    }
+    else
+    {
+        // common dialog failed - why?
+#ifdef __WXDEBUG__
+        DWORD dwErr = CommDlgExtendedError();
+        if ( dwErr != 0 )
+        {
+            // this msg is only for developers
+            wxLogError(_T("Common dialog failed with error code %0lx."),
+                       dwErr);
+        }
+        //else: it was just cancelled
+#endif
+    }
 
-    return (success ? wxID_OK : wxID_CANCEL) ;
+    return success ? wxID_OK : wxID_CANCEL;
 
 }