How to recover an IRQ from a VC application ?

  • Thread starter Thread starter matthieu.bocktaels
  • Start date Start date
M

matthieu.bocktaels

Hi,


I have a PC104 Input/Output card that support IRQ (IRQ2 to 7) that is
connected to a PC (x86).

I am writing a win32 application with VisualC that must be able to
recover and redirect this IRQ to another routine that reads the I/O
card's input states.

What can I do to make Windows recognizing and managing my I/O card's
IRQ ?
What kind of messages should I retrieve from Windows Messages ?

Thank you for your help.

Matthieu.
 
hi !

the device-driver is supplied.

The problem is how to make windows launching my reading routine.

My routine is, for the moment, just a simple "main" function structured
like that :

void main(void)
{
initialisation code
reading function
}

What should I do to make windows launching my reading routine?

Thanks
 
Hi matthieu!
the device-driver is supplied.

Great!
Then please read the docu!
The problem is how to make windows launching my reading routine.

My routine is, for the moment, just a simple "main" function structured
like that :

void main(void)
{
initialisation code
reading function
}

What should I do to make windows launching my reading routine?

int main()
{
// Open handle to driver
// read data from driver
// close handle to driver
return 0;
}

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Thanks for your answers Jochen

But I haven't any problems with openning a handle to the driver,
reading the datas etc...

what you give to me :
int main()
{
// Open handle to driver
// read data from driver
// close handle to driver
return 0;


}
is nearly exactly the same as my reading Function.

What I want now, is to transform the readed datas to windows messages
that I can recover with my VC program like this :
switch(message){
case WM_input_1 : .....break;
case WM_input_2 : .....break;
....etc
}
(input_1, input_2... are my readed inputs)

How can I do?
Should it be noticed somewhere in the docs (I haven't found the answer
in the docs) or in the header files (haven't found it neither :-\ )

Thanks
 
Hi matthieu!
What I want now, is to transform the readed datas to windows messages
that I can recover with my VC program like this :
switch(message){
case WM_input_1 : .....break;
case WM_input_2 : .....break;
...etc
}
(input_1, input_2... are my readed inputs)

How can I do?
Should it be noticed somewhere in the docs (I haven't found the answer
in the docs) or in the header files (haven't found it neither :-\ )

You can define your own Windows-Messages.
Just use WM_APP as base-index:

#define WM_input_1 WM_APP + 1
#define WM_input_2 WM_APP + 2

And then you can send these messages via "SendMessage" or "PostMessage"
to your window.

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
Thank you Jochen,

I'm going to try this, and I'll tell you if it works ;)

Greetings
Matthieu
 
Hello,

That's ok, I just use message and not the IRQ.

Thank you for your help :)

Matthieu Bocktaels
 
Back
Top