IEnumShellItems::Next method (shobjidl_core.h)

Gets an array of one or more IShellItem interfaces from the enumeration.

Syntax

HRESULT Next(
  [in]  ULONG      celt,
  [out] IShellItem **rgelt,
  [out] ULONG      *pceltFetched
);

Parameters

[in] celt

Type: ULONG

The number of elements in the array referenced by the rgelt parameter.

[out] rgelt

Type: IShellItem**

The address of an array of pointers to IShellItem interfaces that receive the enumerated item or items. The calling application is responsible for freeing the IShellItem interfaces by calling the IUnknown::Release method.

[out] pceltFetched

Type: ULONG*

A pointer to a value that receives the number of IShellItem interfaces successfully retrieved. The count can be smaller than the value specified in the celt parameter. This parameter can be NULL on entry only if celt is one, because in that case the method can only retrieve one item and return S_OK, or zero items and return S_FALSE.

Return value

Type: HRESULT

This method can return one of these values.

Return code Description
S_OK
if at least IShellItem interface was retrieved.
S_FALSE
if there are no more IShellItem interfaces in the enumeration.
Returns an error value if the function fails for any other reason.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)

See also

IEnumShellItems

IShellItem