added correct error testing for WinCE.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36386
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- All wxTopLevelWindows resizes accordingly to SIP visibility.
- ::wxGetUserName() implemented.
- wxDisplay enumeration support.
- All wxTopLevelWindows resizes accordingly to SIP visibility.
- ::wxGetUserName() implemented.
- wxDisplay enumeration support.
+- Fixed wxFileDialog breakage on WinCE due to incorrect structure size.
// 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
// 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
of.lStructSize = sizeof(OPENFILENAME) -
(sizeof(void *) + 2*sizeof(DWORD));
#else // old headers
bool success = (m_dialogStyle & wxSAVE ? GetSaveFileName(&of)
: GetOpenFileName(&of)) != 0;
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
DWORD errCode = CommDlgExtendedError();
// GetOpenFileName will always change the current working directory on
{
// common dialog failed - why?
#ifdef __WXDEBUG__
{
// 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 )
{
DWORD dwErr = CommDlgExtendedError();
if ( dwErr != 0 )
{
dwErr);
}
//else: it was just cancelled
dwErr);
}
//else: it was just cancelled