// comcdlg32.dll, but as we don't use the extended fields anyhow, set
// the struct size to the old value - otherwise, the programs compiled
// with new headers will not work with the old libraries
-#if defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
+#if !defined(__WXWINCE__) && defined(_WIN32_WINNT) && (_WIN32_WINNT >= 0x0500)
of.lStructSize = sizeof(OPENFILENAME) -
(sizeof(void *) + 2*sizeof(DWORD));
#else // old headers
bool success = (m_dialogStyle & wxSAVE ? GetSaveFileName(&of)
: GetOpenFileName(&of)) != 0;
+#ifdef __WXWINCE__
+ DWORD errCode = GetLastError();
+#else
+ DWORD errCode = CommDlgExtendedError();
+
DWORD errCode = CommDlgExtendedError();
// GetOpenFileName will always change the current working directory on
}
}
#endif // __WIN32__
+#endif // __WXWINCE__
if ( success )
{
{
// common dialog failed - why?
#ifdef __WXDEBUG__
+#ifdef __WXWINCE__
+ if (errCode == 0)
+ {
+ // OK, user cancelled the dialog
+ }
+ else if (errCode == ERROR_INVALID_PARAMETER)
+ {
+ wxLogError(wxT("Invalid parameter passed to file dialog function."));
+ }
+ else if (errCode == ERROR_OUTOFMEMORY)
+ {
+ wxLogError(wxT("Out of memory when calling file dialog function."));
+ }
+ else if (errCode == ERROR_CALL_NOT_IMPLEMENTED)
+ {
+ wxLogError(wxT("Call not implemented when calling file dialog function."));
+ }
+ else
+ {
+ wxLogError(wxT("Unknown error %d when calling file dialog function."), errCode);
+ }
+#else
DWORD dwErr = CommDlgExtendedError();
if ( dwErr != 0 )
{
dwErr);
}
//else: it was just cancelled
+#endif
#endif
}