Parallel Port Programming #2

Blitz3D Forums/Blitz3D Beginners Area/Parallel Port Programming #2

None(Posted 2004) [#1]
It was suggested to me to use WinIO to control the parallel port. All the examples with WinIO was for C and VB. Can anyone help me figure where to load the files that are included with WinIO (and which files to use)? I want to control a simple I/O board that I have been using with QBASIC using the OUT and INP commands. A couple of programming examples would really be appreciated! Thanks to all of you that have already helped me figure where to place the .dll and the .decls files.


soja(Posted 2004) [#2]
Dennis,

To start out, it looks like you'll need to put the winio.vxd, .sys, and .dll files in your userlibs folder (or, if you create an executable, in the same folder as the executable).

Now, before you can use the functions in Blitz, you'll need to specify the declarations. Have you done that yet? The following lines would be in a .decls file in the userlibs folder:
.lib "winio.dll"
InitializeWinIo%():"InitializeWinIo"
ShutdownWinIo():"ShutdownWinIo"
InstallWinIoDriver%(path$, IsDemandLoaded%):"InstallWinIoDriver"
; ...etc
; ...for the 7 other WinIo exported function
; ...(found in the help file)

(You would have had to do this yourself.)

If you haven't, let us know where you're stuck or what you can't figure out; we'll help you out.

And then after you create the declarations, you should be able to use the functions in a blitz program, like this:
If Not InitializeWinIo() Then 
    Print "Initialization failed."
    End
Endif
If Not InstallWinIoDriver(".\", False) Then
    Print "Driver installation failed."
    End
Endif
; etc