Share via


IEnumVARIANT (Compact 2013)

3/26/2014

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

Header

oaidl.h,
oaidl.idl

Library

oleaut32.lib,
uuid.lib

See Also

Reference

Automation Interfaces
IUnknown