Titus Information Systems, Inc.

Standard Library
CDdeServer Class

This class is inherited from CDDE and provides an easy way to set up a Dynamic Data Exchange (DDE) server.  Note that, since most member functions and variables of the base class are static, there can be only one instance of this class in an application and the application will necessarily be an exclusively DDE server.  Primarily, this class provides event handler member functions.  These member functions are as follows:

CDdeServer::CDdeServer()
This is the constructor.  It initializes the data members.
VASOLB_API BOOL CDdeServer::Open(CString Application)
This public member function creates a DDE server with the name as specified by Application.  The value of the function is TRUE if the server is successfully created.  If any of the API functions are unsuccessful, the value of the function is FALSE.
VASOLB_API BOOL CDdeServer::Close()
This public member function terminates the DDE server.  The value of the function is TRUE if the server was successfully terminated.  If any of the API functions are unsuccessful, the value of the function is FALSE.
virtual VASOLB_API BOOL CDdeServer::OnConnect()
This member function must be overridden by the inherited class to know when a connection from a DDE client has been established.  The base class returns TRUE to acknowledge a successful connection.
virtual VASOLB_API void CDdeServer::OnDisconnect()
This member function must be overridden by the inherited class to know when a connection from a DDE client has been severed.  The base class does no processing of this transaction.
virtual VASOLB_API void CDdeServer::OnPoke(CString PokeData)
This member function must be overridden by the inherited class to receive data from a client "poke" transaction.  The base class acknowledges but ignores the received string.
virtual VASOLB_API BOOL CDdeServer::OnRequest(CString Topic, CString Item, CString FormatName, BYTE*DataArea, DWORD*LenDat)
This member function must be overridden by the inherited class to respond to a request for data from the client.  The response should be placed in DataArea for the maximum number of bytes indicated by LenDat.  LenDat should then be changed to indicate the actual number of bytes returned.  DataArea must receive data in the format specified by FormatName for the Item in Topic.  The return value indicates whether or not the data is available.  The base class returns FALSE to indicate there is no data for the specified Item in the specified Topic.
virtual VASOLB_API void CDdeServer::OnAdviseStart(HSZ hTopic, CString Topic, HSZ hItem, CString Item)
This member function must be overridden by the inherited class to know when a DDE client requests that it be advised every time the value stored in the specified Item for the specified Topic changes.  The base class acknowledges but ignores this request.
virtual VASOLB_API void CDdeServer::OnAdviseStop(HSZ hTopic, CString Topic, HSZ hItem, CString Item)
This member function must be overridden by the inherited class to know when a DDE client requests that it no longer be advised when the value stored in the specified Item for the specified Topic changes.  The base class acknowledges but ignores this request.
virtual VASOLB_API BOOL CDdeServer::OnAdviseRequest(CString Topic, CString Item, CString FormatName, BYTE*DataArea, DWORD*LenDat)
This member function must be overridden by the inherited class to respond to a request for data from the client.  The response should be placed in DataArea for the maximum number of bytes indicated by LenDat.  LenDat should then be changed to indicate the actual number of bytes returned.  DataArea must receive data in the format specified by FormatName for the Item in Topic.  The return value indicates whether or not the data is available.  The base class returns FALSE to indicate there is no data for the specified Item in the specified Topic.


[ CBinaryFile | TCommandLineInfo | CCommaFile | CDataFile | TDateCtrl | CDDE | CDdeClient ]
[ CDirectoryLocator | CDirectoryDialog | CDirectoryFind | CDirectoryNew | CFileCopy | TFrameWnd ]
[ InterfaceExcel | CMaintFn | CPrintFile | CProcDialog | TPrintDialog | CProcPropertyPage ]
[ CProgress | CRegistry | CSDisCreate | CSDisFile | CSDisPage | CSDisView | CTableFile ]
[ CTaskIcon | TPresent | TTime | TDate | TDateTime | CTransferData | TWinApp | CXlTable ]

[ Stand-alone Programs | Standard Library | Conversion Functions | Utility Functions | COBOL Functions ]
[ Windows NT Library | COBOL Library | COBOL Interface | Command Prompt Abbreviations | Purchase Instructions ]

[ Home | Areas of Expertise | "We Do Windows" | Clients and Projects | Software Samples | Package Software Available ]
[ Contact Information | Business Software Philosophy | Church Software Philosophy ]
All contents of this web site are Copyright © Titus Information Systems, Inc., Phoenix, Arizona, U.S.A.