DDEAdvise( ) Function
Creates a notify link or an automatic link used in a dynamic data exchange (DDE).
DDEAdvise(nChannelNumber, cItemName, cUDFName, nLinkType) |
Parameters
- nChannelNumber
-
Specifies the channel number.
- cItemName
-
Specifies the item name. For example, Microsoft Excel uses row and column notation to refer to cells in a worksheet. The item name R1C1 designates the cell in the first row and first column of the worksheet.
- cUDFName
-
Specifies the user-defined function that is executed when a notify link or an automatic link is established and the item cItemName is modified. When the user-defined function is executed, it is passed the following six parameters in the order given below:
Parameter Contents Channel Number
The channel number of the server application.
Action
ADVISE or TERMINATE.
Item
The item name; for example, R1C1 for a Microsoft Excel worksheet cell.
Data
The new data (automatic link) or the empty string (notify link).
Format
The data format; for example, CF_TEXT.
Advise Status
The link type (0 = manual, 1 = notify, 2 = automatic).
The user-defined function should have six parameters in its LPARAMETER or PARAMETER statement to accept the values passed from the server application. If a notify link is established, the user-defined function is executed and the empty string is passed in the Data parameter. You can issue DDERequest( ) later to retrieve the data. If an automatic link is established, the user-defined function is executed and the data is passed in the Data parameter.
The Action parameter contains ADVISE when the link is being updated by the server. The user-defined function is called, and the Action parameter contains TERMINATE when the link is closed by the client or server.
Any value returned by the user-defined function is ignored.
- nLinkType
-
Specifies the link type in the following way:
nLinkType Link type 0
Manual
1
Notify
2
Automatic
You can turn off notification from the server application by specifying 0 for nLinkType. If the item changes, the user-defined function is not executed.
Return Value
Remarks
Example
See Also
© , 1996-2020 • Updated: 11/10/20
Comment or report problem with topic