Next method

Gets the next items in the enumeration sequence.


HRESULT retVal = object.Next(cElt, rgElt, pcEltFetched);


  • cElt [in]
    Type: unsigned long

    An integer that specifies the number of items requested. The cElt parameter is a ULONG; therefore, you cannot pass a negative number to go backward.

  • rgElt [out]
    Type: [ITravelLogEntry](aa768475(v=vs.85).md)

    A pointer to an array of ITravelLogEntry interface pointers. The size of the array is determined by cElt. The number of valid pointers is determined by the value returned in pcEltFetched. The caller is responsible for allocating and freeing the rgElt array.

  • pcEltFetched [out]
    Type: unsigned long

    A pointer to an integer that receives the number of items supplied. This parameter can be set to NULL, if you do not have to know the number of elements retrieved.


When you reach the end of the enumeration, the cursor remains there. To return to the beginning of the enumeration, you must call IEnumTravelLogEntry::Reset.

If you request more elements than exist in the sequence between the current element and the end, the method gets the remaining elements and returns S_FALSE. The cursor stays at the end of the enumeration.