dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: CancelSynchronousIo for Windows XP

  1. #1
    Join Date
    Apr 2015
    Posts
    1

    CancelSynchronousIo for Windows XP

    Hello,
    I'm writing a program that has to listen to COM port and be able to switch COM port if there's a need to do so. Currently I'm using synchronous ReadFile without timeout and if I have to change ports i use CancelSynchronousIo. Now the problem is that while this works perfectly on Windows 7, my client is using Windows XP which sadly doesn't support that function (Error: No entry-point for CancelSynchronousIo in KERNEL32.dll). Is there any other alternative to this function or any way to use it on Windows XP?
    Thanks in advance,
    Ignas

  2. #2
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: CancelSynchronousIo for Windows XP

    Just close the file handle/port.

    You don't even need the function, if you're not waiting and thus have no pending sends/receives. Note that you typically call this function from ANOTHER thread (typically the UI thread) to cancel IO on the worker thread that does the IO.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)