ADsBuildEnumerator

Builds an enumerator object for the specified Active Directory container object.

HRESULT ADsBuildEnumerator(
  IADsContainer * pADsContainer,  //The object to be enumerated
  IEnumVARIANT **ppEnumVariant  //Enumerator object
);
 

Parameters

pADsContainer
[in] Pointer to the IADsContainer interface on the object to be enumerated.
ppEnumVariant
[out] Indirect pointer to the IEnumVARIANT interface on the enumerator object created for the specified container object.

Return Values

This method supports the standard return values E_FAIL and E_UNEXPECTED, as well as the following:

S_OK
The enumerator object has been built successfully.

Remarks

The ADsBuildEnumerator helper function encapsulates the code required to create an enumerator object. It calls the IADsContainer::get__NewEnum method to create an enumerator object and then calls the QueryInterface method of IUnknown to get a pointer to the IEnumVARIANT interface for that object. The enumeration object is the Automation mechanism to enumerate over containers. Use ADsFreeEnumerator to release this enumerator object.

QuickInfo

  Windows NT: Use version 4.0 and later.
  Windows CE: Unsupported.

See Also

ADsEnumerateNext, ADsFreeEnumerator