Sends data between client and server applications in a dynamic data exchange (DDE) conversation.
Syntax
DDEPoke(nChannelNumber, cItemName, cDataSent
[, cDataFormat [, cUDFName]])
Returns
Logical
Arguments
nChannelNumber
Specifies the channel number of the application data is sent to. If the channel number is a server channel, DDEPoke( ) sends the data in response to a request or a previously established notify or automatic link.
cItemName
Specifies the item name to which data is sent. The item name is application-specific and must be understood by the application. For example, Microsoft Excel supports R1C1 as a valid item name that refers to the first cell in a worksheet.
cDataSent
Specifies the data sent to the item name specified with cItemName.
cDataFormat
Specifies the format used to send the data. The default format is CF_TEXT. In this format, fields are delimited with tabs and records are delimited with a carriage return and a linefeed.
cUDFName
Allows asynchronous data transfer. If cUDFName is omitted, a client waits for the period specified with DDESetOption( ). If you specify the name of a user-defined function with cUDFName, client program execution continues immediately after the request is made.
When the data is available from the server application, the user-defined function specified with cUDFName is executed. The user-defined function is passed six parameters in this order:
Parameter | Contents |
Channel Number | The channel number of the server application. |
Action | XACTCOMPLETE (successful transaction). XACTFAIL (failed transaction). |
Item | The item name; for example, R1C1 for a Microsoft Excel worksheet cell. |
Data | The new data (REQUEST) or data passed (POKE or EXECUTED). |
Format | The data format; for example, CF_TEXT. |
Transaction Number | The transaction number returned by DDEPoke( ). |
Use DDEAbortTrans( ) to cancel an uncompleted transaction. If the transaction fails, you can use DDELastError( ) to determine why it failed.
When you include cUDFName, DDEPoke( ) returns a transaction number if successful or –1 if an error occurs.
Remarks
DDEPoke( ) sends data as a character string to the item name in the application specified by the channel number.
If the data is successfully sent, DDEPoke( ) returns true (.T.). If the data cannot be sent, DDEPoke( ) returns false (.F.). If the asynchronous user-defined function cUDFName is included, DDEPoke( ) returns a transaction number; if an error occurs, DDEPoke( ) returns –1.