Any one please help me by sending code for handling interrupts in windows (VC++) say Serial Port Communication.
Ashu
Any one please help me by sending code for handling interrupts in windows (VC++) say Serial Port Communication.
Ashu
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
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
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
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.
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
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