git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5268 
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
   frame->Fit();
 
   wxString server = "4242";
   frame->Fit();
 
   wxString server = "4242";
+
+#if wxUSE_DDE_FOR_SAMPLE
   wxString hostName = wxGetHostName();
   wxString hostName = wxGetHostName();
+#else
+  wxString hostName = "localhost";
+#endif
 
   if (argc > 1)
     server = argv[1];
 
   if (argc > 1)
     server = argv[1];
-  the_connection->StartAdvise("Item");
+  if (!the_connection->StartAdvise("Item"))
+    wxMessageBox("StartAdvise failed", "Client Demo Error");
 void MyFrame::OnExecute(wxCommandEvent& event)
 {
       if (the_connection)
 void MyFrame::OnExecute(wxCommandEvent& event)
 {
       if (the_connection)
-        the_connection->Execute("Hello from the client!");
+        if (!the_connection->Execute("Hello from the client!"))
+          wxMessageBox("Execute failed", "Client Demo Error");
 }
 
 void MyFrame::OnPoke(wxCommandEvent& event)
 {
       if (the_connection)
 }
 
 void MyFrame::OnPoke(wxCommandEvent& event)
 {
       if (the_connection)
-        the_connection->Poke("An item", "Some data to poke at the server!");
+        if (!the_connection->Poke("An item", "Some data to poke at the server!"))
+          wxMessageBox("Poke failed", "Client Demo Error");
 }
 
 void MyFrame::OnRequest(wxCommandEvent& event)
 }
 
 void MyFrame::OnRequest(wxCommandEvent& event)
         char *data = the_connection->Request("An item");
         if (data)
           wxMessageBox(data, "Client: Request", wxOK);
         char *data = the_connection->Request("An item");
         if (data)
           wxMessageBox(data, "Client: Request", wxOK);
+        else
+          wxMessageBox("Request failed", "Client Demo Error");
 
   // Create a new server
   my_server = new MyServer;
   my_server->Create(server_name);
   // Create a new server
   my_server = new MyServer;
   my_server->Create(server_name);
   frame->Show(TRUE);
 
   return TRUE;
   frame->Show(TRUE);
 
   return TRUE;
 
 MyConnection::~MyConnection(void)
 {
 
 MyConnection::~MyConnection(void)
 {
-  dialog->Destroy();
-  the_connection = NULL;
+  if (the_connection)
+  {
+    dialog->Destroy();
+    the_connection = NULL;
+  }
 }
 
 bool MyConnection::OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format)
 }
 
 bool MyConnection::OnExecute(const wxString& topic, char *data, int size, wxIPCFormat format)
 
 bool MyConnection::OnStartAdvise(const wxString& topic, const wxString& item)
 {
 
 bool MyConnection::OnStartAdvise(const wxString& topic, const wxString& item)
 {