Abuzer
New member
- Joined
- Jan 5, 2011
- Messages
- 1
- Programming Experience
- 3-5
I am new to forum.
I am trying to access the parallel port and want to on off an LED connected to the parallel port. i have read from different tutorials and write the code. but it is not working.
Option Strict Off
Option Explicit On
Module InpOut32_Declarations
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short
Public Declare Sub out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal value As Short)
End Module
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
out(&H378S, 0)
' out (&H378S,255) ''
Dim d As Integer
d = Inp(&H378S)
Dim value1 As String
' MsgBox(d)
TextBox2.Text = d
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As String
Dim b As String
Dim c As String
a = Inp(&H379S) ' just for checking the ports
b = Inp(&H378S)
C = Inp(890)
TextBox1.Text = a
TextBox2.Text = b
TextBox3.Text = c
End Sub
End Class
I am trying to access the parallel port and want to on off an LED connected to the parallel port. i have read from different tutorials and write the code. but it is not working.
Option Strict Off
Option Explicit On
Module InpOut32_Declarations
Public Declare Function Inp Lib "inpout32.dll" Alias "Inp32" (ByVal PortAddress As Short) As Short
Public Declare Sub out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Short, ByVal value As Short)
End Module
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
out(&H378S, 0)
' out (&H378S,255) ''
Dim d As Integer
d = Inp(&H378S)
Dim value1 As String
' MsgBox(d)
TextBox2.Text = d
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim a As String
Dim b As String
Dim c As String
a = Inp(&H379S) ' just for checking the ports
b = Inp(&H378S)
C = Inp(890)
TextBox1.Text = a
TextBox2.Text = b
TextBox3.Text = c
End Sub
End Class