getTypeInfo method

ITypeInfo? getTypeInfo(
  1. int iTInfo,
  2. int lcid
)

Retrieves the type information for an object, which can then be used to get the type information for an interface.

Throws a WindowsException on failure.

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

Implementation

ITypeInfo? getTypeInfo(int iTInfo, int lcid) {
  final ppTInfo = adaptiveCalloc<VTablePointer>();
  final hr$ = HRESULT(_GetTypeInfoFn(ptr, iTInfo, lcid, ppTInfo));
  if (hr$.isError) {
    free(ppTInfo);
    throw WindowsException(hr$);
  }
  final result$ = ppTInfo.value;
  free(ppTInfo);
  if (result$.isNull) return null;
  return .new(result$);
}