From 7b44c10277df9827a75c314aed45b66eb9181fa6 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Sat, 26 Sep 2009 20:04:55 +0000 Subject: [PATCH] Applied #10190 (WINCE and wxLaunchDefaultBrowserBaseImpl error) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@62161 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/utilscmn.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/utilscmn.cpp b/src/common/utilscmn.cpp index 8d347a19c0..75d2ed362e 100644 --- a/src/common/utilscmn.cpp +++ b/src/common/utilscmn.cpp @@ -815,17 +815,21 @@ static bool wxLaunchDefaultBrowserBaseImpl(const wxString& url, int flags) sei.lpVerb = _T("open"); sei.nShow = SW_SHOWNORMAL; - ::ShellExecuteEx(&sei); + BOOL nExecResult = ::ShellExecuteEx(&sei); + //From MSDN for wince + //hInstApp member is only valid if the function fails, in which case it + //receives one of the following error values, which are less than or + //equal to 32. const int nResult = (int) sei.hInstApp; // Firefox returns file not found for some reason, so make an exception // for it - if ( nResult > 32 || nResult == SE_ERR_FNF ) + if ( nResult > 32 || nResult == SE_ERR_FNF || nExecResult == TRUE ) { #ifdef __WXDEBUG__ // Log something if SE_ERR_FNF happens - if ( nResult == SE_ERR_FNF ) + if ( nResult == SE_ERR_FNF || nExecResult == FALSE ) wxLogDebug(wxT("SE_ERR_FNF from ShellExecute -- maybe FireFox?")); #endif // __WXDEBUG__ return true; @@ -859,7 +863,7 @@ static bool wxLaunchDefaultBrowserBaseImpl(const wxString& url, int flags) wxLogDebug(wxT("ICStart error %d"), (int) err); return false; } -#else +#else // (non-Mac, non-MSW) #ifdef __UNIX__