size property

int size

Gets the number of items in the map.

Implementation

int get size {
  final retValuePtr = calloc<Uint32>();

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

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

    return retValuePtr.value;
  } finally {
    free(retValuePtr);
  }
}