secondAsPaddedString method

String secondAsPaddedString(
  1. int minDigits
)

Implementation

String secondAsPaddedString(int minDigits) {
  final retValuePtr = calloc<HSTRING>();

  try {
    final hr = ptr.ref.vtable
            .elementAt(87)
            .cast<
                Pointer<
                    NativeFunction<
                        HRESULT Function(
                            Pointer, Int32 minDigits, Pointer<IntPtr>)>>>()
            .value
            .asFunction<
                int Function(Pointer, int minDigits, Pointer<IntPtr>)>()(
        ptr.ref.lpVtbl, minDigits, retValuePtr);

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

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