Share via


CComEnumImpl Class

This class provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array.

template <
   class Base,
   const IID* piid,
   class T,
   class Copy
>
class ATL_NO_VTABLE CComEnumImpl : 
   public Base

Parameters

  • Base
    A COM enumerator (IEnumXXXX) interface.

  • piid
    A pointer to the interface ID of the enumerator interface.

  • T
    The type of item exposed by the enumerator interface.

  • Copy
    A homogeneous copy policy class.

Remarks

CComEnumImpl provides the implementation for a COM enumerator interface where the items being enumerated are stored in an array. This class is analogous to the IEnumOnSTLImpl class, which provides an implementation of an enumerator interface based on an STL container.

Note

For details on further differences between CComEnumImpl and IEnumOnSTLImpl, see CComEnumImpl::Init.

Typically, you will not need to create your own enumerator class by deriving from this interface implementation. If you want to use an ATL-supplied enumerator based on an array, it is more common to create an instance of CComEnum.

However, if you do need to provide a custom enumerator (for example, one that exposes interfaces in addition to the enumerator interface), you can derive from this class. In this situation, it is likely that you'll need to override the CComEnumImpl::Clone method to provide your own implementation.

For more information, see ATL Collections and Enumerators.

Requirements

Header: atlcom.h

See Also

Reference

IEnumOnSTLImpl Class

CComEnum Class

Other Resources

CComEnumImpl Members

ATL Class Overview