\membersection{wxDDEConnection::Advise}\label{wxddeconnectionadvise}
-\func{bool}{Advise}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the server application to advise the client of a change in
the data associated with the given item. Causes the client
\membersection{wxDDEConnection::OnRequest}\label{wxddeconnectiononrequest}
-\func{virtual char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
+\func{virtual const char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
Message sent to the server application when the client
calls \helpref{wxDDEConnection::Request}{wxddeconnectionrequest}. The server
\membersection{wxDDEConnection::Poke}\label{wxddeconnectionpoke}
-\func{bool}{Poke}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the client application to poke data into the server. Can be
used to transfer arbitrary data to the server. Causes the server
\membersection{wxConnection::Advise}\label{wxconnectionadvise}
-\func{bool}{Advise}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the server application to advise the client of a change
in the data associated with the given item. Causes the client
\membersection{wxConnection::OnRequest}\label{wxconnectiononrequest}
-\func{virtual char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
+\func{virtual const char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
Message sent to the server application when the client calls
\helpref{wxConnection::Request}{wxconnectionrequest}. The
\membersection{wxConnection::Poke}\label{wxconnectionpoke}
-\func{bool}{Poke}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the client application to poke data into the server.
Can be used to transfer arbitrary data to the server. Causes the
\membersection{wxTCPConnection::Advise}\label{wxtcpconnectionadvise}
-\func{bool}{Advise}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the server application to advise the client of a change in
the data associated with the given item. Causes the client
\membersection{wxTCPConnection::OnRequest}\label{wxtcpconnectiononrequest}
-\func{virtual char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
+\func{virtual const char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
Message sent to the server application when the client
calls \helpref{wxTCPConnection::Request}{wxtcpconnectionrequest}. The server
\membersection{wxTCPConnection::Poke}\label{wxtcpconnectionpoke}
-\func{bool}{Poke}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
+\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
Called by the client application to poke data into the server. Can be
used to transfer arbitrary data to the server. Causes the server
virtual bool Execute(const wxString& str)
{ return Execute(str.c_str(), -1, wxIPC_TEXT); }
virtual wxChar *Request(const wxString& item, int *size = (int *) NULL, wxIPCFormat format = wxIPC_TEXT) = 0;
- virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
+ virtual bool Poke(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
virtual bool StartAdvise(const wxString& item) = 0;
virtual bool StopAdvise(const wxString& item) = 0;
// Calls that SERVER can make
- virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
+ virtual bool Advise(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT) = 0;
// Calls that both can make
virtual bool Disconnect(void) = 0;
wxIPCFormat WXUNUSED(format) )
{ return false; }
- virtual wxChar *OnRequest ( const wxString& WXUNUSED(topic),
- const wxString& WXUNUSED(item),
- int *WXUNUSED(size),
- wxIPCFormat WXUNUSED(format) )
- { return (wxChar *) NULL; }
+ virtual const wxChar *OnRequest ( const wxString& WXUNUSED(topic),
+ const wxString& WXUNUSED(item),
+ int *WXUNUSED(size),
+ wxIPCFormat WXUNUSED(format) )
+ { return (wxChar *) NULL; }
virtual bool OnPoke ( const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
virtual bool Execute(const wxString& str)
{ return Execute(str.c_str(), -1, wxIPC_TEXT); }
virtual wxChar *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
- virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Poke(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
virtual bool StopAdvise(const wxString& item);
// Calls that SERVER can make
- virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Advise(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
// Calls that both can make
virtual bool Disconnect(void);
wxDDEClient* m_client;
WXHCONV m_hConv;
- wxChar* m_sendingData;
+ const wxChar* m_sendingData;
int m_dataSize;
- wxIPCFormat m_dataType;
+ wxIPCFormat m_dataType;
DECLARE_NO_COPY_CLASS(wxDDEConnection)
};
// Calls that CLIENT can make
virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual wxChar *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
- virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Poke(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool StartAdvise(const wxString& item);
virtual bool StopAdvise(const wxString& item);
// Calls that SERVER can make
- virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Advise(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
// Calls that both can make
virtual bool Disconnect(void);
// ----------------------------------------------------------------------------
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())
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);
public:
virtual bool Execute(const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual wxChar *Request(const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
- virtual bool Poke(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Poke(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool OnAdvise(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format);
virtual bool OnDisconnect();
protected:
void 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);
};
class MyClient: public wxClient
if (CanAdvise())
{
wxString s = wxDateTime::Now().Format();
- m_connection->Advise(m_connection->m_sAdvise, (wxChar *)s.c_str());
+ m_connection->Advise(m_connection->m_sAdvise, s.c_str());
s = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate();
- m_connection->Advise(m_connection->m_sAdvise, (wxChar *)s.c_str(), (s.Length() + 1) * sizeof(wxChar));
+ m_connection->Advise(m_connection->m_sAdvise, s.c_str(), (s.Length() + 1) * sizeof(wxChar));
#if wxUSE_DDE_FOR_IPC
wxLogMessage(_T("DDE Advise type argument cannot be wxIPC_PRIVATE. The client will receive it as wxIPC_TEXT, and receive the correct no of bytes, but not print a correct log entry."));
return wxConnection::OnPoke(topic, item, data, size, format);
}
-wxChar *MyConnection::OnRequest(const wxString& topic,
+const wxChar *MyConnection::OnRequest(const wxString& topic,
const wxString& item, int * size, wxIPCFormat format)
{
- wxChar *data;
+ const wxChar *data;
if (item == _T("Date"))
{
m_sRequestDate = wxDateTime::Now().Format();
- data = (wxChar *)m_sRequestDate.c_str();
+ data = m_sRequestDate.c_str();
*size = -1;
}
else if (item == _T("Date+len"))
{
m_sRequestDate = wxDateTime::Now().FormatTime() + _T(" ") + wxDateTime::Now().FormatDate();
- data = (wxChar *)m_sRequestDate.c_str();
+ data = m_sRequestDate.c_str();
*size = (m_sRequestDate.Length() + 1) * sizeof(wxChar);
}
else if (item == _T("bytes[3]"))
{
- data = (wxChar *)m_achRequestBytes;
+ data = m_achRequestBytes;
m_achRequestBytes[0] = '1'; m_achRequestBytes[1] = '2'; m_achRequestBytes[2] = '3';
*size = 3;
}
}
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())
wxLogMessage(_T("%s[invalid data],%d)"), s.c_str(), size);
}
-bool MyConnection::Advise(const wxString& item, wxChar *data, int size, wxIPCFormat format)
+bool MyConnection::Advise(const wxString& item, const wxChar *data, int size, wxIPCFormat format)
{
Log(_T("Advise"), _T(""), item, data, size, format);
return wxConnection::Advise(item, data, size, format);
~MyConnection();
virtual bool OnExecute(const wxString& topic, wxChar *data, int size, wxIPCFormat format);
- virtual wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
+ virtual const wxChar *OnRequest(const wxString& topic, const wxString& item, int *size, wxIPCFormat format);
virtual bool OnPoke(const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format);
virtual bool OnStartAdvise(const wxString& topic, const wxString& item);
virtual bool OnStopAdvise(const wxString& topic, const wxString& item);
- virtual bool Advise(const wxString& item, wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
+ virtual bool Advise(const wxString& item, const wxChar *data, int size = -1, wxIPCFormat format = wxIPC_TEXT);
virtual bool OnDisconnect();
protected:
- void Log(const wxString& command, const wxString& topic, const wxString& item, wxChar *data, int size, wxIPCFormat format);
+ void Log(const wxString& command, const wxString& topic, const wxString& item, const wxChar *data, int size, wxIPCFormat format);
public:
wxString m_sAdvise;
protected:
}
}
-bool wxTCPConnection::Poke (const wxString& item, wxChar *data, int size, wxIPCFormat format)
+bool wxTCPConnection::Poke (const wxString& item, const wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return false;
// Calls that SERVER can make
bool wxTCPConnection::Advise (const wxString& item,
- wxChar *data, int size, wxIPCFormat format)
+ const wxChar *data, int size, wxIPCFormat format)
{
if (!m_sock->IsConnected())
return false;
format = (wxIPCFormat)codeci->Read8();
int user_size = -1;
- wxChar *user_data = connection->OnRequest (topic_name, item, &user_size, format);
+ const wxChar *user_data = connection->OnRequest (topic_name, item, &user_size, format);
if (user_data)
{
return data;
}
-bool wxDDEConnection::Poke(const wxString& item, wxChar *data, int size, wxIPCFormat format)
+bool wxDDEConnection::Poke(const wxString& item, const wxChar *data, int size, wxIPCFormat format)
{
DWORD result;
if (size < 0)
// Calls that SERVER can make
bool wxDDEConnection::Advise(const wxString& item,
- wxChar *data,
+ const wxChar *data,
int size,
wxIPCFormat format)
{
wxString item_name = DDEStringFromAtom(hsz2);
int user_size = -1;
- wxChar *data = connection->OnRequest(connection->m_topicName,
- item_name,
- &user_size,
- (wxIPCFormat) wFmt);
+ const wxChar *data = connection->OnRequest(connection->m_topicName,
+ item_name,
+ &user_size,
+ (wxIPCFormat)wFmt);
if (data)
{
if (user_size < 0)