Hello, I’m trying to convert a PV array to an enumeration array using the example code that RemObject provided. But I have a SafeArrayRankMismatchException on the C # side
function MarketStatusDtoArrayAsSafeArray(Arr: ArrayOfMarketStatusDto): PVarArray;
var
pvData: PByteArray;
Bounds: TVarArrayBoundArray;
begin
Bounds[0].LowBound:=0;
Bounds[0].ElementCount:=Length(Arr);
Result := SafeArrayCreate(varByte, 1, Bounds);
SafeArrayAccessData(Result, Pointer(pvData));
Move(Arr[0], pvData[0], Length(Arr));
end;