Click to See Complete Forum and Search --> : Parallels Port Status-/Controlregister in W2K


tryge
February 1st, 2003, 03:38 PM
Hi there,
I need to know how to read/write to the status/control register of the Parallel Port in W2K with win32.

I know how to get the handle and use ReadFile / WriteFile but after hard recherching i didn't get an answer.

Pleas help,
thanks tryge

srujan
February 4th, 2003, 03:00 AM
Hey you can not access any port directly from win2k as it's having it's previleged levels.

For that you have to create a driver which will allow you to access the parallel port. And after that open the driver handler. Then write to that handler, and read from that.
You acn use the functions _outp(), _inp() to write and read from the paralle port.

And one more things also... you can not do the both read and write operations for the status lines. It allows you only to do read, but with the control lines you can do both the operations.

If you want to have an example, then go to

http:\\www.beyondlogic.org it gives you somuch of code for doing your task...


All The Best


-srujan

tryge
February 4th, 2003, 05:11 AM
Thank you for your help,

it works now!!! :-)

tryge