Read array of strings from dotNet (CLR Bridge)
Hello,
I guess I miss something obvious:
I'm using TestComplete 12.31.1833.7. I use the CLR Bridge to call a .NET method which returns an array of strings.
The documentation says that "single-dimensional .NET arrays" have an OleValue property, which allows to access the array members. But how do I access the members? The debugger only gives me "undefined" values. To better diagnose the issue, I even hardcoded the members of the string array on the .NET side.
Do you have any ideas?
Thanks in advance!
Bernd
Hi Bernd,
Try the Array.Get method:
functions.Get(0)
Hello,
thank you for pointing me in the right direction! But that means, that the documentation is wrong:
Single-dimensional arrays have to be accessed without using OleValue and the array elements need to be addressed using Get(), as it is stated for multi-dimensional arrays.
This worked:
var justTrying = Config.myConfig.get_ArrayForTestComplete(); var first = justTrying.Get(0);
I guess, the documentation should be reviewed.
Thank you!
Bernd