Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ICollectionOnSTLImpl Class

This class provides methods used by a collection class.

template < 
   class T, 
   class CollType, 
   class ItemType, 
   class CopyItem, 
   class EnumType 
> 
class ICollectionOnSTLImpl : 
   public T
T

A COM collection interface.

CollType

An STL container class.

ItemType

The type of item exposed by the container interface.

CopyItem

A copy policy class.

EnumType

A CComEnumOnSTL-compatible enumerator class.

Name

Description

ICollectionOnSTLImpl::get__NewEnum

Returns an enumerator object for the collection.

ICollectionOnSTLImpl::get_Count

Returns the number of elements in the collection.

ICollectionOnSTLImpl::get_Item

Returns the requested item from the collection.

This class provides the implementation for three methods of a collection interface: get_Count, get_Item, and get__NewEnum.

To use this class:

  • Define (or borrow) a collection interface that you wish to implement.

  • Derive your class from a specialization of ICollectionOnSTLImpl based on this collection interface.

  • Use your derived class to implement any methods from the collection interface not handled by ICollectionOnSTLImpl.

Note Note

If the collection interface is a dual interface, derive your class from IDispatchImpl, passing the ICollectionOnSTLImpl specialization as the first template parameter if you want ATL to provide the implementation of the IDispatch methods.

  • Add items to the m_coll member to populate the collection.

For more information and examples, see ATL Collections and Enumerators.

T

ICollectionOnSTLImpl

Header: atlcom.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.