X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/39d580f7dcc48a85d092f6088f8c978a18db5a97..830efc9b0cb87eae22d4435af7858175017522ab:/samples/ipc/server.cpp diff --git a/samples/ipc/server.cpp b/samples/ipc/server.cpp index f278b704e8..0c91c8df45 100644 --- a/samples/ipc/server.cpp +++ b/samples/ipc/server.cpp @@ -74,7 +74,7 @@ bool MyApp::OnInit() (new MyFrame(NULL, "Server"))->Show(TRUE); // service name (DDE classes) or port number (TCP/IP based classes) - wxString service = "4242"; + wxString service = IPC_SERVICE; if (argc > 1) service = argv[1]; @@ -136,7 +136,7 @@ void MyFrame::OnListBoxClick(wxCommandEvent& WXUNUSED(event)) wxString value = listBox->GetStringSelection(); if (the_connection) { - the_connection->Advise("Item", (wxChar *)value.c_str()); + the_connection->Advise(IPC_ADVISE_NAME, (wxChar *)value.c_str()); } } } @@ -173,10 +173,11 @@ void IPCDialogBox::OnQuit(wxCommandEvent& event) wxConnectionBase *MyServer::OnAcceptConnection(const wxString& topic) { - if (strcmp(topic, "STDIO") != 0 && strcmp(topic, "IPC TEST") == 0) + if ( topic == IPC_TOPIC ) return new MyConnection(ipc_buffer, WXSIZEOF(ipc_buffer)); - else - return NULL; + + // unknown topic + return NULL; } // ---------------------------------------------------------------------------- @@ -206,7 +207,7 @@ bool MyConnection::OnExecute(const wxString& WXUNUSED(topic), int WXUNUSED(size), wxIPCFormat WXUNUSED(format)) { - wxLogStatus("Execute command: %s", data); + wxLogStatus(wxT("Execute command: %s"), data); return TRUE; } @@ -216,7 +217,7 @@ bool MyConnection::OnPoke(const wxString& WXUNUSED(topic), int WXUNUSED(size), wxIPCFormat WXUNUSED(format)) { - wxLogStatus("Poke command: %s = %s", item.c_str(), data); + wxLogStatus(wxT("Poke command: %s = %s"), item.c_str(), data); return TRUE; }