Navigation: Language Reference > App A - DDE, OLE, and OCX > Dynamic Data Exchange >====== DDE Events ====== | |
The DDE process is governed by several field-independent events specific to DDE. These events are posted to the ACCEPT loop of the window that opened the link between applications, either as a server or client.
The following events are posted only to a Clarion server application:
EVENT:DDErequest | A client has requested a data item. |
EVENT:DDEadvise | A client has requested continuous updates of a data item. |
EVENT:DDEexecute | A client has executed a DDEEXECUTE statement. |
EVENT:DDEpoke | A client has sent unsolicited data |
The following events are posted only to a Clarion client application:
EVENT:DDEdata | A server has supplied an updated data item. |
EVENT:DDEclosed | A server has terminated the DDE link. |
When one of these DDE events occur there are several procedures that tell you what posted the event:
·DDECHANNEL() returns the handle of the DDE server or client.
·DDEITEM() returns the item or command string passed to the server by the DDEREAD or DDEEXECUTE statements.
·DDEVALUE returns a string containing the data sent to the Clarion DDE server by the DDEPOKE statement, or the command to execute from a DDEEEXECUTE statement.
·DDEAPP() returns the name of the application.
·DDETOPIC() returns the name of the topic.
When a Clarion program creates a DDE server, external clients can link to this server and request data. Each data request is accompanied by a string (in some specific format which the server program knows) indicating the required data item. If the Clarion server already knows the value for a given item, it supplies it to the client automatically without generating any events. If it doesn't, an EVENT:DDErequest or EVENT:DDEadvise event is posted to the server window's ACCEPT loop.
When a Clarion program creates a DDE client, it can link to external servers which can provide data. When the server first provides the value for a given item, it supplies it to the client automatically without generating any events. If the client has established a “hot” link with the server, an EVENT:DDEdata event is posted to the client window's ACCEPT loop whenever the server posts a new value for the data item.