5.3 Enumerator Objects

Enumerator dependent objects are returned when the get__NewEnum() method is called on the IADsContainer, IADsMembers and IADsCollection interfaces. An enumerator supports the COM-defined IEnumVARIANT interface for the enumeration of a list of VARIANT elements.

By convention, all items in an enumeration in Active Directory must be of the same Automation data type (not to be confused with Active Directory object type). An enumeration should not return some items as VARIANTs of type VT_I4 and others as VARIANTs of type VT_BSTR.

The Active Directory helper functions ADsBuildEnumerator() and ADsEnumerateNext()can be used in C/C++ programs to simplify enumeration. See Appendix B, "C/C++ Helper Functions," for more details. For more information on the IEnumVARIANT interface, see the COM documentation.