SetCommState

Syntax

int SetCommState(lpDCB)

This function sets a communication device to the state specified by the device control block pointed to by the lpDCB parameter. The device to be set must be identified by the Id field of the control block.

This function reinitializes all hardware and controls as defined by lpDCB, but does not empty transmit or receive queues.

Parameter Type/Description  

lpDCB DCB FAR * Points to a DCB data structure that contains the desired communications setting for the device.  

Return Value

The return value specifies the outcome of the function. It is zero if the function is successful. It is negative if an error occurs.