PDA

View Full Version : interrupt handler functions in Visual C++ 6.0



scromer
01-06-2002, 04:49 AM
I am writing a DOS program using Microsoft's Visual C++ 6.0 compiler. The program is set up to read the keyboard whenever a key is pressed.
To do this I wrote a function that is designed to be an interrupt handler.
I originlly wrote this function using the Borland C++ 3.1 compiler. In this compiler you can designate a C function to be an interrupt handler by inserting the 'interrupt' keyword between the function's return type and the name of the function, in the function's signature. However, I don't see anything in the Microsoft documentation that allows for functions to be defined as interrupt handlers. Additionally, the 'interrupt' keyword does not exist in the Microsoft complier's vocabulary, as the Borland code will not compile under Visual C++ 6.0.
Does anyone know how to define a function as an interrupt handler using the Microsoft Visual C++ 6.0 compler? I am running Windows 98.

VirtualAce
01-07-2002, 07:06 PM
Interrupts are not allowed within the Windows environment. Microsoft Visual C++ does not support DOS programs nor does it support interrupts. Everything you do in Windows must be via the API, 3rd party library, or for games - DirectX.

Also, Borland code and Microsoft code will absolutely not mix unless you make significant changes in their headers, and I do mean *significant* changes. Both support different extensions in their headers. Personally, I would not try to combine the two as it will only result in mass confusion. Same goes for Borland and DirectX. You will have to make very significant changes to its headers in order to use DirectX with it.