BuildCommDCB

Syntax

int BuildCommDCB(lpDef,lpDCB)

This function translates the definition string specified by the lpDef parameter into appropriate device-control block codes and places these codes into the block pointed to by the lpDCB parameter.

Parameter Type/Description  

lpDef LPSTR Points to a null-terminated character string that specifies the device-control information for a device. The string must have the same form as the DOS MODE command-line parameter.  
lpDCB DCB FAR * Points to the DCB data structure that is to receive the translated string. The structure defines the control setting for the serial-communication device.  

Return Value

The return value specifies the result of the function. It is zero if the string is translated. It is negative if an error occurs.

Comments

The BuildCommDCB function only fills the buffer. An application should call SetCommState to apply these settings to the port. Also, by default, BuildCommDCB specifies Xon/Xoff and hardware flow control as disabled. An application should set the appropriate fields in the DCB data structure to enable flow control.