Subroutine
Send data to the client.
call DDEDataString ( ConvID_IV, ItemName_SV, DataString_SV, DataLength_IV, Format_SV, Status_IV)
•ConvID_IV is an integer value representing the conversation ID assigned by the DDE DLL.
•ItemName_SV is a string value representing the item name. ItemName_SV should contain the same name that was requested by the client.
•DataString_SV is a string value representing the data string being sent to the client. The string can be zero-length only for data sent as part of an ongoing advise state initiated with DDE_FNODATA.
•DataLength_IV is an integer value representing the length of the data string.
•Format_SV is a string value. Format_SV should be the same format requested by the client.
•Status_IV is composed of DDE_FACKREQ and DDE_FRESPONSE status flags. The DDE protocol defines the DDE_FACKREQ and DDE_FRESPONSE status flags for this subroutine as follows:
•The DDE_FRESPONSE status flag should be set if this data is being sent in response to a WM_DDE_REQUEST. It is cleared if this data is being sent as part of an ongoing advise state. (See the DDEAdvise subroutine for more information.)
•The DDE_FACKREQ status flag should be set if the application wants the receiving partner to acknowledge receipt of the data. (The DDE DLL will invoke a DDE_ACK event when the partner does this.) If this data is being sent as part of an ongoing advise state, this flag should be set if the client requested that it be set when the advise state was established. (See DDE_ADVISE.)
Description
Called by the server. This subroutine sends data to the client. DDEDataString should be called only in response to a DDE_REQUEST event or as part of an ongoing DDE_ADVISE event.
Upon receipt of data, the DDE protocol requires that the client responds as follows if the DDE_FACKREQ status flag is set. The server should not attempt another DDE exchange for this conversation until the client has responded with one of these events.
Acknowledgment |
Subroutine Called |
Message |
Positive (Data was successfully received) |
DDEAck with DDE_FACK status flag set |
WM_DDE_ACK with DDE_FACK status bit set |
Negative (Data was not successfully received) |
DDEAck with DDE_FACK status flag not set |
WM_DDE_ACK with DDE_FACK status bit cleared |
Message
Posts a WM_DDE_DATA message to the client partner.
Example
response to stimulus DDE DDE_REQUEST
copy eventparam to ConvID_IV
copy DDEGetItemName (ConvID_IV) to ItemName_SV
copy DDEGetFormat (ConvID_IV) to Format_DV
if (GetTheData (ItemName_SV, Format_SV, DataString_SV))
copy (length of DataString_SV) to DataLength_IV
copy DDESetStatusFlag (0, DDE_FACKREQ) to Status_IV
copy DDESetStatusFlag (Status_IV, DDE_FRESPONSE)
to Status_IV
call DDEDataString (ConvID_IV, ItemName_SV, DataString_SV,
DataLength_IV, Format_SV, Status_IV)
else
copy 0 to Status_IV # Send a negative ACK
call DDEAck (ConvID_IV, ItemName_SV, Format_SV, Status_IV)
end if
response to stimulus DDE DDE_ACK # Recognize the
copy true to StatusOK_BV # acknowledgment
# This code fragment is assumed to be running in a
# server. This code is called because of a change in
# data and is used to inform the client, which had
# previously sent an advise for this data.
copy (length of AdviseDataString_SV) to DataLength_IV
copy 0 to Status_IV
if (AdviseAckRequested) then
copy (DDESetStatusFlag
(Status_IV, DDE_FACKREQ)) to Status_IV
end if
call DDEDataString(AdviseConvID_IV, AdviseItemName_SV,
AdviseDataString_SV, DataLength_IV,
AdviseFormat_SV, Status_IV)