Test and Measurement Forum

Can't get the driver info in VS2005

Post your .Net discussions here

Can't get the driver info in VS2005

Postby chris33 » Mon Dec 08, 2008 12:21 pm

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?
chris33
Newbie
 
Posts: 1
Joined: Thu Nov 27, 2008 1:18 pm

Postby ziko » Mon Dec 15, 2008 11:59 am

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
ziko
Zen Master
Zen Master
 
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots


Return to .Net Languages (C#, VB.Net, .)

Who is online

Users browsing this forum: No registered users and 0 guests