getResults method

IShellItemArray? getResults()

Gets the user's choices in a dialog that allows multiple selection.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifileopendialog-getresults.

Implementation

IShellItemArray? getResults() {
  final ppenum = adaptiveCalloc<VTablePointer>();
  final hr$ = HRESULT(_GetResultsFn(ptr, ppenum));
  if (hr$.isError) {
    free(ppenum);
    throw WindowsException(hr$);
  }
  final result$ = ppenum.value;
  free(ppenum);
  if (result$.isNull) return null;
  return .new(result$);
}