"Writing programs to talk with parallel port was pretty easy in old DOS days and in Win95/98 too. We could use Inporb and outportb or _inp() or _Outp functions in our program without any problem if we are running the program on DOS or WIN95/98. But entering to the new era of NT clone operating systems like WIN NT4, WIN2000, WINXP, all this simplicity goes away. Being interested in Parallel port interfacing and programming you might have experienced the problems in writing a program that can talk to parallel port successfully in NT based operating systems. When we are trying to run a program which is written using the conventional software functions like Inporb, outportb, _inp() or _Outp on a WINNT or WIN2000 system, it will show an error message that "The exception privileged instruction occurred in the application at location ....". Being a very secure operating system, Windows NT assigns some privileges and restrictions to different types of programs running on it.It classifies all the programs in to two categories , User mode and Kernel mode ie; running in ring3 and ring0 modes. user mode programs are running in ring3 mode and Kernel mode programs are running in ring0 mode. The programs you generally write falls in the user mode category. The user mode programs are restricted to use certain instructions like IN, OUT etc.. Whenever the operating system find that a user mode program is trying to execute such instructions , the operating system stops execution of those programs and will display an error message. Eventually our interfacing programs stops where they are executing IN or OUT instructions to read or write data to parallel port. But in the same time Kernel mode programs are in no way restricted in executing such instructions. Device drivers are capable of running in kernel mode. So the work around for the above stated problem is to write a kernel mode driver capable of reading and writing data to parallel port and let the user mode program to communicate with it. Writing a driver is not an easy job for even experienced programmers. But writing a simple driver for communicating with parallel port is a simple task when drivers like USB, sound card etc.. are concerned. Even though you get a working driver from somewhere else, installing and configuring it can be very cumbersome task.
Introducing Inpout32.dll for WIN 98/NT/2000/XP. This dll have the following features
1) Works seam less with all versions of windows (WIN 98, NT, 2000 and XP)
2) Using a kernel mode driver embedded in the dll
3) No special software or driver installation required
4) Driver will be automatically installed and configured automatically when the dll is loaded
5) No special APIs required only two functions Inp32 and Out32
6) Can be easily used with VC++ and VB" , but DBP ?
i've made this program
set window on
print "Loading DLL..."
LOAD DLL "inpout32.dll",1
if DLL EXIST(1)=1
print "Calling DLL Function...";
if DLL CALL EXIST(1, "Out32")=1
print "okay."
call dll 1,"Out32",&h378,&h55
else
print "does not exist."
endif
endif
wait key
&h378 is the address of LPT1 and &h55 the value that we're writeing to the port
i've also tryed with address in int 888, and a value form 0-255 but keeps comeing with errors
and i'm receiveing this error "Array does not exist or out of bounds" ... does anybody know why?
if you think you can ... or not.. both ways.. you're right