]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/ddeconn.tex
compilation fix for wxUSE_STL==1 in DoGetSibling()
[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
954b8ae6
JS
24\wxheading{Include files}
25
26<wx/dde.h>
27
a7af285d
VZ
28\wxheading{Library}
29
30\helpref{wxBase}{librarieslist}
31
e2a6f233
JS
32\wxheading{Types}
33
34\index{wxIPCFormat}wxIPCFormat is defined as follows:
35
36\begin{verbatim}
37enum wxIPCFormat
38{
39 wxIPC_INVALID = 0,
40 wxIPC_TEXT = 1, /* CF_TEXT */
41 wxIPC_BITMAP = 2, /* CF_BITMAP */
42 wxIPC_METAFILE = 3, /* CF_METAFILEPICT */
43 wxIPC_SYLK = 4,
44 wxIPC_DIF = 5,
45 wxIPC_TIFF = 6,
46 wxIPC_OEMTEXT = 7, /* CF_OEMTEXT */
47 wxIPC_DIB = 8, /* CF_DIB */
48 wxIPC_PALETTE = 9,
49 wxIPC_PENDATA = 10,
50 wxIPC_RIFF = 11,
51 wxIPC_WAVE = 12,
50c549b9 52 wxIPC_UTF16TEXT = 13, /* CF_UNICODE */
e2a6f233
JS
53 wxIPC_ENHMETAFILE = 14,
54 wxIPC_FILENAME = 15, /* CF_HDROP */
55 wxIPC_LOCALE = 16,
50c549b9
VZ
56 wxIPC_UTF8TEXT = 17,
57 wxIPC_UTF32TEXT = 18,
58#if SIZEOF_WCHAR_T == 2
59 wxIPC_UNICODETEXT = wxIPC_UTF16TEXT,
60#elif SIZEOF_WCHAR_T == 4
61 wxIPC_UNICODETEXT = wxIPC_UTF32TEXT,
62#endif
e2a6f233
JS
63 wxIPC_PRIVATE = 20
64};
65\end{verbatim}
66
a660d684
KB
67\wxheading{See also}
68
69\helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEServer}{wxddeserver}, \helpref{Interprocess communications overview}{ipcoverview}
70
71\latexignore{\rtfignore{\wxheading{Members}}}
72
f510b7b2 73\membersection{wxDDEConnection::wxDDEConnection}\label{wxddeconnectionctor}
a660d684
KB
74
75\func{}{wxDDEConnection}{\void}
76
9bf6a1b8 77\func{}{wxDDEConnection}{\param{void* }{buffer}, \param{size\_t}{ size}}
a660d684
KB
78
79Constructs a connection object. If no user-defined connection object is
80to be derived from wxDDEConnection, then the constructor should not be
81called directly, since the default connection object will be provided on
82requesting (or accepting) a connection. However, if the user defines his
83or her own derived connection object, the \helpref{wxDDEServer::OnAcceptConnection}{wxddeserveronacceptconnection}\rtfsp
84and/or \helpref{wxDDEClient::OnMakeConnection}{wxddeclientonmakeconnection} members should be replaced by
85functions which construct the new connection object. If the arguments of
86the wxDDEConnection constructor are void, then a default buffer is
87associated with the connection. Otherwise, the programmer must provide a
88a buffer and size of the buffer for the connection object to use in
89transactions.
90
f510b7b2 91\membersection{wxDDEConnection::Advise}\label{wxddeconnectionadvise}
a660d684 92
9bf6a1b8 93\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat }{format = wxIPC\_PRIVATE}}
50c549b9 94
9bf6a1b8 95\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9 96
9bf6a1b8 97\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const wchar\_t* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9
VZ
98
99\func{bool}{Advise}{\param{const wxString\& }{item}, \param{const wxString& }{data}}
a660d684
KB
100
101Called by the server application to advise the client of a change in
102the data associated with the given item. Causes the client
103connection's \helpref{wxDDEConnection::OnAdvise}{wxddeconnectiononadvise}
cc81d32f 104member to be called. Returns true if successful.
a660d684 105
f510b7b2 106\membersection{wxDDEConnection::Execute}\label{wxddeconnectionexecute}
a660d684 107
9bf6a1b8 108\func{bool}{Execute}{\param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat }{format = wxIPC\_PRIVATE}}
50c549b9 109
9bf6a1b8 110\func{bool}{Execute}{\param{const char* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9 111
9bf6a1b8 112\func{bool}{Execute}{\param{const wchar\_t* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9
VZ
113
114\func{bool}{Execute}{\param{const wxString& }{data}}
a660d684
KB
115
116Called by the client application to execute a command on the server. Can
117also be used to transfer arbitrary data to the server (similar
118to \helpref{wxDDEConnection::Poke}{wxddeconnectionpoke} in that respect). Causes the
119server connection's \helpref{wxDDEConnection::OnExecute}{wxddeconnectiononexecute} member to be
cc81d32f 120called. Returns true if successful.
a660d684 121
f510b7b2 122\membersection{wxDDEConnection::Disconnect}\label{wxddeconnectiondisconnect}
a660d684
KB
123
124\func{bool}{Disconnect}{\void}
125
126Called by the client or server application to disconnect from the other
127program; it causes the \helpref{wxDDEConnection::OnDisconnect}{wxddeconnectionondisconnect} message
128to be sent to the corresponding connection object in the other
129program. The default behaviour of {\bf OnDisconnect} is to delete the
130connection, but the calling application must explicitly delete its
cc81d32f 131side of the connection having called {\bf Disconnect}. Returns true if
a660d684
KB
132successful.
133
134\membersection{wxDDEConnection::OnAdvise}\label{wxddeconnectiononadvise}
135
9bf6a1b8 136\func{virtual bool}{OnAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat }{format}}
a660d684
KB
137
138Message sent to the client application when the server notifies it of a
139change in the data associated with the given item.
140
141\membersection{wxDDEConnection::OnDisconnect}\label{wxddeconnectionondisconnect}
142
e2a6f233 143\func{virtual bool}{OnDisconnect}{\void}
a660d684
KB
144
145Message sent to the client or server application when the other
146application notifies it to delete the connection. Default behaviour is
147to delete the connection object.
148
149\membersection{wxDDEConnection::OnExecute}\label{wxddeconnectiononexecute}
150
9bf6a1b8 151\func{virtual bool}{OnExecute}{\param{const wxString\& }{topic}, \param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat}{ format}}
a660d684
KB
152
153Message sent to the server application when the client notifies it to
154execute the given data. Note that there is no item associated with
155this message.
156
157\membersection{wxDDEConnection::OnPoke}\label{wxddeconnectiononpoke}
158
9bf6a1b8 159\func{virtual bool}{OnPoke}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat }{format}}
a660d684
KB
160
161Message sent to the server application when the client notifies it to
162accept the given data.
163
164\membersection{wxDDEConnection::OnRequest}\label{wxddeconnectiononrequest}
165
9bf6a1b8 166\func{virtual const void*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{size\_t * }{size}, \param{wxIPCFormat }{format}}
a660d684
KB
167
168Message sent to the server application when the client
169calls \helpref{wxDDEConnection::Request}{wxddeconnectionrequest}. The server
170should respond by returning a character string from {\bf OnRequest},
171or NULL to indicate no data.
172
173\membersection{wxDDEConnection::OnStartAdvise}\label{wxddeconnectiononstartadvise}
174
e2a6f233 175\func{virtual bool}{OnStartAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
a660d684
KB
176
177Message sent to the server application by the client, when the client
178wishes to start an `advise loop' for the given topic and item. The
cc81d32f 179server can refuse to participate by returning false.
a660d684
KB
180
181\membersection{wxDDEConnection::OnStopAdvise}\label{wxddeconnectiononstopadvise}
182
e2a6f233 183\func{virtual bool}{OnStopAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
a660d684
KB
184
185Message sent to the server application by the client, when the client
186wishes to stop an `advise loop' for the given topic and item. The
cc81d32f 187server can refuse to stop the advise loop by returning false, although
a660d684
KB
188this doesn't have much meaning in practice.
189
190\membersection{wxDDEConnection::Poke}\label{wxddeconnectionpoke}
191
9bf6a1b8 192\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const void* }{data}, \param{size\_t }{size}, \param{wxIPCFormat }{format = wxIPC\_PRIVATE}}
50c549b9 193
9bf6a1b8 194\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const char* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9 195
9bf6a1b8 196\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const wchar\_t* }{data}, \param{size\_t }{size = (size\_t)-1}}
50c549b9
VZ
197
198\func{bool}{Poke}{\param{const wxString\& }{item}, \param{const wxString& }{data}}
a660d684
KB
199
200Called by the client application to poke data into the server. Can be
201used to transfer arbitrary data to the server. Causes the server
202connection's \helpref{wxDDEConnection::OnPoke}{wxddeconnectiononpoke} member
cc81d32f 203to be called. Returns true if successful.
a660d684
KB
204
205\membersection{wxDDEConnection::Request}\label{wxddeconnectionrequest}
206
9bf6a1b8 207\func{const void*}{Request}{\param{const wxString\& }{item}, \param{size\_t *}{size}, \param{wxIPCFormat }{format = wxIPC\_TEXT}}
a660d684
KB
208
209Called by the client application to request data from the server. Causes
210the server connection's \helpref{wxDDEConnection::OnRequest}{wxddeconnectiononrequest} member to be called. Returns a
211character string (actually a pointer to the connection's buffer) if
212successful, NULL otherwise.
213
214\membersection{wxDDEConnection::StartAdvise}\label{wxddeconnectionstartadvise}
215
216\func{bool}{StartAdvise}{\param{const wxString\& }{item}}
217
218Called by the client application to ask if an advise loop can be started
219with the server. Causes the server connection's \helpref{wxDDEConnection::OnStartAdvise}{wxddeconnectiononstartadvise}\rtfsp
cc81d32f 220member to be called. Returns true if the server okays it, false
a660d684
KB
221otherwise.
222
223\membersection{wxDDEConnection::StopAdvise}\label{wxddeconnectionstopadvise}
224
225\func{bool}{StopAdvise}{\param{const wxString\& }{item}}
226
227Called by the client application to ask if an advise loop can be
228stopped. Causes the server connection's \helpref{wxDDEConnection::OnStopAdvise}{wxddeconnectiononstopadvise} member
cc81d32f 229to be called. Returns true if the server okays it, false otherwise.
a660d684 230