My current system is win2000 and i want to use visual c++ to get port usage.
The source code i had written is ;
unsigned short parlport=0x378;
void main()
{
int Data;
outp(parlport,0xff);
int status;
status=_inp(parlport);
cout<<"written="<<Data<<endl;
cout<<"read="<<status<<endl;
getch();
}
There is no error while linking but on executing level the error is;
First-chance exception in parallel_port.exe: 0xC0000096: Privileged Instruction.
What can i do ,if you have a mind please write me ,thanks.
From WinNT4 on no direct hardware access is allowed from user space programs. You need to install a kernel-space driver and ask the driver to do it for you.
An easy driver is giveio/portio; but I would recommend to use DLPortIO (do a google search for it). DLPortIO is supported on both the old Windows tree (95,98,ME) and the new NT-based kernel (NT4, 2k, XP)
I am using WINSYS driver for parallel port output, but there is serial number embeded in the driver. I would like to rewrite with driver studio. Does anybody has coding examples?
u can find some drivers on the net
o nt systems you cannot access to parallel port without this driver
i write a dll file that you can use it on win all
if you call me i can give it to you trabzone_net_team@yahoo.com
if you cannot use dll file in c++ then i can help you again
dont worry be happy man :lol: