0 out of 1 rated this helpful - Rate this topic

TransmitCommChar function

Applies to: desktop apps only

Transmits a specified character ahead of any pending data in the output buffer of the specified communications device.

Syntax

BOOL WINAPI TransmitCommChar(
  __in  HANDLE hFile,
  __in  char cChar
);

Parameters

hFile [in]

A handle to the communications device. The CreateFile function returns this handle.

cChar [in]

The character to be transmitted.

Return value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

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. Once 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 yet been sent, TransmitCommChar returns an error.

Requirements

Minimum supported client

Windows XP

Minimum supported server

Windows Server 2003

Header

Winbase.h (include Windows.h)

Library

Kernel32.lib

DLL

Kernel32.dll

See also

Communications Functions
Communications Resources
CreateFile
WaitCommEvent

 

 

Send comments about this topic to Microsoft

Build date: 2/7/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ