IEnumVARIANT Interface

The IEnumVARIANT interface provides a method for enumerating a collection of variants, including heterogeneous collections of objects and intrinsic types. Callers of this interface do not need to know the specific type (or types) of the elements in the collection.

Implemented by Used by Header file name
Applications that expose collections of objects Applications that access collections of objects Oleauto.h (32-bit systems)

Dispatch.h (16-bit systems)


The following is the definition that results from expanding the parameterized type IEnumVARIANT:

interface IEnumVARIANT : IUnknown { 
    virtual HRESULT Next(unsigned long celt, 
                    VARIANT FAR* rgvar, 
                    unsigned long FAR* pceltFetched) = 0;
    virtual HRESULT Skip(unsigned long celt) = 0;
    virtual HRESULT Reset() = 0;
    virtual HRESULT Clone(IEnumVARIANT FAR* FAR* ppenum) = 0;
    };

To see how to implement a collection of objects using IEnumVARIANT, refer to the file Enumvar.cpp in the Lines sample code.