getTypeInfoCount method

int getTypeInfoCount()

Retrieves the number of type information interfaces that an object provides (either 0 or 1).

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/oaidl/nf-oaidl-idispatch-gettypeinfocount.

Implementation

int getTypeInfoCount() {
  final pctinfo = adaptiveCalloc<Uint32>();
  final hr$ = HRESULT(_GetTypeInfoCountFn(ptr, pctinfo));
  if (hr$.isError) {
    free(pctinfo);
    throw WindowsException(hr$);
  }
  final result$ = pctinfo.value;
  free(pctinfo);
  return result$;
}