Ok, then. That just adds a little bit of a curve ball then...
Since i use VB.NET, i am just guessing what VB6 code looks like (i have used VB6, but only for about a total of 2-3 hours)
Download the zip i have attached, and extract the inpout32.dll to your "C:\windows\system32\" directory.
Now, paste the following code right into your program (at the very top).
Code:
Declare Function Inp _
Lib "inpout32.dll" _
Alias "Inp32" _
(ByVal PortAddress As Integer) As Integer
Declare Sub Out _
Lib "inpout32.dll" _
Alias "Out32" _
(ByVal PortAddress As Integer, ByVal Value As Integer)
Now, like i said before, dim a variable for your base port, as well as for your status line.
The following example assumes you have a textbox named textbox1 on the form.
Code:
public const base = &h278 'This is the base address of the parallel port, normaly &H278, &H378, or even &H3BC
public const status = base + 1 'status registor (or your location for the pin) is base + 1
textbox1.text = inp(status)
Now, i will leave the decimal to binary conversion to you. This function may help;
https://www.devx.com/vb2themax/Tip/18958 I am too lazy to try it...
Ok, let's say that once you convert the status line into binary, you get 0100100. Since there is a "1" in the 7th bit spot, then pin 10 is high.
if the number is 00001110, then bit 7 is 0, which means pin 10 is high.
I have to go eat supper now, so let me know if more help is needed. If so, i will pull out my laptop with vb on it, and actually write some of my own code if you would like.