Parallel Comms under WinXP with VC++
Posted on 2005-03-07
I want to use the Parallel port under Windows XP. I have done it successfully with other Windows versions but XP doesn't work. I am using a VC++ DLL to do the actual communications to the Parallel port. I am calling the DLL from a VisualBasic6 App.
HERE IS THE VC++ CODE FOR THE DLL
void _stdcall OutM2G(short portVal, short number)
_outp(portVal, number); //( This crashes with values (0x378, 0) )
short _stdcall InM2G(short portVal)
return _inp(portVal); //( This crashes with value (0x378) )
I have also tried using _outp and _inp from a Win32 Application but I get the same error: "Unhandled Eception in Blah.exe: 0xC0000096: Privileged Instruction."
Any idea what I'm doing wrong?