Windows apps
Collapse the table of content
Expand the table of content

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.

IEnumVARIANT Methods



Creates a copy of the current state of enumeration.


Gets the next items in the enumeration sequence


Resets the enumeration sequence to the beginning.


Attempts to skip over the next celt elements in the enumeration sequence.

© 2017 Microsoft