TransmitCommChar

  BOOL TransmitCommChar(hCommDev, chTransmit)    
  HANDLE hCommDev; /* identifies communications device */
  char chTransmit; /* specifies character to transmit */

The TransmitCommChar function places the specified character at the head of the transmission queue for the specified device.

Parameters

hCommDev

Specifies the communication device that will transmit the character. The CreateFile function returns this value.

chTransmit

Specifies the character to transmit.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

This function is useful for sending an interrupt character (such as a CTRL-C) to a host system.

This function cannot be called repeatedly if the device is not transmitting. Once the TransmitCommChar function places a character in the transmit queue, the character must be transmitted before the function can be called again. TransmitCommChar returns an error if the previous character has not yet been sent.

Character transmission is subject to normal flow control and handshaking. This function can only be called synchronously.

See Also

WaitCommEvent