Can't get the driver info in VS2005

Post your .Net discussions here
Post Reply
chris33
Newbie
Posts: 1
Joined: Thu Nov 27, 2008 1:18 pm

Can't get the driver info in VS2005

Post by chris33 »

I get an accessviolationexception when calling the ps3000_get_unit_info

ps3000-version: 3.6.3.4
Declare Function ps3000_get_unit_info Lib "ps3000.dll" (ByVal handle As Short, ByRef strInfo As String, ByVal lth As Short, ByVal line_no As Short) As Short

Also the declaration of the strInfo as a char-array won't run.

[code]
Dim strInfo As String = Space(254)
Dim lth As Short = strInfo.Length
Dim line_no, strLen As Short
For line_no = 0 To 5
strLen = ps3000_get_unit_info(_handle, strInfo, lth, line_no)
Next
[/code]

The Excel-macro runs without an error.
Any help?

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi in our example we declare it as follows:

Declare Function ps3000_get_unit_info Lib "c:\ps3000.dll" (ByVal handle As Integer, ByVal str As String, ByVal lth As Integer, ByVal line_no As Integer) As Integer

Try passing the string ByVal and not ByRef.

Kind regards
Ziko

Technical Specialist

Post Reply