FormatWithOutputFormat method

String FormatWithOutputFormat(
  1. Pointer<COMObject> number,
  2. int numberFormat
)

Implementation

String FormatWithOutputFormat(Pointer<COMObject> number, int numberFormat) {
  final retValuePtr = calloc<HSTRING>();

  try {
    final hr = _thisPtr.ref.vtable
            .elementAt(7)
            .cast<
                Pointer<
                    NativeFunction<
                        HRESULT Function(Pointer, Pointer<COMObject> number,
                            Int32 numberFormat, Pointer<IntPtr>)>>>()
            .value
            .asFunction<
                int Function(Pointer, Pointer<COMObject> number,
                    int numberFormat, Pointer<IntPtr>)>()(_thisPtr.ref.lpVtbl,
        number.cast<Pointer<COMObject>>().value, numberFormat, retValuePtr);

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

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