getNumberAt method

double getNumberAt(
  1. int index
)

Implementation

double getNumberAt(int index) {
  final retValuePtr = calloc<Double>();

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

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

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