combineUri method

Uri? combineUri(
  1. String relativeUri
)

Implementation

Uri? combineUri(String relativeUri) {
  final instance = calloc<COMObject>();

  final hr =
      ptr.ref.vtable
              .elementAt(22)
              .cast<
                  Pointer<
                      NativeFunction<
                          HRESULT Function(
                              VTablePointer lpVtbl,
                              IntPtr relativeUri,
                              Pointer<COMObject> instance)>>>()
              .value
              .asFunction<
                  int Function(VTablePointer lpVtbl, int relativeUri,
                      Pointer<COMObject> instance)>()(
          ptr.ref.lpVtbl, relativeUri.toHString(), instance);

  if (FAILED(hr)) {
    free(instance);
    throwWindowsException(hr);
  }

  if (instance.isNull) {
    free(instance);
    return null;
  }

  return Uri.fromPtr(instance);
}