4.7.1 IEnumVARIANT Next() Example

The following diagram illustrates a call to IEnumVARIANT::Next for a server that manages a collection of seven elements. Before the call, the current position is 2. The call to Next(), requesting two elements, causes the current position to be updated to 4, and results in the return by the server to the client of elements with indices 2 and 3. The server also indicates that it filled two elements by setting *pCeltFetched to 2, and returning 0 as the HRESULT.

Call to IEnumVARIANT::Next

Figure 9: Call to IEnumVARIANT::Next

The following diagram illustrates a call to IEnumVARIANT::Next for a server that manages a collection of seven elements. Before the call, the current position is 3. The call to Next(), requesting seven elements, causes the current position to be updated to 7, and results in the return by the server to the client of elements with indices 3, 4, 5, and 6. The server also indicates that it filled only four elements by setting *pCeltFetched to 4, and returning 1 as the HRESULT.

Call to IEnumVARIANT::Next

Figure 10: Call to IEnumVARIANT::Next