Contents Up Previous Next

wxDDEClient

A wxDDEClient object represents the client part of a client-server DDE (Dynamic Data Exchange) conversation.

To create a client which can communicate with a suitable server, you need to derive a class from wxDDEConnection and another from wxDDEClient. The custom wxDDEConnection class will intercept communications in a 'conversation' with a server, and the custom wxDDEServer is required so that a user-overridden wxDDEClient::OnMakeConnection member can return a wxDDEConnection of the required class, when a connection is made.

This DDE-based implementation is available on Windows only, but a platform-independent, socket-based version of this API is available using wxTCPClient.

Derived from

wxClientBase
wxObject

Include files

<wx/dde.h>

See also

wxDDEServer, wxDDEConnection, Interprocess communications overview

Members

wxDDEClient::wxDDEClient
wxDDEClient::MakeConnection
wxDDEClient::OnMakeConnection
wxDDEClient::ValidHost


wxDDEClient::wxDDEClient

wxDDEClient()

Constructs a client object.


wxDDEClient::MakeConnection

wxConnectionBase * MakeConnection(const wxString& host, const wxString& service, const wxString& topic)

Tries to make a connection with a server specified by the host (machine name under UNIX, ignored under Windows), service name (must contain an integer port number under UNIX), and topic string. If the server allows a connection, a wxDDEConnection object will be returned. The type of wxDDEConnection returned can be altered by overriding the wxDDEClient::OnMakeConnection member to return your own derived connection object.


wxDDEClient::OnMakeConnection

wxConnectionBase * OnMakeConnection()

The type of wxDDEConnection returned from a wxDDEClient::MakeConnection call can be altered by deriving the OnMakeConnection member to return your own derived connection object. By default, a wxDDEConnection object is returned.

The advantage of deriving your own connection class is that it will enable you to intercept messages initiated by the server, such as wxDDEConnection::OnAdvise. You may also want to store application-specific data in instances of the new class.


wxDDEClient::ValidHost

bool ValidHost(const wxString& host)

Returns true if this is a valid host name, false otherwise. This always returns true under MS Windows.