Closed wxtrac closed 14 years ago
utilscmn.cpp.patch
(1.1 KiB)This patch works fine for me. No more error on wince
IMO this code is wrong for desktop Windows versions too, it seems to be a leftover from the Win16-compatibility days when we used ShellExecute() and not ShellExecuteEx(). I've changed this code to simply test the return value of the function in all ports in 56869 and it seems to work just fine for me.
This probably should be backported to 2.8 later if no problems are found with it.
Replying to [comment:2 vadz]:
IMO this code is wrong for desktop Windows versions too, it seems to be a leftover from the Win16-compatibility days when we used ShellExecute() and not ShellExecuteEx(). I've changed this code to simply test the return value of the function in all ports in 56869 and it seems to work just fine for me.
This probably should be backported to 2.8 later if no problems are found with it.
I think the same! It is really important for wxWinCE 2.8 otherwise
wxLaunchDefaultBrowser
cannot be used as it always produce a warning message even in case of success.
Thanks! Michele
Replying to [comment:2 vadz]:
IMO this code is wrong for desktop Windows versions too, it seems to be a leftover from the Win16-compatibility days when we used ShellExecute() and not ShellExecuteEx(). I've changed this code to simply test the return value of the function in all ports in 56869 and it seems to work just fine for me.
This probably should be backported to 2.8 later if no problems are found with it.
Please, if you can, in the same file in the function:
bool wxLaunchDefaultApplication(const wxString& document, int flags)
ShellExecute is used. It doesn't exist in WinCE could you make the same change you made here? See my ticket #10201
TIA! Michele
Thanks, applied to 2.8 (62161).
Issue migrated from trac ticket # 10190
component: wxMSW-CE | priority: normal | resolution: fixed
2008-11-15 16:15:07: micspi (Michele Spighi) created the issue
Trying to use wxHyperLinkCtrl I found an error in the function wxLaunchDefaultBrowserBaseImpl.
The following code seems not suitable for windows mobile:
[...] WinStruct sei;
sei.lpFile = url.c_str();
sei.lpVerb = _T("open");
sei.nShow = SW_SHOWNORMAL;
exception // for it if ( nResult > 32 || nResult == SE_ERR_FNF ) {
ifdef WXDEBUG
FireFox?"));
endif // WXDEBUG
[...]
In fact nResult value is 0 but the browser is executed, the page loaded and all work fine. But the message wxLogSysError(_T("Failed to open URL \"%s\" in default browser."), url.c_str()); is fired.
Looking at the msdn documentation for windows mobile regarding SHELLEXECUTEINFO it says:
[...] hInstApp
receives one of the following error values, which are less than or equal to 32. [...]
So it is not reliable use hInstApp as check for successful execution for windows mobile platform. Maybe we can use the value returned from ::ShellExecuteEx(&sei) and GetLasError() to avoid the problem.
I hope it helps.
Thanks! Michele