]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/ddeconn.tex
Doc mods, sash window bug
[wxWidgets.git] / docs / latex / wx / ddeconn.tex
CommitLineData
a660d684
KB
1\section{\class{wxDDEConnection}}\label{wxddeconnection}
2
3A wxDDEConnection object represents the connection between a client and a
4server. It can be created by making a connection using a\rtfsp
5\helpref{wxDDEClient}{wxddeclient} object, or by the acceptance of a connection by a\rtfsp
6\helpref{wxDDEServer}{wxddeserver} object. The bulk of a DDE (Dynamic Data Exchange)
e2a6f233 7conversation is controlled by
a660d684
KB
8calling members in a {\bf wxDDEConnection} object or by overriding its
9members.
10
11An application should normally derive a new connection class from
12wxDDEConnection, in order to override the communication event handlers
13to do something interesting.
14
e2a6f233
JS
15This DDE-based implementation is available on Windows only,
16but a platform-independent, socket-based version
17of this API is available using \helpref{wxTCPConnection}{wxtcpconnection}.
18
a660d684
KB
19\wxheading{Derived from}
20
e2a6f233 21wxConnectionBase\\
a660d684
KB
22\helpref{wxObject}{wxobject}
23
e2a6f233
JS
24\wxheading{Types}
25
26\index{wxIPCFormat}wxIPCFormat is defined as follows:
27
28\begin{verbatim}
29enum wxIPCFormat
30{
31 wxIPC_INVALID = 0,
32 wxIPC_TEXT = 1, /* CF_TEXT */
33 wxIPC_BITMAP = 2, /* CF_BITMAP */
34 wxIPC_METAFILE = 3, /* CF_METAFILEPICT */
35 wxIPC_SYLK = 4,
36 wxIPC_DIF = 5,
37 wxIPC_TIFF = 6,
38 wxIPC_OEMTEXT = 7, /* CF_OEMTEXT */
39 wxIPC_DIB = 8, /* CF_DIB */
40 wxIPC_PALETTE = 9,
41 wxIPC_PENDATA = 10,
42 wxIPC_RIFF = 11,
43 wxIPC_WAVE = 12,
44 wxIPC_UNICODETEXT = 13,
45 wxIPC_ENHMETAFILE = 14,
46 wxIPC_FILENAME = 15, /* CF_HDROP */
47 wxIPC_LOCALE = 16,
48 wxIPC_PRIVATE = 20
49};
50\end{verbatim}
51
a660d684
KB
52\wxheading{See also}
53
54\helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEServer}{wxddeserver}, \helpref{Interprocess communications overview}{ipcoverview}
55
56\latexignore{\rtfignore{\wxheading{Members}}}
57
58\membersection{wxDDEConnection::wxDDEConnection}
59
60\func{}{wxDDEConnection}{\void}
61
62\func{}{wxDDEConnection}{\param{char* }{buffer}, \param{int}{ size}}
63
64Constructs a connection object. If no user-defined connection object is
65to be derived from wxDDEConnection, then the constructor should not be
66called directly, since the default connection object will be provided on
67requesting (or accepting) a connection. However, if the user defines his
68or her own derived connection object, the \helpref{wxDDEServer::OnAcceptConnection}{wxddeserveronacceptconnection}\rtfsp
69and/or \helpref{wxDDEClient::OnMakeConnection}{wxddeclientonmakeconnection} members should be replaced by
70functions which construct the new connection object. If the arguments of
71the wxDDEConnection constructor are void, then a default buffer is
72associated with the connection. Otherwise, the programmer must provide a
73a buffer and size of the buffer for the connection object to use in
74transactions.
75
76\membersection{wxDDEConnection::Advise}
77
e2a6f233 78\func{bool}{Advise}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
a660d684
KB
79
80Called by the server application to advise the client of a change in
81the data associated with the given item. Causes the client
82connection's \helpref{wxDDEConnection::OnAdvise}{wxddeconnectiononadvise}
83member to be called. Returns TRUE if successful.
84
85\membersection{wxDDEConnection::Execute}
86
e2a6f233 87\func{bool}{Execute}{\param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
a660d684
KB
88
89Called by the client application to execute a command on the server. Can
90also be used to transfer arbitrary data to the server (similar
91to \helpref{wxDDEConnection::Poke}{wxddeconnectionpoke} in that respect). Causes the
92server connection's \helpref{wxDDEConnection::OnExecute}{wxddeconnectiononexecute} member to be
93called. Returns TRUE if successful.
94
95\membersection{wxDDEConnection::Disconnect}
96
97\func{bool}{Disconnect}{\void}
98
99Called by the client or server application to disconnect from the other
100program; it causes the \helpref{wxDDEConnection::OnDisconnect}{wxddeconnectionondisconnect} message
101to be sent to the corresponding connection object in the other
102program. The default behaviour of {\bf OnDisconnect} is to delete the
103connection, but the calling application must explicitly delete its
104side of the connection having called {\bf Disconnect}. Returns TRUE if
105successful.
106
107\membersection{wxDDEConnection::OnAdvise}\label{wxddeconnectiononadvise}
108
e2a6f233 109\func{virtual bool}{OnAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size}, \param{wxIPCFormat}{ format}}
a660d684
KB
110
111Message sent to the client application when the server notifies it of a
112change in the data associated with the given item.
113
114\membersection{wxDDEConnection::OnDisconnect}\label{wxddeconnectionondisconnect}
115
e2a6f233 116\func{virtual bool}{OnDisconnect}{\void}
a660d684
KB
117
118Message sent to the client or server application when the other
119application notifies it to delete the connection. Default behaviour is
120to delete the connection object.
121
122\membersection{wxDDEConnection::OnExecute}\label{wxddeconnectiononexecute}
123
e2a6f233 124\func{virtual bool}{OnExecute}{\param{const wxString\& }{topic}, \param{char* }{data}, \param{int}{ size}, \param{wxIPCFormat}{ format}}
a660d684
KB
125
126Message sent to the server application when the client notifies it to
127execute the given data. Note that there is no item associated with
128this message.
129
130\membersection{wxDDEConnection::OnPoke}\label{wxddeconnectiononpoke}
131
e2a6f233 132\func{virtual bool}{OnPoke}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size}, \param{wxIPCFormat}{ format}}
a660d684
KB
133
134Message sent to the server application when the client notifies it to
135accept the given data.
136
137\membersection{wxDDEConnection::OnRequest}\label{wxddeconnectiononrequest}
138
e2a6f233 139\func{virtual char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format}}
a660d684
KB
140
141Message sent to the server application when the client
142calls \helpref{wxDDEConnection::Request}{wxddeconnectionrequest}. The server
143should respond by returning a character string from {\bf OnRequest},
144or NULL to indicate no data.
145
146\membersection{wxDDEConnection::OnStartAdvise}\label{wxddeconnectiononstartadvise}
147
e2a6f233 148\func{virtual bool}{OnStartAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
a660d684
KB
149
150Message sent to the server application by the client, when the client
151wishes to start an `advise loop' for the given topic and item. The
152server can refuse to participate by returning FALSE.
153
154\membersection{wxDDEConnection::OnStopAdvise}\label{wxddeconnectiononstopadvise}
155
e2a6f233 156\func{virtual bool}{OnStopAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
a660d684
KB
157
158Message sent to the server application by the client, when the client
159wishes to stop an `advise loop' for the given topic and item. The
160server can refuse to stop the advise loop by returning FALSE, although
161this doesn't have much meaning in practice.
162
163\membersection{wxDDEConnection::Poke}\label{wxddeconnectionpoke}
164
e2a6f233 165\func{bool}{Poke}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{wxIPCFormat}{ format = wxCF\_TEXT}}
a660d684
KB
166
167Called by the client application to poke data into the server. Can be
168used to transfer arbitrary data to the server. Causes the server
169connection's \helpref{wxDDEConnection::OnPoke}{wxddeconnectiononpoke} member
170to be called. Returns TRUE if successful.
171
172\membersection{wxDDEConnection::Request}\label{wxddeconnectionrequest}
173
e2a6f233 174\func{char*}{Request}{\param{const wxString\& }{item}, \param{int *}{size}, \param{wxIPCFormat}{ format = wxIPC\_TEXT}}
a660d684
KB
175
176Called by the client application to request data from the server. Causes
177the server connection's \helpref{wxDDEConnection::OnRequest}{wxddeconnectiononrequest} member to be called. Returns a
178character string (actually a pointer to the connection's buffer) if
179successful, NULL otherwise.
180
181\membersection{wxDDEConnection::StartAdvise}\label{wxddeconnectionstartadvise}
182
183\func{bool}{StartAdvise}{\param{const wxString\& }{item}}
184
185Called by the client application to ask if an advise loop can be started
186with the server. Causes the server connection's \helpref{wxDDEConnection::OnStartAdvise}{wxddeconnectiononstartadvise}\rtfsp
187member to be called. Returns TRUE if the server okays it, FALSE
188otherwise.
189
190\membersection{wxDDEConnection::StopAdvise}\label{wxddeconnectionstopadvise}
191
192\func{bool}{StopAdvise}{\param{const wxString\& }{item}}
193
194Called by the client application to ask if an advise loop can be
195stopped. Causes the server connection's \helpref{wxDDEConnection::OnStopAdvise}{wxddeconnectiononstopadvise} member
196to be called. Returns TRUE if the server okays it, FALSE otherwise.
197
198