Possible bug in vtkStringArray

I recently moved from Activiz 6.3 to 9.3 and discovered possible bug in compiled vtkStringArray.
Here is the test
vtkStringArray stringArray = new vtkStringArray();
stringArray.SetValue(0, “alpha”);
stringArray.SetValue(1, “beta”);
stringArray.SetValue(2, “gamma”);


stringArray.GetValue(0) “”
stringArray.GetValue(1) “\u0001”
stringArray.GetValue(2) "\u0002

Please advise


@LucasGandel this one may be for you

1 Like

Yes, Lucas already responded directly to me and proposed temporary solution.

I confirm the latest Activiz versions have issues with methods returning a string from the unmanaged code. This has been addressed recently and will be fixed in the next Activiz release.

In the meantime, you can work around the issue using vtkVariant:
stringArray.GetVariantValue(0).ToStringWrapper(0, 6); // 0=DEFAULT_FORMATING, 6=precision