From: Vadim Zeitlin Date: Sun, 20 Jul 2003 00:35:49 +0000 (+0000) Subject: another attempt to open files via DDE corrctly: try Request() first, *then* Execute() X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4dd03db9761040ce1b5175cd97e5ac99468af0bc?ds=inline another attempt to open files via DDE corrctly: try Request() first, *then* Execute() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/utilsexc.cpp b/src/msw/utilsexc.cpp index e1e0d9dc98..4e9958f801 100644 --- a/src/msw/utilsexc.cpp +++ b/src/msw/utilsexc.cpp @@ -463,22 +463,24 @@ static bool wxExecuteDDE(const wxString& ddeServer, } else // connected to DDE server { - // the added complication here is that although most - // programs use XTYP_EXECUTE for their DDE API, some - // important ones - like IE and other MS stuff - use - // XTYP_REQUEST! + // the added complication here is that although most programs use + // XTYP_EXECUTE for their DDE API, some important ones -- like Word + // and other MS stuff - use XTYP_REQUEST! // - // so we try one first and then the other one if it - // failed + // moreover, anotheri mportant program (IE) understands both but + // returns an error from Execute() so we must try Request() first + // to avoid doing it twice { + // we're prepared for this one to fail, so don't show errors wxLogNull noErrors; - ok = conn->Execute(ddeCommand); + + ok = conn->Request(ddeCommand) != NULL; } if ( !ok ) { - // now try request - but show the errors - ok = conn->Request(ddeCommand) != NULL; + // now try execute -- but show the errors + ok = conn->Execute(ddeCommand); } }