LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

external function with array of strings parameter

Hi,
i have dll with function, that one of its parameters is array of strings (char**). I don't know how can i call this function, because LV let me select only string, but not array of strings?
0 Kudos
Message 1 of 3
(2,967 Views)
Well, the array of strings is just an an array of pointers to strings, which in LabVIEW can be assumed to be just an array of 32 bit integers. The problem is that those string pointers have to map to valid places in memory. That means we need to generate valid string pointer in LabVIEW and build them into an array. There are two ways I know of to do this. One is to use the lstrcpy function from the kernel32.dll which copies a string into another and returns a pointer to the string if successful. You can also use a VI from the Pointer Utility Library to do the same thing:

http://zone.ni.com/devzone/explprog.nsf/webmain/C94071199E8F18AD86256B6400829E4E?opendocument&node=DZ52045_US

If the strings are inputs to the function, then you would insert th
e proper strings before calling the DLL function. If the array is an output, then you will have to make sure each of the strings is large enough for what will be put into it.

Alternatively, you can of course make a wrapper function for calling the DLL from LabVIEW.
0 Kudos
Message 2 of 3
(2,967 Views)
Nadav,
Did you figure out how to call an array of strings (char**)in LV from a dll? I am kind of stuck with the same problem.
I would appreciate your help.
Thanks
Nish
0 Kudos
Message 3 of 3
(2,967 Views)