I'm Using a Usb ADC11 and the UsbAdc11.dll, I created an encapsulating module based on the USBADC11api.h file provided with the example code.
I replaced all the pointer passes (*) with ByRef and all others with ByVal. One of the functions declared with a ByRef parramiter works fine:
Declare Function UsbAdc11MaxValue Lib "UsbAdc11.dll" (ByVal handle As Short, ByRef maxValue As UShort) As Short
The rest throw an AccessViolationException :
Declare Function UsbAdc11GetUnitInfo Lib "UsbAdc11.dll" (ByVal handle As Short, ByRef S As String, ByVal stringLength As Short, ByVal info As Short) As Short
Declare Function UsbAdc11GetValues Lib "UsbAdc11.dll" (ByVal handle As Short, ByRef values As UShort(), ByVal no_of_values As ULong) As ULong
Declare Function UsbAdc11GetTimesAndValues Lib "UsbAdc11.dll" (ByVal handle As Short, ByRef times As Long(), ByRef values As UShort(), ByVal no_of_values As ULong) As ULong
Declare Function UsbAdc11OpenUnitProgress Lib "UsbAdc11.dll" (ByRef handle As Short, ByRef progress As Short) As Short
Can anyone give me some insight into what i may have done wrong or what I'm missing?
Cart
