getNamedNumber method

double getNamedNumber(
  1. String name
)

Implementation

double getNamedNumber(String name) {
  final retValuePtr = calloc<Double>();
  final nameHstring = convertToHString(name);

  try {
    final hr = ptr.ref.vtable
            .elementAt(11)
            .cast<
                Pointer<
                    NativeFunction<
                        HRESULT Function(
                            Pointer, IntPtr name, Pointer<Double>)>>>()
            .value
            .asFunction<int Function(Pointer, int name, Pointer<Double>)>()(
        ptr.ref.lpVtbl, nameHstring, retValuePtr);

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

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