getBooleanAt method

bool getBooleanAt(
  1. int index
)

Implementation

bool getBooleanAt(int index) {
  final retValuePtr = calloc<Bool>();

  try {
    final hr = ptr.ref.vtable
            .elementAt(10)
            .cast<
                Pointer<
                    NativeFunction<
                        HRESULT Function(
                            Pointer, Uint32 index, Pointer<Bool>)>>>()
            .value
            .asFunction<int Function(Pointer, int index, Pointer<Bool>)>()(
        ptr.ref.lpVtbl, index, retValuePtr);

    if (FAILED(hr)) throw WindowsException(hr);

    final retValue = retValuePtr.value;
    return retValue;
  } finally {
    free(retValuePtr);
  }
}