diff --git a/wince/cemain.c b/wince/cemain.c index 0bdcc1820..48e727424 100755 --- a/wince/cemain.c +++ b/wince/cemain.c @@ -1115,8 +1115,8 @@ ceLoadSavedGame( CEAppGlobals* globals ) snprintf( buf, VSIZE(buf), "Unable to open dictionary: %s", dictName ); buf[VSIZE(buf)-1] = '\0'; - ceMessageBoxChar( globals, NULL, buf, L"Oops!", - MB_OK | MB_ICONHAND ); + ceOops( globals, NULL, buf ); + } XP_FREE( globals->mpool, dictName ); #endif @@ -1138,8 +1138,11 @@ ceLoadSavedGame( CEAppGlobals* globals ) CE_RESET_PROC globals ); if ( success ) { ceSetTitleFromName( globals ); - } else if ( !!dict ) { - dict_destroy( dict ); + } else { + if ( !!dict ) { + dict_destroy( dict ); + } + ceOops( globals, NULL, "Saved game cannot be opened." ); } } @@ -2970,7 +2973,7 @@ ce_util_userError( XW_UtilCtxt* uc, UtilErrID id ) break; } - ceMessageBoxChar( globals, NULL, message, L"Oops!", MB_OK | MB_ICONHAND ); + ceOops( globals, NULL, message ); } /* ce_util_userError */ static XP_Bool diff --git a/wince/ceutil.c b/wince/ceutil.c index de37d6a46..d6d0c160c 100755 --- a/wince/ceutil.c +++ b/wince/ceutil.c @@ -872,8 +872,8 @@ ceGetPath( CEAppGlobals* globals, CePathType typ, } /* ceGetPath */ int -ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str, - wchar_t* title, XP_U16 buttons ) +ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str, + const wchar_t* title, XP_U16 buttons ) { /* Get the length required, then alloc and go. This is technically correct, but everywhere else I assume a 2:1 ratio for wchar_t:char. */ @@ -889,3 +889,10 @@ ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str, } return MessageBox( parent, widebuf, title, buttons ); } /* ceMessageBoxChar */ + +int +ceOops( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str ) +{ + return ceMessageBoxChar( globals, parent, str, L"Oops!", + MB_OK | MB_ICONHAND ); +} diff --git a/wince/ceutil.h b/wince/ceutil.h index aea4ea6c1..9886d079b 100755 --- a/wince/ceutil.h +++ b/wince/ceutil.h @@ -47,8 +47,9 @@ void ceCheckMenus( const CEAppGlobals* globals ); void ceGetItemRect( HWND hDlg, XP_U16 resID, RECT* rect ); void ceMoveItem( HWND hDlg, XP_U16 resID, XP_S16 byX, XP_S16 byY ); -int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, XP_UCHAR* str, - wchar_t* title, XP_U16 buttons ); +int ceMessageBoxChar( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str, + const wchar_t* title, XP_U16 buttons ); +int ceOops( CEAppGlobals* globals, HWND parent, const XP_UCHAR* str ); typedef enum { PREFS_FILE_PATH_L