The following is how I do it in C++, and I think it may help you. I haven't test this code, so I can't guarantee it works (You may need to play a little bit with it)
Try to use the functions NumericArrayResize(), LStrLen() and MoveBlock(), defined in LabVIEW. You may need to include the file "extcode.h", which should be included in the cintools directory of LabVIEW. Then:
// resize errOut->source LV string to accomodate GetRS232ErrorString(result)
NumericArrayResize(uB, 1L,(UHandle *)&(errOut->source), strlen(GetRS232ErrorString(result)));
// update the length of the errOut->source LV string
LStrLen(*(errOut->source))=strlen(GetRS232ErrorString(result));
// move strlen(GetRS232ErrorString(result)) bytes
// from GetRS232ErrorString(result) to errOut->source LV s
tring
MoveBlock(GetRS232ErrorString(result), LStrBuf(*(errOut->source)), strlen(GetRS232ErrorString(result)));
I hope this help.
Best regards;
Vargas
www.vartortech.com