CloseComm

Syntax

int CloseComm(nCid)

This function closes the communication device specified by the nCid parameter and frees any memory allocated for the device's transmit and receive queues. All characters in the output queue are sent before the communication device is closed.

Parameter Type/Description  

nCid int Specifies the device to be closed. The OpenComm function returns this value.  

Return Value

The return value specifies the result of the function. It is zero if the device is closed. It is negative if an error occurred.