Xerox -05W Printer User Manual


 
13-10
Dynamic Data Exchange
Reading & Setting Terminal Parameters
The TeemTalk for Windows 3.1 slave mode, or TeemTalk for Windows 95 or NT
session DDE topic, supports the ability to set and read the user definable setup
settings. The majority of settings require an integer value, but some require strings,
which are handled slightly differently. The following sample code gives an outline of
how to implement this. All values to identify the changeable setup parameters are
#defines.
Settings that refer to strings will return a GLOBAL ATOM value which, when
converted using the Windows SDK function GlobalGetAtomName will result in the
appropriate string. It is essential that, once converted to a string, the Atom is deleted
via a call to DeleteAtom in order to free up the resources, allocated by Windows, that
are associated with the atom.
Reading Parameter Settings
The following three examples assume that hWnd, the handle to the current window’s
DDE message processing routine and hWndPartner, the handle to the DDE partner,
are set up accordingly.
Example 1
Get the serial communication’s port speed.
GetBaudRate()
{
int iBaud;
if ((BaudID = GetSetting(hWnd, hWndPartner, IDM_HOST,
BAUDGROUP, 0)) == -1)
return -1;
switch(BaudID)
{
case B110:
iBaud = 110;
break;
case B300:
iBaud = 300;
break;
case B600:
iBaud = 600;
break;
case B1200:
iBaud = 1200;
break;