National Instruments 320682C Musical Toy Instrument User Manual


 
Chapter 6 DDE Library
© National Instruments Corporation 6-9 LabWindows/CVI Standard Libraries
Parameter Discussion
serverName, topicName, and itemName must be strings of length from 1 to 255. They are used
without regard to case.
Using this Function
This function allows your program, acting as a DDE server, to send data to all clients that have
set up hot or warm links on the specified topic and item.
When a hot or warm link is set up, your server callback function receives a DDE_ADVISELOOP
transaction type (xType) for a particular data object (identified by itemName). When the hot or
warm link is terminated, your server callback function receives a DDE_ADVISESTOP
transaction type for the data object.
During the period when the hot or warm link is in effect, your server program is responsible for
notifying the client whenever the value of the data object changes. When the data object's value
changes, your server program should call either of the following functions,
BroadcastDDEDataReady or AdviseDDEDataReady.
BroadcastDDEDataReady differs from AdviseDDEDataReady in that it is not restricted
to a particular client. BroadcastDDEDataReady sends the data automatically to all clients
with hot links to the item. BroadcastDDEDataReady notifies all clients with warm links to
the item. For each warm-linked client that requests the data, your server callback function is
invoked with the DDE_REQUESTDATA message. You must call ServerDDEWrite in the
callback to send the data.
When successful, this function returns the number of bytes sent. Otherwise, this function returns
a negative error code. Consult the table at the end of this chapter to see the error code values.
Note: Your program should not call this function within a tight loop, because it will compete
with user interface events for the CPU time. This function should be used sparingly,
and only when the value of the hot or warm linked data object changes. In cases when
large data objects are to be returned from the server, it should only be called when the
user interface is not busy.
See Also
RegisterDDEServer, SetUpDDEHotLink, SetUpDDEWarmLink,
AdviseDDEDataReady,
ClientDDEExecute
int status = ClientDDEExecute (unsigned int conversationHandle,
char commandString[], unsigned int timeout);