Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 208097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:47:40+00:00 2026-05-11T17:47:40+00:00

I have a file handle to a serial (COM) port. I need to read

  • 0

I have a file handle to a serial (COM) port. I need to read whatever data is available immediately and not wait for additional data to be sent.

How can I determine how much data is available? I can call SetCommMask(myHandle, EV_RXCHAR) and then wait for an event to tell me that some data is available, but that won’t tell me how much I can now read without blocking.

At the moment I am using CreateFile() and overlapping I/O to perform my reads so they are asynchronous, but they still wait until the buffer is filled to report the I/O as complete.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:47:41+00:00Added an answer on May 11, 2026 at 5:47 pm

    The ClearCommError() function is what you are looking for – it returns in the COMSTAT structure how many chars are in the input and output queues.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write data to a serial port via P/Invoke (explicitly not with
I have this .htaccess file domain.com/modules/mymodule/.htaccess can this htaccess file handle urls like domain.com/something
I have a C program which opens a handle to a COM port, writes
I have a class that contains file handle fHandle that points to an open
I have written a program which triggers a relay switch on a serial port.
I have a SAS file handle created as such: filename filehandle report.htm; I have
I have a program which set the number of file handle open to unlimited
I am trying to handle a CSV file via php, and I have it
I have a problem connecting to any serial port (want to exchange with an
We've got some old serial code which checks whether a serial port is available

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.