I am using a dll file for input and output to the pc printer port. but when I use a function from that dll, I get the error, Privilleged instruction. why?
I am using win XP professional.
Printable View
I am using a dll file for input and output to the pc printer port. but when I use a function from that dll, I get the error, Privilleged instruction. why?
I am using win XP professional.
What dll are you using? And how are you using it?
I use it like this:
and this is the dll:Code:Declare Sub OUTPORT Lib "Port" (ByVal A%, ByVal b%)
Declare Function INPORT Lib "Port" (ByVal p%) As Integer
There's no documentation in the zip file about the .dll. My guess based on the date of the file, 9/2/99, is that it is not compatible with the later versions of windows. e.g., NT/2000/XP. Try the following link. At least you can get some documentation and a good example of how it works for a specific OS.
http://www.lvr.com/parport.htm#Programming
Hope it helps. Good luck.
It likely that the DLL was written for Windows 95/98. There used to be functions in C that would allow direct access to any hardware port number. I know, because I wrote a similar DLL for access to the parallel port. But with windows NT,2K, ans XP, you can no longer gain direct access to the hardware prots without a driver. Can we all say "Hardware abstraction layer?" I think this really, really sucks, but what can we do but follow along. There is a program out there called Tiny Port that we are using here that works pretty well.