Please enable JavaScript to view this site.

ESL Documentation

Invoked in:        

Server

Message from Partner:

WM_DDE_ADVISE

Remarks:

This event is invoked in a server when a client wants to establish an advise state.  An advise state is one where the server notifies the client whenever it recognizes any changes in the data that is the subject of the advise. This is sometimes referred to as a hot link.  An application should retrieve the item name (DDEGetItemName) and format (DDEGetFormat) to determine if the requested item is available in the requested format.

 

Required Response:

Upon receipt of a request to establish an advise state, the DDE protocol requires that the server respond as follows.  The server must respond to this event before attempting to transmit another event to the partner.

Acknowledgment

Subroutine Called

Message

Positive

(Advise state can be established)

DDEAck with

DDE_FACK status flag set

WM_DDE_ACK with

DDE_FACK status bit set

Negative

(Advise state cannot be established)

DDEAck with

DDE_FACK status flag not set

WM_DDE_ACK with

DDE_FACK status bit cleared

Advise State Notes:

If the advise state can be established, the server should query the status (call DDEGetStatus) to see if the DDE_FACKREQ or DDE_FNODATA status flags are set.

 

If the DDE_FACKREQ status flag is set, the server is being requested to send all future data that results from this advise event (via DDEDataString) to the client with the DDE_FACKREQ status flag set.  (See DDE_DATA.)

If the DDE_FNODATA status flag is set, the server is being requested to send all future data that results from this advise (via DDEDataString) to the client with a zero-length data portion.  This gives the client, upon receipt of the data, the option of requesting the data if it wants to receive it, while remaining notified of data changes.  (See DDE_DATA.)

 

It is the server's responsibility to test for these status flags and honor the requests when sending data to the partner as part of an established advise state.

 

Default Processing:

The DDE DLL default processing is to send a negative acknowledgment if the ESL program does not send an acknowledgment.

Available Queries:

DDEGetAppName

DDEGetTopic

DDEGetItemName

DDEGetStatus

DDEGetFormat

DDEGetErrorID

Example:

response to stimulus DDE DDE_ADVISE

   copy eventparam to ConvID_IV

   copy DDEGetFormat (ConvID_IV) to Format_SV

   copy DDEGetItemName (ConvID_IV) to ItemName_SV

   if (DataAvailable (ItemName_SV, Format_SV)

         then

            copy DDESetStatusFlag (0, DDE_FACK) to Status_IV

            call DDEAck (ConvID_IV, ItemName_SV,Format_SV, Status_IV)

              copy DDEGetStatus (ConvID_IV) to Status_IV

           if (DDEQueryStatusFlag (Status_IV,DDE_FNODATA)  then

                 copy true to NoData_BV

            else

                 copy false to NoData_BV

           end if

 

           if (DDEQueryStatusFlag (Status_IV,DDE_FACKREQ) then

              copy true to AckReq_BV

         else

              copy false to AckReq_BV

         end if

 else

           copy 0 to Status_IV       # Send negative ACK

         call DDEAck (ConvID_IV, ItemName_SV,Format_SV, Status)

   end if