3.1.4.5.2 Next (Opnum 4)

The Next method gets up to a specified number of items from the collection, if they are available, starting at the current enumerator position.

 [id(3), helpstring("method Next")] HRESULT Next(
   [in] ULONG cReqElem,
   [out, size_is(cReqElem), length_is(*cRetElem)] 
     IUnknown** ppInterface,
   [out] ULONG* cRetElem
 );

cReqElem: The number of elements requested by the client to return from the collection.

ppInterface: If the function returns a success HRESULT, this MUST contain an array of interface pointers of size cRetElem. Each element in the array MUST be either a DCOM object supporting the IEventClass2 interface if the underlying collection is of EventClasses or the element MUST be a DCOM object supporting IEventSubscription DCOM interface if the underlying collection is of subscriptions.

cRetElem: If the function returns a success HRESULT, this MUST contain a number of items returned in the array contained in ppInterface.

Return Values: An HRESULT specifying success or failure. All success codes other than S_FALSE MUST be treated the same, and all failure codes MUST be treated the same.

Return value/code

Description

0x00000001

S_FALSE

End of the collection.

When this method is invoked, the server MUST attempt to return items from the current position of the enumerator on the collection, and move the enumerator ahead in the collection by the value of cRetElem. If the number of elements in the collection is less than cReqElem, the function MUST return S_FALSE for failure.