Freigeben über


IEnumOnSTLImpl::Init

Initializes the enumerator.

HRESULT Init(
   IUnknown* pUnkForRelease,
   CollType& collection 
);

Parameters

  • pUnkForRelease
    [in] The IUnknown pointer of an object that must be kept alive during the lifetime of the enumerator. Pass NULL if no such object exists.

  • collection
    A reference to the STL container that holds the items to be enumerated.

Return Value

A standard HRESULT value.

Remarks

If you pass Init a reference to a collection held in another object, you can use the pUnkForRelease parameter to ensure that the object, and the collection it holds, is available for as long as the enumerator needs it.

You must call this method before passing a pointer to the enumerator interface back to any clients.

Requirements

Header: atlcom.h

See Also

Concepts

IEnumOnSTLImpl Class

IEnumOnSTLImpl Members