ADsEnumerateNext function

The ADsEnumerateNext function enumerates through a specified number of elements from the current cursor position of the enumerator. When the operation succeeds, the function returns the enumerated set of elements in a variant array. The number of returned elements can be smaller than the specified number.

Syntax


HRESULT ADsEnumerateNext(
  _In_  IEnumVARIANT *pEnumVariant,
  _In_  ULONG        cElements,
  _Out_ VARIANT      *pvar,
  _Out_ ULONG        *pcElementsFetched
);

Parameters

pEnumVariant [in]

Type: IEnumVARIANT*

Pointer to the IEnumVARIANT interface on the enumerator object.

cElements [in]

Type: ULONG

Number of elements requested.

pvar [out]

Type: VARIANT*

Pointer to the array of elements retrieved.

pcElementsFetched [out]

Type: ULONG*

Actual number of elements retrieved, which can be smaller than the number of elements requested.

Return value

Type: HRESULT

This method supports the standard return values.

For more information about other return values, see ADSI Error Codes.

S_OK

The variant array populated successfully and the number of items returned is the same as those requested (cElement = *pcElementFetched).

S_FALSE

The call succeeded, but the number of items returned is less than those requested.

Remarks

The general process to enumerate objects in a container involves the following:

First, create an enumerator object on that container.

Second, retrieve the IEnumVARIANT interface pointer.

Third, call the ADsEnumerateNext function to return an enumerated set of elements from the enumerator object.

Fourth, call the ADSFreeEnumerator function to free the enumerator object.

For more information and a code example, see the ADsBuildEnumerator topic.

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Adshlp.h

Library

Activeds.lib

DLL

Activeds.dll

See also

ADSI Error Codes
ADSI Functions
ADsBuildEnumerator
ADsFreeEnumerator
FreeADsMem
IEnumVARIANT

 

 

Show: