Results 1 to 26 of 26

Thread: Asynchronous Open and Close of COM port

Hybrid View

  1. #1
    Fanatic Member
    Join Date
    Mar 2009
    Posts
    739

    Re: Asynchronous Open and Close of COM port

    Originally Posted by IanS
    So, in theory, one could use that sample code to do practically 'anything' on an async basis.

    Quote Originally Posted by Dave Sell View Post
    Yes!
    This sounds interesting. I don't have a slow port ready to test so I thought of some 'other' api call I could test this with. Sleep() should do it. So I added the declaration for the API Sleep() function.

    So, calling Sleep(10000) instead of CreateFile would make the application hang for 10 seconds - but, according to you, the main form should remain responsive while we're waiting for the API call to return.

    But it doesn't, the call makes everything hang for 10 seconds.

    Maybe Sleep isn't a good one to test this with - can you think of some other slow api call we could use to test this ?
    Last edited by IanS; Mar 20th, 2010 at 12:15 PM.

Posting Permissions

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



Click Here to Expand Forum to Full Width