This is the code that Henri posted few days ago:
The DLPortIO declarations with .NET
Code:
Public Declare Function DlPortReadPortUchar Lib "dlportio.dll" ( _
ByVal Port As Integer) As Byte
Public Declare Function DlPortReadPortUshort Lib "dlportio.dll" ( _
ByVal Port As Integer) As Short
Public Declare Function DlPortReadPortUlong Lib "dlportio.dll" ( _
ByVal Port As Integer) As Integer
Public Declare Sub DlPortReadPortBufferUchar Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs (Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)
Public Declare Sub DlPortReadPortBufferUshort Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)
Public Declare Sub DlPortReadPortBufferUlong Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)
Public Declare Sub DlPortWritePortUchar Lib "dlportio.dll" ( _
ByVal Port As Integer, _
ByVal Value As Byte)
Public Declare Sub DlPortWritePortUshort Lib "dlportio.dll" ( _
ByVal Port As Integer, _
ByVal Value As Short)
Public Declare Sub DlPortWritePortUlong Lib "dlportio.dll" ( _
ByVal Port As Integer, _
ByVal Value As Integer)
Public Declare Sub DlPortWritePortBufferUchar Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)
Public Declare Sub DlPortWritePortBufferUshort Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)
Public Declare Sub DlPortWritePortBufferUlong Lib "dlportio.dll" ( _
ByVal Port As Integer, _
<System.Runtime.InteropServices.MarshalAs(Runtime.InteropServices.UnmanagedType.AsAny)> ByVal Buffer As Object, _
ByVal Count As Integer)