I'm having a problem of not being able to use the CIN functions and therefore can't use the convenient resizing methods. I have tried to use NumericArrayResize to resize an array of strings, but it's not working correctly. Here's what I've tried most recently. I have tried many variations, so if you want to modify what I have posted, or just provide new code, please feel free.
typedef struct {
int32 dimSize;
LStrHandle elt[1];
} LStrHandleArray;
typedef LStrHandleArray **LStrHandleArrayHandle;
void someMethod(LStrHandleArrayHandle arrayOut) {
// attempting to write the string "asdf" in the first element in the array. (1D array)
int newSize = 1;
MgErr e = NumericArrayResize(uL, 1L, (UHandle*)&arr
ayOut, newSize);
(*arrayOut)->dimSize = newSize;
LStrHandle hdl = *(*arrayOut)->elt;
long str_size = strlen("asdf");
MgErr err = NumericArrayResize(uB, 1L,(UHandle *)&hdl, str_size);
LStrLen(*hdl) = str_size;
MoveBlock("asdf", LStrBuf(*hdl), str_size);
}
The code above doesn't result in crashing labview at any time. The string "asdf" is not copied though. And, after being able to copy one string I would like to extend this to many elements in a 1D array of strings.
Thanks!
Naveen