The LStrHandle data type is composed of two parts:
4 byte containing the length of the string
Array of characters representing the string with no terminating character. You need to allocate a new string handle for each element you wish to add to the array, not only initialize the array handle itself.
Once you make sure you've initialized the string structure correctly using the labview memory manager functions ( using malloc() wont work) , you could try something like this.
strncpy((*yourLVStringHandle)->str, "mystring", strlen("mystring") );
(*yourLVStringHandle)->len = strlen("mystring");
Refer to the using External Code in
LV more information on the memory manager functions.
So create your string one at a time, and then add it to your array structure. Watch out for funky pointer math, since the array handle is a pointer to a pointer to a structure, and your LV string handle is also a pointer to a pointer to a struct.
I hope this helps.
Bilal Durrani
NI
Bilal Durrani
NI