INFO: Detecting Data on the Communications Port (118625)



The information in this article applies to:

  • Microsoft Win32 Application Programming Interface (API), when used with:
    • the operating system: Microsoft Windows 95
    • the operating system: Microsoft Windows 98
    • the operating system: Microsoft Windows 2000
    • the operating system: Microsoft Windows Millennium Edition
    • the operating system: Microsoft Windows NT
    • the operating system: Microsoft Windows XP

This article was previously published under Q118625

SUMMARY

To detect whether there is any data available on the communications (COM) port without calling ReadFile(), use the ClearCommError() API. The field COMSTAT.CbInQue contains the number of bytes not yet read by a call to ReadFile().

Modification Type:MinorLast Reviewed:3/7/2005
Keywords:kbAPI kbCommPort kbinfo kbKernBase kbSerial KB118625