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 7512373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:50:53+00:00 2026-05-29T23:50:53+00:00

In my c++ windows application I’m using the CreateFile function to access a file.

  • 0

In my c++ windows application I’m using the CreateFile function to access a file. I’m using also the following functions to control my file:

DeviceIOControl
ReadFile
SetFilePointer

since I want that my application will access many positions in the file at the same time (from requests I get to my application) I want that my application will be async. I saw there is a flag for this called FILE_FLAG_OVERLAPPED but I don’t know how to use it and when do I know when it complete its operation.
is there any callback that I have to register?
if you can copy here a sample it will be helpful

thanks

  • 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-29T23:50:54+00:00Added an answer on May 29, 2026 at 11:50 pm

    You can just spawn a new thread and call ReadFie() synchronously from that second thread. You need to synchronize both threads using a synchronization object, such as an event or a critical section.

    If you insist on the single-threaded asynchonous approach, then call the ReadFile() or ReadFileEx() and pass an OVERLAPPED structure. The structure will provide a callback function that will be called once the file read is complete.

    However for the callback function to be called, the calling thread (the one that called ReadFile() or ReadFileEx()) has to be in an alertable state.

    You just use one of the wait functions to suspend the thread and wait for the read function to call the callback function.

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

Sidebar

Related Questions

My windows application using user control and one dll is loaded on 4 pc.
I am developing a windows application using c#. I am loading a file (html,
I have a Windows application that uses a .NET PropertyGrid control. Is it possible
We have a windows application that contains an ActiveX WebBrowser control. As part of
I have a windows application running at the backend. I have functions in this
I'm writing a windows application using VS2010 and C# 4.0. I have a MDI
We have a WPF windows application that contains a stackpanel control, that I want
I deployed a windows application in the following website http://StagingServer/MyProgs/MPP/ on my intranet site,
I have a windows application, where I am using send keys to navigate from
Windows application invokes business logic Business logic creates new e-mail using Exchange Web Services

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.