Click to See Complete Forum and Search --> : How to send output to LPT1?


Chicho
05-23-2000, 08:56 PM
Hello,
Iam trying to send output through the parallel port on a win2k system with
this function = _outp(0x378,1), i get an unhandled exception error.
Please Help!
Thank you
Chicho

John Aspras
05-25-2000, 03:23 AM
Ok here is What you have to understand
1. the system recognision of LPT1 / LPT2 is like a file
tha means that you can open the LPT ports as regular files!!!

2. so.....

FILE *fp;

fp=fopen ("LPT1:","w");

fputs ("hello",fp);



"Chicho" <chicho_chicho@hotmail.com> wrote:
>
>Hello,
> Iam trying to send output through the parallel port on a win2k system
with
>this function = _outp(0x378,1), i get an unhandled exception error.
>Please Help!
>Thank you
>Chicho

Mohammad Arif
06-02-2000, 11:21 AM
"John Aspras" <imsniper@yahoo.com> wrote:
>
>Ok here is What you have to understand
>1. the system recognision of LPT1 / LPT2 is like a file
> tha means that you can open the LPT ports as regular files!!!
>
>2. so.....
>
>FILE *fp;
>
>fp=fopen ("LPT1:","w");
>
>fputs ("hello",fp);
>
>
>
>"Chicho" <chicho_chicho@hotmail.com> wrote:
>>
>>Hello,
>> Iam trying to send output through the parallel port on a win2k system
>with
>>this function = _outp(0x378,1), i get an unhandled exception error.
>>Please Help!
>>Thank you
>>Chicho
>Hi,

_outp and _inp are going to the hardware directly and are privileged instructions
which is not allowed in NT except in Device drivers but will will work on
95 or 98. If you need to access the port directly and control the device
WinRt(by Blue Water Systems) will do that for u.

Good Luck
Mohammad