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
This commit is contained in:
Vadim Zeitlin
2003-07-20 00:35:49 +00:00
parent 250700e4ac
commit 4dd03db976

View File

@@ -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);
}
}