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.
At a Glance
Header file: | Oaidl.h |
Windows CE versions: | 2.0 and later |
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.
Method | Description |
IEnumVARIANT::Clone | Creates a copy of the current state of enumeration. |
IEnumVARIANT::Next | Attempts to get the next celt items in the enumeration sequence, and return them through the array pointed to by rgVar. |
IEnumVARIANT::Reset | Resets the enumeration sequence to the beginning. |
IEnumVARIANT::Skip | Attempts to skip over the next celt elements in the enumeration sequence. |