X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/837e57436a89516a5fa9f478f401e06bd872c17c..8f7173abc4a901249df3ae13a91d3f19874ac269:/src/msw/filedlg.cpp diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp index f2b7231c4d..6bf29addb8 100644 --- a/src/msw/filedlg.cpp +++ b/src/msw/filedlg.cpp @@ -28,6 +28,7 @@ #include "wx/dialog.h" #include "wx/filedlg.h" #include "wx/intl.h" + #include "wx/log.h" #endif #include @@ -325,6 +326,7 @@ int wxFileDialog::ShowModal(void) m_path = fileNameBuffer; m_fileName = wxFileNameFromPath(fileNameBuffer); + m_dir = wxPathOnly(fileNameBuffer); //=== Simulating the wxOVERWRITE_PROMPT >>============================ @@ -341,9 +343,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; }