次の方法で共有


TransmitCommChar (Compact 2013)

3/28/2014

This function transmits a specified character ahead of any pending data in the output buffer of the specified communications device.

Syntax

BOOL TransmitCommChar(
  HANDLE hFile,
  char cChar
);

Parameters

  • hFile
    [in] Handle to the communications device returned by the CreateFile function.
  • cChar
    [in] Specifies the character to be transmitted.

Return Value

Nonzero indicates success. Zero indicates failure. To obtain extended error information, call the GetLastError function.

Remarks

The TransmitCommChar function is useful for sending an interrupt character (such as a CTRL+C) to a host system.

If the device is not transmitting, TransmitCommChar cannot be called repeatedly.

After TransmitCommChar places a character in the output buffer, the character must be transmitted before the function can be called again.

If the previous character has not been sent, TransmitCommChar returns an error.

Requirements

Header

winbase.h

Library

Serdev.lib

See Also

Reference

Serial Communications Functions
WaitCommEvent

Other Resources

CreateFile