diff --git a/src/myipc.cpp b/src/myipc.cpp index c7c0919..1901019 100755 --- a/src/myipc.cpp +++ b/src/myipc.cpp @@ -46,11 +46,17 @@ MyServerConnection::~MyServerConnection() } bool MyServerConnection::OnPoke ( - const wxString& WXUNUSED ( topic ), - const wxString& item, - wxChar *data, - int size, - wxIPCFormat WXUNUSED ( format ) ) + const wxString& WXUNUSED ( topic ) + , const wxString& item +#if wxCHECK_VERSION(2,9,0) + , const void *data + , size_t size +#else + , wxChar *data + , int size +#endif + , wxIPCFormat WXUNUSED ( format ) + ) { if ( !wxTheApp ) return false; @@ -90,7 +96,18 @@ wxConnectionBase *MyClient::OnMakeConnection() return new MyClientConnection; } -bool MyClientConnection::OnAdvise ( const wxString& WXUNUSED ( topic ), const wxString& WXUNUSED ( item ), wxChar *data, int WXUNUSED ( size ), wxIPCFormat WXUNUSED ( format ) ) +bool MyClientConnection::OnAdvise ( + const wxString& WXUNUSED ( topic ) + , const wxString& WXUNUSED ( item ) +#if wxCHECK_VERSION(2,9,0) + , const void * WXUNUSED ( data ) + , size_t WXUNUSED ( size ) +#else + , wxChar * WXUNUSED ( data ) + , int WXUNUSED ( size ) +#endif + , wxIPCFormat WXUNUSED ( format ) + ) { return true; } diff --git a/src/myipc.h b/src/myipc.h index eb72ac8..201689e 100755 --- a/src/myipc.h +++ b/src/myipc.h @@ -40,7 +40,17 @@ class MyServerConnection : public wxConnection public: MyServerConnection(); ~MyServerConnection(); - bool OnPoke ( const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format ); + bool OnPoke ( const wxString& topic + , const wxString& item +#if wxCHECK_VERSION(2,9,0) + , const void *data + , size_t size +#else + , wxChar *data + , int size +#endif + , wxIPCFormat format + ); bool OnStartAdvise ( const wxString& topic, const wxString& item ); }; @@ -48,7 +58,16 @@ class MyClientConnection: public wxConnection { public: MyClientConnection(); - bool OnAdvise ( const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format ); + bool OnAdvise ( const wxString& topic + , const wxString& item +#if wxCHECK_VERSION(2,9,0) + , const void *data + , size_t size +#else + , wxChar *data + , int size +#endif + , wxIPCFormat format ); bool OnDisconnect(); }; diff --git a/src/xmlcopyeditor.cpp b/src/xmlcopyeditor.cpp index 9a15766..a56c8d2 100755 --- a/src/xmlcopyeditor.cpp +++ b/src/xmlcopyeditor.cpp @@ -205,8 +205,6 @@ IMPLEMENT_APP ( MyApp) MyApp::MyApp() : checker ( NULL ) , server ( NULL ) - , client ( NULL ) - , connection ( NULL ) , singleInstanceCheck ( false ) , lang ( 0 ) #if defined(__WXMSW__) && !wxCHECK_VERSION(2,9,0) @@ -227,7 +225,6 @@ MyApp::~MyApp() delete checker; delete server; - delete connection; } bool MyApp::OnInit() @@ -337,9 +334,9 @@ bool MyApp::OnInit() while ( checker->IsAnotherRunning() ) { // attempt calling server - client = new MyClient(); - connection = ( MyClientConnection * ) - client->MakeConnection ( hostName, service, IPC_TOPIC ); + MyClient client; + MyClientConnection *connection = ( MyClientConnection * ) + client.MakeConnection ( hostName, service, IPC_TOPIC ); if ( !connection || !connection->StartAdvise ( IPC_ADVISE_NAME ) ) break; else diff --git a/src/xmlcopyeditor.h b/src/xmlcopyeditor.h index 11a19f4..ca4cd1c 100755 --- a/src/xmlcopyeditor.h +++ b/src/xmlcopyeditor.h @@ -185,8 +185,6 @@ class MyApp : public wxApp private: wxSingleInstanceChecker *checker; MyServer *server; - MyClient *client; - MyClientConnection *connection; bool singleInstanceCheck; int lang; std::auto_ptr config;