Acessing parallel port problems


New member
Feb 9, 2012
Programming Experience
Hi guys,

I've been trying to this application in Visual Studio 2010 to only write to the parallel port, so supposedly it would be a very easy task, and by all the tutorials in the internet i've seen before it really is! Although it throws me always the same error which is too generic and don't give enough information for me to solve it. I'm doing this using the "Inpout32.dll" library to make the communication between VB.NET and the port... If you guys know any other way, please tell me.

The code is basically this:
Module Module1
     Public Declare Sub Out Lib "inpout32.dll" Alias "Out32" (ByVal PortAddress As Integer, ByVal Value As Integer)
End Module

Public Class Form1
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        Out(888, 1)
    End Sub
End Class

Even though this code is extremely simple it was supposed to work fine, but on clicking in the button i get this error:

SEHException was unhandled
External component has thrown an exception.

What i've tryed and didn't work:
- Used hexadecimal, binary an decimal for port address and data send.
- Verified if the port drivers and installation were ok.
- Tryed reading from the port (same error occurs).
- etc.

Please guys, I don't know where else to search for this.
Top Bottom