]> git.saurik.com Git - wxWidgets.git/commitdiff
another attempt to open files via DDE corrctly: try Request() first, *then* Execute()
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jul 2003 00:35:49 +0000 (00:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 20 Jul 2003 00:35:49 +0000 (00:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/utilsexc.cpp

index e1e0d9dc989341829f5f633a68df2497b4aba801..4e9958f80168cf2bbfb6419485cef82600ba6890 100644 (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);
         }
     }