+
+ // maybe we don't have to launch the DDE server at all - if it is
+ // already running, for example
+ wxDDEClient client;
+ wxLogNull nolog;
+ wxConnectionBase *conn = client.MakeConnection(_T(""),
+ ddeServer,
+ ddeTopic);
+ if ( conn )
+ {
+ // FIXME we don't check the return code as for some strange reason
+ // it will sometimes be FALSE - it is probably a bug in our
+ // DDE code but I don't see anything wrong there
+ (void)conn->Execute(ddeCommand);
+
+ // ok, the command executed - return value indicating success,
+ // making it up for async case as we really don't have any way to
+ // get the real PID of the DDE server here
+ return sync ? 0 : -1;
+ }
+ //else: couldn't establish DDE conversation, now try launching the app
+ // and sending the DDE request again