1 \section{\class{wxDDEConnection
}}\label{wxddeconnection
}
3 A wxDDEConnection object represents the connection between a client and a
4 server. 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)
7 conversation is controlled by
8 calling members in a
{\bf wxDDEConnection
} object or by overriding its
11 An application should normally derive a new connection class from
12 wxDDEConnection, in order to override the communication event handlers
13 to do something interesting.
15 This DDE-based implementation is available on Windows only,
16 but a platform-independent, socket-based version
17 of this API is available using
\helpref{wxTCPConnection
}{wxtcpconnection
}.
19 \wxheading{Derived from
}
22 \helpref{wxObject
}{wxobject
}
24 \wxheading{Include files
}
30 \index{wxIPCFormat
}wxIPCFormat is defined as follows:
36 wxIPC_TEXT =
1, /* CF_TEXT */
37 wxIPC_BITMAP =
2, /* CF_BITMAP */
38 wxIPC_METAFILE =
3, /* CF_METAFILEPICT */
42 wxIPC_OEMTEXT =
7, /* CF_OEMTEXT */
43 wxIPC_DIB =
8, /* CF_DIB */
48 wxIPC_UNICODETEXT =
13,
49 wxIPC_ENHMETAFILE =
14,
50 wxIPC_FILENAME =
15, /* CF_HDROP */
58 \helpref{wxDDEClient
}{wxddeclient
},
\helpref{wxDDEServer
}{wxddeserver
},
\helpref{Interprocess communications overview
}{ipcoverview
}
60 \latexignore{\rtfignore{\wxheading{Members
}}}
62 \membersection{wxDDEConnection::wxDDEConnection
}
64 \func{}{wxDDEConnection
}{\void}
66 \func{}{wxDDEConnection
}{\param{char*
}{buffer
},
\param{int
}{ size
}}
68 Constructs a connection object. If no user-defined connection object is
69 to be derived from wxDDEConnection, then the constructor should not be
70 called directly, since the default connection object will be provided on
71 requesting (or accepting) a connection. However, if the user defines his
72 or her own derived connection object, the
\helpref{wxDDEServer::OnAcceptConnection
}{wxddeserveronacceptconnection
}\rtfsp
73 and/or
\helpref{wxDDEClient::OnMakeConnection
}{wxddeclientonmakeconnection
} members should be replaced by
74 functions which construct the new connection object. If the arguments of
75 the wxDDEConnection constructor are void, then a default buffer is
76 associated with the connection. Otherwise, the programmer must provide a
77 a buffer and size of the buffer for the connection object to use in
80 \membersection{wxDDEConnection::Advise
}
82 \func{bool
}{Advise
}{\param{const wxString\&
}{item
},
\param{char*
}{data
},
\param{int
}{ size = -
1},
\param{wxIPCFormat
}{ format = wxCF
\_TEXT}}
84 Called by the server application to advise the client of a change in
85 the data associated with the given item. Causes the client
86 connection's
\helpref{wxDDEConnection::OnAdvise
}{wxddeconnectiononadvise
}
87 member to be called. Returns TRUE if successful.
89 \membersection{wxDDEConnection::Execute
}
91 \func{bool
}{Execute
}{\param{char*
}{data
},
\param{int
}{ size = -
1},
\param{wxIPCFormat
}{ format = wxCF
\_TEXT}}
93 Called by the client application to execute a command on the server. Can
94 also be used to transfer arbitrary data to the server (similar
95 to
\helpref{wxDDEConnection::Poke
}{wxddeconnectionpoke
} in that respect). Causes the
96 server connection's
\helpref{wxDDEConnection::OnExecute
}{wxddeconnectiononexecute
} member to be
97 called. Returns TRUE if successful.
99 \membersection{wxDDEConnection::Disconnect
}
101 \func{bool
}{Disconnect
}{\void}
103 Called by the client or server application to disconnect from the other
104 program; it causes the
\helpref{wxDDEConnection::OnDisconnect
}{wxddeconnectionondisconnect
} message
105 to be sent to the corresponding connection object in the other
106 program. The default behaviour of
{\bf OnDisconnect
} is to delete the
107 connection, but the calling application must explicitly delete its
108 side of the connection having called
{\bf Disconnect
}. Returns TRUE if
111 \membersection{wxDDEConnection::OnAdvise
}\label{wxddeconnectiononadvise
}
113 \func{virtual bool
}{OnAdvise
}{\param{const wxString\&
}{topic
},
\param{const wxString\&
}{item
},
\param{char*
}{data
},
\param{int
}{ size
},
\param{wxIPCFormat
}{ format
}}
115 Message sent to the client application when the server notifies it of a
116 change in the data associated with the given item.
118 \membersection{wxDDEConnection::OnDisconnect
}\label{wxddeconnectionondisconnect
}
120 \func{virtual bool
}{OnDisconnect
}{\void}
122 Message sent to the client or server application when the other
123 application notifies it to delete the connection. Default behaviour is
124 to delete the connection object.
126 \membersection{wxDDEConnection::OnExecute
}\label{wxddeconnectiononexecute
}
128 \func{virtual bool
}{OnExecute
}{\param{const wxString\&
}{topic
},
\param{char*
}{data
},
\param{int
}{ size
},
\param{wxIPCFormat
}{ format
}}
130 Message sent to the server application when the client notifies it to
131 execute the given data. Note that there is no item associated with
134 \membersection{wxDDEConnection::OnPoke
}\label{wxddeconnectiononpoke
}
136 \func{virtual bool
}{OnPoke
}{\param{const wxString\&
}{topic
},
\param{const wxString\&
}{item
},
\param{char*
}{data
},
\param{int
}{ size
},
\param{wxIPCFormat
}{ format
}}
138 Message sent to the server application when the client notifies it to
139 accept the given data.
141 \membersection{wxDDEConnection::OnRequest
}\label{wxddeconnectiononrequest
}
143 \func{virtual char*
}{OnRequest
}{\param{const wxString\&
}{topic
},
\param{const wxString\&
}{item
},
\param{int *
}{size
},
\param{wxIPCFormat
}{ format
}}
145 Message sent to the server application when the client
146 calls
\helpref{wxDDEConnection::Request
}{wxddeconnectionrequest
}. The server
147 should respond by returning a character string from
{\bf OnRequest
},
148 or NULL to indicate no data.
150 \membersection{wxDDEConnection::OnStartAdvise
}\label{wxddeconnectiononstartadvise
}
152 \func{virtual bool
}{OnStartAdvise
}{\param{const wxString\&
}{topic
},
\param{const wxString\&
}{item
}}
154 Message sent to the server application by the client, when the client
155 wishes to start an `advise loop' for the given topic and item. The
156 server can refuse to participate by returning FALSE.
158 \membersection{wxDDEConnection::OnStopAdvise
}\label{wxddeconnectiononstopadvise
}
160 \func{virtual bool
}{OnStopAdvise
}{\param{const wxString\&
}{topic
},
\param{const wxString\&
}{item
}}
162 Message sent to the server application by the client, when the client
163 wishes to stop an `advise loop' for the given topic and item. The
164 server can refuse to stop the advise loop by returning FALSE, although
165 this doesn't have much meaning in practice.
167 \membersection{wxDDEConnection::Poke
}\label{wxddeconnectionpoke
}
169 \func{bool
}{Poke
}{\param{const wxString\&
}{item
},
\param{char*
}{data
},
\param{int
}{ size = -
1},
\param{wxIPCFormat
}{ format = wxCF
\_TEXT}}
171 Called by the client application to poke data into the server. Can be
172 used to transfer arbitrary data to the server. Causes the server
173 connection's
\helpref{wxDDEConnection::OnPoke
}{wxddeconnectiononpoke
} member
174 to be called. Returns TRUE if successful.
176 \membersection{wxDDEConnection::Request
}\label{wxddeconnectionrequest
}
178 \func{char*
}{Request
}{\param{const wxString\&
}{item
},
\param{int *
}{size
},
\param{wxIPCFormat
}{ format = wxIPC
\_TEXT}}
180 Called by the client application to request data from the server. Causes
181 the server connection's
\helpref{wxDDEConnection::OnRequest
}{wxddeconnectiononrequest
} member to be called. Returns a
182 character string (actually a pointer to the connection's buffer) if
183 successful, NULL otherwise.
185 \membersection{wxDDEConnection::StartAdvise
}\label{wxddeconnectionstartadvise
}
187 \func{bool
}{StartAdvise
}{\param{const wxString\&
}{item
}}
189 Called by the client application to ask if an advise loop can be started
190 with the server. Causes the server connection's
\helpref{wxDDEConnection::OnStartAdvise
}{wxddeconnectiononstartadvise
}\rtfsp
191 member to be called. Returns TRUE if the server okays it, FALSE
194 \membersection{wxDDEConnection::StopAdvise
}\label{wxddeconnectionstopadvise
}
196 \func{bool
}{StopAdvise
}{\param{const wxString\&
}{item
}}
198 Called by the client application to ask if an advise loop can be
199 stopped. Causes the server connection's
\helpref{wxDDEConnection::OnStopAdvise
}{wxddeconnectiononstopadvise
} member
200 to be called. Returns TRUE if the server okays it, FALSE otherwise.