X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5e530f02262d9e8b378c123579be149db231f922..ebc9b89d52acc331e89b4ab44e51f850d58dbd01:/samples/ipc/client.cpp diff --git a/samples/ipc/client.cpp b/samples/ipc/client.cpp index 09ec3059fa..25dc58e45c 100644 --- a/samples/ipc/client.cpp +++ b/samples/ipc/client.cpp @@ -76,6 +76,9 @@ END_EVENT_TABLE() // main frame bool MyApp::OnInit() { + if ( !wxApp::OnInit() ) + return false; + // Create the main frame window m_frame = new MyFrame(NULL, _T("Client")); m_frame->Show(true); @@ -334,8 +337,8 @@ void MyFrame::OnExecute(wxCommandEvent& WXUNUSED(event)) { wxString s = _T("Date"); - m_client->GetConnection()->Execute((wxChar *)s.c_str()); - m_client->GetConnection()->Execute((wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); + m_client->GetConnection()->Execute((const wxChar *)s.c_str()); + m_client->GetConnection()->Execute((const wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); #if wxUSE_DDE_FOR_IPC wxLogMessage(_T("DDE Execute can only be used to send text strings, not arbitrary data.\nThe type argument will be ignored, text truncated, converted to Unicode and null terminated.")); #endif @@ -350,9 +353,9 @@ void MyFrame::OnPoke(wxCommandEvent& WXUNUSED(event)) if (m_client->IsConnected()) { wxString s = wxDateTime::Now().Format(); - m_client->GetConnection()->Poke(_T("Date"), (wxChar *)s.c_str()); + m_client->GetConnection()->Poke(_T("Date"), (const wxChar *)s.c_str()); s = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate(); - m_client->GetConnection()->Poke(_T("Date"), (wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); + m_client->GetConnection()->Poke(_T("Date"), (const wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar)); char bytes[3]; bytes[0] = '1'; bytes[1] = '2'; bytes[2] = '3'; m_client->GetConnection()->Poke(_T("bytes[3]"), (wxChar *)bytes, 3, wxIPC_PRIVATE); @@ -414,7 +417,7 @@ MyClient::~MyClient() // ---------------------------------------------------------------------------- void MyConnection::Log(const wxString& command, const wxString& topic, - const wxString& item, wxChar *data, int size, wxIPCFormat format) + const wxString& item, const wxChar *data, int size, wxIPCFormat format) { wxString s; if (topic.IsEmpty() && item.IsEmpty()) @@ -472,7 +475,7 @@ wxChar *MyConnection::Request(const wxString& item, int *size, wxIPCFormat forma return data; } -bool MyConnection::Poke(const wxString& item, wxChar *data, int size, wxIPCFormat format) +bool MyConnection::Poke(const wxString& item, const wxChar *data, int size, wxIPCFormat format) { Log(_T("Poke"), wxEmptyString, item, data, size, format); return wxConnection::Poke(item, data, size, format);