Xerox -05W Printer User Manual


 
13-17
Dynamic Data Exchange
ChangeSetting(
HWND hWndSlaveDDE,
HWND hWndPartnerDDE,
int MenuID,
int DataGroup,
int iValue,
LPSTR szChar,
int iCharCount
)
{
DWORD lSetting;
char buf[16];
lSetting = MAKELONG(DataGroup,MenuID);
Itoa(iSetting,buf,10);
SendPoke(hWndSlaveDDE, hWndPartnerDDE, buf, iValue, szChar,
iCharCount);
}
This time, the call to SendPoke assumes that all used strings are NULL terminated
therefore allowing the iValue parameter to reference an integer setting, as opposed to
the byte count as done previously. This is done to allow keyboard macros to be
wholly defined whilst at the same time limiting the number of functions required to
implement the Slave link.
Terminating The Slave DDE Link
To terminate the link requires a WM_DDE_TERMINATE message to be sent to
TeemTalk.
TerminateSlaveLink()
{
PostMessage(hWndPartner,WM_DDE_TERMINATE, hWnd, 0L);
}
Once received and actioned, TeemTalk will return to its normal state.
It is worth noting that any settings changed whilst in Slave mode will still apply. It is
therefore important that any parameters changed during the life of the slave link be
reset back to the values that were set prior to entry. This is best done by ensuring that
for every ChangeParameter call, a corresponding GetParameter call is made
beforehand.