getObjectAt method
Implementation
JsonObject getObjectAt(int index) {
final retValuePtr = calloc<COMObject>();
final hr = ptr.ref.vtable
.elementAt(6)
.cast<
Pointer<
NativeFunction<
HRESULT Function(
Pointer, Uint32 index, Pointer<COMObject>)>>>()
.value
.asFunction<int Function(Pointer, int index, Pointer<COMObject>)>()(
ptr.ref.lpVtbl, index, retValuePtr);
if (FAILED(hr)) {
free(retValuePtr);
throw WindowsException(hr);
}
return JsonObject.fromRawPointer(retValuePtr);
}