CreateToastNotifierWithId method

Pointer<COMObject> CreateToastNotifierWithId(
  1. String applicationId
)

Implementation

Pointer<COMObject> CreateToastNotifierWithId(String applicationId) {
  final retValuePtr = calloc<COMObject>();
  final applicationIdHstring = convertToHString(applicationId);
  final hr = _thisPtr.ref.vtable
          .elementAt(7)
          .cast<
              Pointer<
                  NativeFunction<
                      HRESULT Function(Pointer, IntPtr applicationId,
                          Pointer<COMObject>)>>>()
          .value
          .asFunction<
              int Function(Pointer, int applicationId, Pointer<COMObject>)>()(
      _thisPtr.ref.lpVtbl, applicationIdHstring, retValuePtr);

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

  WindowsDeleteString(applicationIdHstring);
  return retValuePtr;
}