Xerox -07W & -11W Printer User Manual


 
13-8
Dynamic Data Exchange
GlobalUnlock(hPokeData);
if (bRelease)
{
GlobalFree(hPokeData);
}
PostMessage(
hWndPartnerDDE,
WM_DDE_ACK,
hWnd,
MAKELONG(0x8000, atomItem)
);
return;
}
The important call here is PartnerSentData, which actually does the processing of
the received data. The lpPokeData->Value parameter, although defined in the
DDE.H file as a character array containing 1 character, serves as a pointer to a larger
block of data defined as follows:
a) An INTEGER value reflecting the number of bytes of valid data sent,
followed by
b) The data.
This is done in clipboard CF_TEXT format, so each block of data is terminated with
a CR, a LF and a NULL.
The function returns TRUE if successful, or FALSE if not. Note that upon receipt of
a FALSE return, ClientReceivedPoke will send a negative DDE ACK message back
to TeemTalk to reflect the failure.
Sending data to TeemTalk requires the client to post a WM_DDE_POKE message,
with a pointer to the data as defined previously (i.e. the first 2 bytes constitute a
integer count of the number of bytes of data, followed by those bytes, and appended
with CR, LF, NULL). A possible way of doing this is as follows.
Note: This example does not contain any allowances for DDE
messages that are awaiting ACKnowledgement from the
partner, or provision of timeouts in the event of a DDE
message not being ACKnowledged. iData and iValcount
should be set to the same value, the reason for having these
two parameters will become clear later on.