john wrote:
Hi,
I am trying to use "_outp " function to write to parallel port . I am
using microsoft visual C++6.0. I am using it like this _outp ( 956,
255) . I am using decimal numbers. The thing is that program crahes
evertime , I run it. Please advice!
John
#include < stdio. >
#include <dos.h >
main ()
{
_outp ( 956, 255);
}
Dont you have to allow access to those ports first?
Otherwise acces to those port WILL crash your
program.
Google for "USERPORT" or "PORT ACCESS".
There are a number of utilitys to do this for you.
Copy'd from readme:
UserPort.txt
The files UserPort.sys and UserPort.exe are required if you want to have
access to
your printer port using the GMT g_n*h.dll library.
These file stem from an lp object for Pure-Data, taken from zexy (pd
project)
ported by Olaf Matthes.
Adapted to GMT use by Godfried-Willem Raes, 28.05.2002.
To get it running under WinNT/2000/XP a special kernel driver is needed.
These systems do not allow direct access to I/O ports. The subfolder
'UserPort' contains a kernel driver that handles the I/O stuff. Just copy
the file UserPort.sys into
c:\winnt\system32\drivers
and run the program
UserPort.exe.
Click on 'Start' and then 'Exit'. If you ever whish to remove
the kernel driver start the programm again and click 'Stop'.
Under Win95/98/Me all this is not needed!!!
Good Luck!