13-15
Dynamic Data Exchange
Changing Parameter Settings
Example 1
Set the serial communication’s port speed to a required baud rate.
GetBaudRate(int Baud)
{
int BaudID;
switch(iBaud)
{
case 110:
BaudID = B110;
break;
case 300:
BaudID = B300;
break;
case 600:
BaudID = B600;
break;
case 1200:
BaudID = B1200;
break;
case 2400:
BaudID = B2400;
break;
case 4800:
BaudID = B4800;
break;
case 9600:
BaudID = B9600;
break;
case 19200:
BaudID = B19200;
break;
default:
return -1;
}
return ChangeSetting(hWnd, hWndPartner, IDM_HOST,
BAUDGROUP, BaudID, NULL, 0);
}