Class

# IEnumVARIANT

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

<span class="title-ref">IEnumVARIANT</span> provides methods for enumerating a collection of OLE VARIANTS. Most collections can also be iterated through a common API for Item and Count, but not all collections support this.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                          | Type                                        | Read-Only | Shared |
|-------------------------------|---------------------------------------------|-----------|--------|
| `Handle<ienumvariant.handle>` | `Ptr</api/data_types/additional_types/ptr>` |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                          | Parameters                                                                                                                                                                                                                          | Returns                                           | Shared |
|-----------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|--------|
| `AddRef<ienumvariant.addref>`                 |                                                                                                                                                                                                                                     | `UInt32</api/data_types/additional_types/uint32>` |        |
| `Clone<ienumvariant.clone>`                   | `ByRef</api/language/byref>` outEnum As `Ptr</api/data_types/additional_types/ptr>`                                                                                                                                                 | `Boolean</api/data_types/boolean>`                |        |
| `Constructor<ienumvariant.constructor0>`      | p As `Ptr</api/data_types/additional_types/ptr>`                                                                                                                                                                                    |                                                   |        |
| `Next_<ienumvariant.next_>`                   | celt As `UInt32</api/data_types/additional_types/uint32>`, `ByRef</api/language/byref>` rgVar As `Variant</api/data_types/variant>`, `ByRef</api/language/byref>` pCeltFetched As `UInt32</api/data_types/additional_types/uint32>` | `Integer</api/data_types/integer>`                |        |
| `QueryInterface<ienumvariant.queryinterface>` | riid As `Ptr</api/data_types/additional_types/ptr>`, `ByRef</api/language/byref>` out As `Ptr</api/data_types/additional_types/ptr>`                                                                                                | `Integer</api/data_types/integer>`                |        |
| `Release<ienumvariant.release>`               |                                                                                                                                                                                                                                     | `UInt32</api/data_types/additional_types/uint32>` |        |
| `Reset<ienumvariant.reset>`                   |                                                                                                                                                                                                                                     | `Boolean</api/data_types/boolean>`                |        |
| `Skip<ienumvariant.skip>`                     | numElements As `Integer</api/data_types/integer>`                                                                                                                                                                                   | `Boolean</api/data_types/boolean>`                |        |

## Property descriptions

<div id="ienumvariant.handle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Handle

**Handle** As `Ptr</api/data_types/additional_types/ptr>`

> Returns the raw IUnknown pointer.

## Method descriptions

<div id="ienumvariant.addref">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.AddRef

**AddRef** As `UInt32</api/data_types/additional_types/uint32>`

> Increments a reference count and returns the value of the reference count.

<div id="ienumvariant.clone">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Clone

**Clone**(`ByRef</api/language/byref>` outEnum As `Ptr</api/data_types/additional_types/ptr>`) As `Boolean</api/data_types/boolean>`

> Creates a copy of the current state of enumeration. Returns `True</api/language/true>` on success and assigns *outEnum* with the new enumerator, `False</api/language/false>` otherwise.

<div id="ienumvariant.constructor0">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Constructor

**Constructor**(p As `Ptr</api/data_types/additional_types/ptr>`)

> <div class="note">
>
> <div class="title">
>
> Note
>
> </div>
>
> `Constructors</api/language/constructor>` are special methods called when you create an object with the `New</api/language/new>` keyword and pass in the parameters above.
>
> </div>
>
> Creates a new IUnknown class from the supplied pointer. The constructor does not automatically add a reference count, but when the destructor is called a reference is released.

<div id="ienumvariant.next_">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

[IEnumVARIANT.Next]()

**Next\_**(celt As `UInt32</api/data_types/additional_types/uint32>`, `ByRef</api/language/byref>` rgVar As `Variant</api/data_types/variant>`, `ByRef</api/language/byref>` pCeltFetched As `UInt32</api/data_types/additional_types/uint32>`) As `Integer</api/data_types/integer>`

> Attempts to get the next "numElement" items in the enumeration sequence, and return them in "var". Returns `True</api/language/true>` if the number of elements returned matches "numElements", or False if the number of elements returned is less than "numElements"

<div id="ienumvariant.queryinterface">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.QueryInterface

**QueryInterface**(riid As `Ptr</api/data_types/additional_types/ptr>`, `ByRef</api/language/byref>` out As `Ptr</api/data_types/additional_types/ptr>`) As `Integer</api/data_types/integer>`

> Retrieves the address of a specified interface.
>
> The following automates Internet Explorer and queries for a specific interface (each interface is identified by a unique IID)
>
> ``` xojo
> Var ie As New OLEObject("InternetExplorer.Application")
> ie.Visible = True
> ie.Navigate("google.com")
>
> Var unk As New COM.IUnknown(ie.Handle)
>
> ' Query for the IID_IWebBrowser2 interface
> Var iid As MemoryBlock = COM.IIDFromString("{D30C1661-CDAF-11D0-8A3E-00C04FC9E26E}")
> Var out As Ptr
> If 0 = unk.QueryInterface(iid, out) Then
>    ' Yay this interface exists
>    Break
> End If
> ```

<div id="ienumvariant.release">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Release

**Release** As `UInt32</api/data_types/additional_types/uint32>`

> Decrements a reference count and returns the value of the reference count.

<div id="ienumvariant.reset">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Reset

**Reset** As `Boolean</api/data_types/boolean>`

> Resets the enumeration sequence to the beginning. Returns `True</api/language/true>` on success, `False</api/language/false>` on failure.

<div id="ienumvariant.skip">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

IEnumVARIANT.Skip

**Skip**(numElements As `Integer</api/data_types/integer>`) As `Boolean</api/data_types/boolean>`

> Skips over the next "numElements" in the enumeration sequence. Returns `True</api/language/true>` if successful, `False</api/language/false>` otherwise.

## Compatibility

|                       |                       |
|-----------------------|-----------------------|
| **Project Types**     | Console, Desktop, Web |
| **Operating Systems** | Windows               |

<div class="seealso">

`IUnknown</api/windows/iunknown>` parent class; `COM</api/windows/com>` module; `IUnknown</api/windows/iunknown>`, `IPicture</api/windows/ipicture>`.

</div>
