HRESULT Init( IUnknown* pUnkForRelease, CollType& collection );
Return Value
A standard HRESULT value.
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.
Remarks
You must call this method before passing a pointer to the enumerator interface back to any clients.
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.