I am having a problem returning any information from the usb_tc08_get_unit_info function.
The code runs without error however the tUSBInfo structure is not populated.
below is the code I have written to try and get this to work, can someone please show me where I am going wrong or show me an example of how to get this to work.
- Code: Select all
Imports System.Runtime.InteropServices
Public Class Form1
Declare Function usb_tc08_open_unit Lib "usbtc08.dll" () As Short
Declare Function usb_tc08_get_unit_info Lib "usbtc08.dll" (ByVal handle As Short, ByRef info As tUSBTC08Info) As Short
Structure tUSBTC08Info
Public size As Short
Public DriverVersion As Short
Public PicoppVersion As Short
Public HardwareVersion As Short
Public picovar As Short
Public szSerial As String
Public szCalDate As String
End Structure
Public info As tUSBTC08Info
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim handle As Short = usb_tc08_open_unit()
MessageBox.Show(handle)
'info.size = Marshal.SizeOf(info)
Dim infook As Short = usb_tc08_get_unit_info(handle, info)
MessageBox.Show(infook)
End Sub
End Class
Cart

