getTemplateContent method

Pointer<COMObject> getTemplateContent(
  1. ToastTemplateType type
)

Implementation

Pointer<COMObject> getTemplateContent(ToastTemplateType type) {
  final retValuePtr = calloc<COMObject>();

  final hr = ptr.ref.vtable
          .elementAt(8)
          .cast<
              Pointer<
                  NativeFunction<
                      HRESULT Function(
                          Pointer, Int32 type, Pointer<COMObject>)>>>()
          .value
          .asFunction<int Function(Pointer, int type, Pointer<COMObject>)>()(
      ptr.ref.lpVtbl, type.value, retValuePtr);

  if (FAILED(hr)) {
    free(retValuePtr);
    throw WindowsException(hr);
  }

  return retValuePtr;
}