Thread: Interrupt driven serial communication?

  1. #1
    Registered User
    Join Date
    Dec 2005

    Interrupt driven serial communication?

    Hi all,

    I serach through the forum to find the solution, but seems I can't find any clues. So I hope someone can point me some direction.

    I want to use the com port in PC to send and receive data in a DLL library under windows. I searched the forum here that it has a lot of example, but it seems that most of them are "polling" approach. What I want to achieve is as follow: open a com port, register it to a function, and when a byte is received it will call my registered function in my dll. Will it be possible to do it? If it is so, can someone point me a direction or share any code sample? Thanks a lot!

  2. #2
    Registered User
    Join Date
    Aug 2005
    Start with CreateFile in MSDN. Scroll down the page to find the section titled "Communications Resources, and follow that link. Read the descriptions carefully and thoroughly. One is Monitoring Events that shows how to use COM in overlapped I/O (note this is the same as interrupt driven I/O). You need to create a separate thread for this because it is a blocking function call.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Unkown Hang
    By Bladactania in forum C Programming
    Replies: 31
    Last Post: 04-22-2009, 09:33 AM
  2. Serial port Communication
    By vin_pll in forum C++ Programming
    Replies: 23
    Last Post: 01-07-2009, 09:32 AM
  3. Please help with serial communication problem - Long
    By spdylude in forum Windows Programming
    Replies: 3
    Last Post: 04-06-2005, 09:41 AM
  4. Serial communication packets
    By Roaring_Tiger in forum C Programming
    Replies: 3
    Last Post: 04-26-2003, 08:33 AM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM