Reply
Posts: 8
Registered: ‎03-15-2016
Accepted Solution

Problems by getting DLL version with CP213x_GetLibraryVersion function

Hello,

I want to get the release number (major and minor values) of SLAB_USB_SPI.dll and i am using function

CP213x_GetLibraryVersion(BYTE* pMajor, BYTE* pMinor, BOOL* plsRelease) but it seems to be it doesn't work properly.

First of all, i defined pMajor and pMinor as BYTE variables and i passed their addresses (referenced with &) to CP213x_GetLibraryVersion but i get 0 for both variables whereas the probably version number is 1.0 as indicated in .chm Help file.

If i define pMajor and pMinor as char arrays (strings), passing their names to CP213x_GetLibraryVersion, i get 0x01 in first element of pMajor but for pMinor i get "ERROR: Over array bounds".

If you can share a piece of code solving this issue i would appreciate.

Regards!

Alejandro Pinto

 

Posts: 241
Registered: ‎07-27-2016

Re: Problems by getting DLL version with CP213x_GetLibraryVersion function

Hi,

 

What language are you writing your code in?

 

~Manasa

Posts: 8
Registered: ‎03-15-2016

Re: Problems by getting DLL version with CP213x_GetLibraryVersion function

Hi, 

 

I forgot to mention i am writing the code in ANSI C. LabWindows/CVI is the IDE i am using.

 

Regards!

 

Alejandro Pinto

Highlighted
Posts: 241
Registered: ‎07-27-2016

Re: Problems by getting DLL version with CP213x_GetLibraryVersion function

You should be sending the arguments as BYTE and not as strings. The function CP213x_GetLibraryVersion uses __stdcall convention. Make sure that your function is also using the same. Also, initialize your parameters to a known value (0xA, for instance) and see if the return value is changing when you pass these parameters? Finally, can you write the code in command line and then try to see if it works? If it doesn't, then please paste the code that you wrote on command like here, so that I can take a look.