check method

IEnumSpellingError? check(
  1. PCWSTR text
)

Checks the spelling of the supplied text and returns a collection of spelling errors.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/spellcheck/nf-spellcheck-ispellchecker-check.

Implementation

IEnumSpellingError? check(PCWSTR text) {
  final value = adaptiveCalloc<VTablePointer>();
  final hr$ = HRESULT(_CheckFn(ptr, text, value));
  if (hr$.isError) {
    free(value);
    throw WindowsException(hr$);
  }
  final result$ = value.value;
  free(value);
  if (result$.isNull) return null;
  return .new(result$);
}