Jump to content

As of July 17, 2015, the LabJack forums here at forums.labjack.com are shut down. New registrations, topics, and replies are disabled. All forums are in a read-only state for archive purposes.

Please visit our current forums at labjack.com/forums to view and make new posts. To post on the current forums, use your labjack.com login account. Your old LabJack forums login credentials have been retired. There are no longer separate logins for labjack.com and LabJack forums.


listall function for OCX

ocx listall bstr

  • Please log in to reply
1 reply to this topic

#1 sunbelt57

  • Members
  • 10 posts

Posted 11 October 2013 - 01:02 PM

I'm having trouble understanding the documentation for the listall function. It says most of the params are pointers to arrays of 127 elements. But the ActiveX version of the call: ListAllX(), it says they are of type BSTR FAR* - are they still 127 byte arrays of type BSTR FAR* or what? I can convert the BSTR types to char[] or CString but I can't find any coding examples. Thanks for your help.

#2 LabJack Support

LabJack Support
  • Admin
  • 8677 posts

Posted 11 October 2013 - 04:04 PM

For BSTR FAR* you pass a string. 10 characters represent a number, so say 2 devices are found (numberFound) there will be 20 characters representing the 2 product ID numbers in the productIDList. calMatrix is normally a 2d array (127 by 20), so one device will have 20 numbers (200 characters). The User's Guide section describes the BSTR FAR* strings in the User's Guide:




The VB6 examples contain some OCX examples:




The AIBurstX and AIStreamX examples demonstrate passing strings which are normally represented by 1 and 2D arrays. There isn't a ListAllX example, but you would perform the call like this in VB:

    Dim lngErrorcode As Long
    Dim pID As String
    Dim ser As String
    Dim lID As String
    Dim pow As String
    Dim cal As String
    Dim fnd As Long
    Dim r1 As Long
    Dim r2 As Long
    lngErrorcode = Ljackuwx1.ListAllX(pID, ser, lID, pow, cal, fnd, r1, r2)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users