]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/ddeconn.tex
Corrected some problems I introduced, added tabevent.tex.
[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)
7conversation (available in both Windows and UNIX) is controlled by
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
15\wxheading{Derived from}
16
17\helpref{wxObject}{wxobject}
18
19\wxheading{See also}
20
21\helpref{wxDDEClient}{wxddeclient}, \helpref{wxDDEServer}{wxddeserver}, \helpref{Interprocess communications overview}{ipcoverview}
22
23\latexignore{\rtfignore{\wxheading{Members}}}
24
25\membersection{wxDDEConnection::wxDDEConnection}
26
27\func{}{wxDDEConnection}{\void}
28
29\func{}{wxDDEConnection}{\param{char* }{buffer}, \param{int}{ size}}
30
31Constructs a connection object. If no user-defined connection object is
32to be derived from wxDDEConnection, then the constructor should not be
33called directly, since the default connection object will be provided on
34requesting (or accepting) a connection. However, if the user defines his
35or her own derived connection object, the \helpref{wxDDEServer::OnAcceptConnection}{wxddeserveronacceptconnection}\rtfsp
36and/or \helpref{wxDDEClient::OnMakeConnection}{wxddeclientonmakeconnection} members should be replaced by
37functions which construct the new connection object. If the arguments of
38the wxDDEConnection constructor are void, then a default buffer is
39associated with the connection. Otherwise, the programmer must provide a
40a buffer and size of the buffer for the connection object to use in
41transactions.
42
43\membersection{wxDDEConnection::Advise}
44
45\func{bool}{Advise}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{int}{ format = wxCF\_TEXT}}
46
47Called by the server application to advise the client of a change in
48the data associated with the given item. Causes the client
49connection's \helpref{wxDDEConnection::OnAdvise}{wxddeconnectiononadvise}
50member to be called. Returns TRUE if successful.
51
52\membersection{wxDDEConnection::Execute}
53
54\func{bool}{Execute}{\param{char* }{data}, \param{int}{ size = -1},
55\param{int}{ format = wxCF\_TEXT}}
56
57Called by the client application to execute a command on the server. Can
58also be used to transfer arbitrary data to the server (similar
59to \helpref{wxDDEConnection::Poke}{wxddeconnectionpoke} in that respect). Causes the
60server connection's \helpref{wxDDEConnection::OnExecute}{wxddeconnectiononexecute} member to be
61called. Returns TRUE if successful.
62
63\membersection{wxDDEConnection::Disconnect}
64
65\func{bool}{Disconnect}{\void}
66
67Called by the client or server application to disconnect from the other
68program; it causes the \helpref{wxDDEConnection::OnDisconnect}{wxddeconnectionondisconnect} message
69to be sent to the corresponding connection object in the other
70program. The default behaviour of {\bf OnDisconnect} is to delete the
71connection, but the calling application must explicitly delete its
72side of the connection having called {\bf Disconnect}. Returns TRUE if
73successful.
74
75\membersection{wxDDEConnection::OnAdvise}\label{wxddeconnectiononadvise}
76
77\func{bool}{OnAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size}, \param{int}{ format}}
78
79Message sent to the client application when the server notifies it of a
80change in the data associated with the given item.
81
82\membersection{wxDDEConnection::OnDisconnect}\label{wxddeconnectionondisconnect}
83
84\func{bool}{OnDisconnect}{\void}
85
86Message sent to the client or server application when the other
87application notifies it to delete the connection. Default behaviour is
88to delete the connection object.
89
90\membersection{wxDDEConnection::OnExecute}\label{wxddeconnectiononexecute}
91
92\func{bool}{OnExecute}{\param{const wxString\& }{topic}, \param{char* }{data}, \param{int}{ size}, \param{int}{ format}}
93
94Message sent to the server application when the client notifies it to
95execute the given data. Note that there is no item associated with
96this message.
97
98\membersection{wxDDEConnection::OnPoke}\label{wxddeconnectiononpoke}
99
100\func{bool}{OnPoke}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size}, \param{int}{ format}}
101
102Message sent to the server application when the client notifies it to
103accept the given data.
104
105\membersection{wxDDEConnection::OnRequest}\label{wxddeconnectiononrequest}
106
107\func{char*}{OnRequest}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}, \param{int *}{size}, \param{int}{ format}}
108
109Message sent to the server application when the client
110calls \helpref{wxDDEConnection::Request}{wxddeconnectionrequest}. The server
111should respond by returning a character string from {\bf OnRequest},
112or NULL to indicate no data.
113
114\membersection{wxDDEConnection::OnStartAdvise}\label{wxddeconnectiononstartadvise}
115
116\func{bool}{OnStartAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
117
118Message sent to the server application by the client, when the client
119wishes to start an `advise loop' for the given topic and item. The
120server can refuse to participate by returning FALSE.
121
122\membersection{wxDDEConnection::OnStopAdvise}\label{wxddeconnectiononstopadvise}
123
124\func{bool}{OnStopAdvise}{\param{const wxString\& }{topic}, \param{const wxString\& }{item}}
125
126Message sent to the server application by the client, when the client
127wishes to stop an `advise loop' for the given topic and item. The
128server can refuse to stop the advise loop by returning FALSE, although
129this doesn't have much meaning in practice.
130
131\membersection{wxDDEConnection::Poke}\label{wxddeconnectionpoke}
132
133\func{bool}{Poke}{\param{const wxString\& }{item}, \param{char* }{data}, \param{int}{ size = -1}, \param{int}{ format = wxCF\_TEXT}}
134
135Called by the client application to poke data into the server. Can be
136used to transfer arbitrary data to the server. Causes the server
137connection's \helpref{wxDDEConnection::OnPoke}{wxddeconnectiononpoke} member
138to be called. Returns TRUE if successful.
139
140\membersection{wxDDEConnection::Request}\label{wxddeconnectionrequest}
141
142\func{char*}{Request}{\param{const wxString\& }{item}, \param{int *}{size}, \param{int}{ format = wxCF\_TEXT}}
143
144Called by the client application to request data from the server. Causes
145the server connection's \helpref{wxDDEConnection::OnRequest}{wxddeconnectiononrequest} member to be called. Returns a
146character string (actually a pointer to the connection's buffer) if
147successful, NULL otherwise.
148
149\membersection{wxDDEConnection::StartAdvise}\label{wxddeconnectionstartadvise}
150
151\func{bool}{StartAdvise}{\param{const wxString\& }{item}}
152
153Called by the client application to ask if an advise loop can be started
154with the server. Causes the server connection's \helpref{wxDDEConnection::OnStartAdvise}{wxddeconnectiononstartadvise}\rtfsp
155member to be called. Returns TRUE if the server okays it, FALSE
156otherwise.
157
158\membersection{wxDDEConnection::StopAdvise}\label{wxddeconnectionstopadvise}
159
160\func{bool}{StopAdvise}{\param{const wxString\& }{item}}
161
162Called by the client application to ask if an advise loop can be
163stopped. Causes the server connection's \helpref{wxDDEConnection::OnStopAdvise}{wxddeconnectiononstopadvise} member
164to be called. Returns TRUE if the server okays it, FALSE otherwise.
165
166