UsbAdc11.dll VB .NET usage

Post your .Net discussions here
Post Reply
christek
Newbie
Posts: 1
Joined: Fri May 23, 2008 5:49 pm

UsbAdc11.dll VB .NET usage

Post by christek »

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?

MatrixCow
User
User
Posts: 7
Joined: Wed Apr 09, 2008 12:37 pm
Location: Belgium

Post by MatrixCow »

Are you sure the datatypes are correct? The datatypes for c or c++ are not the same as for VB.NET or C#.NET.

Post Reply