Partager via


IEnumVARIANT

This 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.

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.

Methods

The following table shows the methods for this interface in the order that the compiler calls the methods. Like all COM interfaces, this interface inherits the methods for the IUnknown interface.

Method Description
IEnumVARIANT::Next This method attempts to get the next celt items in the enumeration sequence, and return them through the array pointed to by rgVar.
IEnumVARIANT::Skip This method attempts to skip over the next celt elements in the enumeration sequence.
IEnumVARIANT::Reset This method resets the enumeration sequence to the beginning.
IEnumVARIANT::Clone This method creates a copy of the current state of enumeration.

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Oaidl.h, Oaidl.idl.
Link Library: Oleaut32.lib, Uuid.lib.

See Also

Automation Interfaces | IUnknown

Last updated on Wednesday, April 13, 2005

© 2005 Microsoft Corporation. All rights reserved.