warnerbrothers1
2 years agoNew Contributor
Is there any way to pass array of custom class objects from delphi to testcomplete?
I need to get an array (or TList, or something else) of custom class objects from a Delphi-method to TestComplete.
For example, there is a method in Delphi:
type TMyArray = array of TMyClass;
...
function GetArrayOfMyClass: TMyArray;
I need to get the result of the function in TesComplete (js):
let obj = Sys.Process...MyObj;
let myArray = obj.GetArrayOfMyClass();
, but on the last line I get an error
"An exception occurred: 0xC0000005; class: ; description: ''"
If I use TList instead of an array, then getting into TestComplete works without errors, but the result of the function is just a pointer to TList, without the ability to access its Items.
However, if in Delphi I declare an indexed property that returns a object of custom class, there is no problem getting the object into the testcomplete:
property Items[Index: Integer]: TMyClass read GetItem;
But this is not what I need, I need to get the entire array of objects in one call.
Is it possible to do this?