Interrupt handling in VC++(Windows)

This is a discussion on Interrupt handling in VC++(Windows) within the Windows Programming forums, part of the Platform Specific Boards category; Any one please help me by sending code for handling interrupts in windows (VC++) say Serial Port Communication. Ashu...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    9

    Interrupt handling in VC++(Windows)

    Any one please help me by sending code for handling interrupts in windows (VC++) say Serial Port Communication.

    Ashu

  2. #2
    Registered User
    Join Date
    Nov 2002
    Posts
    157
    i can't imagine such of a low-level task would be possible in such of a high-level environment. don't think you can do it. get into assembly and see what you can do with that.

    -stallion

  3. #3
    Registered User
    Join Date
    Dec 2002
    Posts
    16
    Are you wanting to handle interrupts so that you can read data the moment it arrives at the port? If so, there's an excellent article on MSDN called "Serial Communications in Win32" that shows you how to use the WaitCommEvent() and WaitForSingleObject() functions (with mutexes) to achieve what I think your after.

    You end up with a mutex that notifies you when anything happens on the opened COM port. This article helped me write a good COM port handler for some commercial applications.

    I hope this info helps!

    - KinoCode

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    9
    Handling the events using Standard Windows API's is possible.
    What i want to know is whether can we have direct access to interrupts and interrupt vector tables as is possible in DOS environment.

    Ashu

  5. #5
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,266
    If you could do that you could do all kinds of useful things in Windows. Microsoft wouldn't want that, so attempt to access any interrupt without the OS's permission (Excluding, I believe, the user breakpoint interrupt) and Windows will show you the blue screen.

    On a more sensible note, if you ran several programs that accessed interrupts at once you'd probably seriously mess up the system. This is possible in DOS boxes beacuase those interrupts are emulated anyway, so Windows knows whats going on and can in most cases keep things running smoothly.

    No, the simple fact is that if you want to do anything in Windows, you must do it through Windows. It's like a big fat geezer blocking a doorway, there's no way you'll get past it, you can try punching it in the gut but it'll just knock you flying.

  6. #6
    Registered User
    Join Date
    Dec 2002
    Posts
    16

    Cool Going LOW level

    Well, if you want to go low level, then you can write kernel mode drivers (NT/2000/XP) and process interupt request packets (IRP's) yourself. There are a couple of companies that sell both libraries and programs to help generate your own drivers so that you don't have to. But these are expensive. There are alot of good books on the subject as well.

    Getting into driver development is a whole other world though... forget what you know of Win32. It's starting from scratch. It can be very rewarding though, as far as the knowledge gained. Just like learning ASM, it gives you a understanding of what is REALLY happening in the system.

    Kino

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    9
    This means going into the device drivers development area.
    What i was thinking that there may be some standard API's for this.


    Thanks all for the information.



    Ashu

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Script errors - bool unrecognized and struct issues
    By ulillillia in forum Windows Programming
    Replies: 10
    Last Post: 12-18-2006, 04:44 AM
  2. Question..
    By pode in forum Windows Programming
    Replies: 12
    Last Post: 12-19-2004, 07:05 PM
  3. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 06:31 PM
  4. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 10:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21