+void MyFrame::OnDDEExec(wxCommandEvent& WXUNUSED(event))
+{
+#ifdef __WINDOWS__
+ wxString server = wxGetTextFromUser(_T("Server to connect to:"),
+ DIALOG_TITLE, _T("IExplore"));
+ if ( !server )
+ return;
+
+ wxString topic = wxGetTextFromUser(_T("DDE topic:"),
+ DIALOG_TITLE, _T("WWW_OpenURL"));
+ if ( !topic )
+ return;
+
+ wxString cmd = wxGetTextFromUser(_T("DDE command:"),
+ DIALOG_TITLE,
+ _T("\"file:F:\\wxWindows\\samples\\"
+ "image\\horse.gif\",,-1,,,,,"));
+ if ( !cmd )
+ return;
+
+ wxDDEClient client;
+ wxConnectionBase *conn = client.MakeConnection("", server, topic);
+ if ( !conn )
+ {
+ wxLogError(_T("Failed to connect to the DDE server '%s'."),
+ server.c_str());
+ }
+ else
+ {
+ if ( !conn->Execute(cmd) )
+ {
+ wxLogError(_T("Failed to execute command '%s' via DDE."),
+ cmd.c_str());
+ }
+ else
+ {
+ wxLogStatus(_T("Successfully executed DDE command"));
+ }
+ }
+#endif // __WINDOWS__
+}
+