07-13-2023 07:24 AM
I am trying to process a cluster of strings,
case: take two strings from a cluster or array and add them and return a single string using DLL
hear are some screenshots of my dll
my cpp file:
my header file:
my labview VI with input and outputs:
Any hint of what might solve this problem will be appreciated.
07-13-2023 07:39 AM - edited 07-13-2023 07:42 AM
LabVIEW strings are NOT C string pointers but LabVIEW handles. When you pass them inside a cluster there is no option to change that. When you pass them individually as parameters you can configure the parameter in the Call Library Node to pass a compatible C string pointer to the DLL function.
Therefore the easy solution is to forget the cluster and pass the 2 strings as separate, correctly configured parameters. If you want to pass a structure, why?, you have to treat the strings in your C code as LabVIEW strings! And use the correct LabVIEW memory management functions when wanting to create, resize or deallocate them!