Skip navigation links
JNA API 4.5.0
com.sun.jna.platform.win32.COM

Class IComEnumVariantIterator

  • All Implemented Interfaces:
    Closeable, AutoCloseable, Iterable<Variant.VARIANT>, Iterator<Variant.VARIANT>


    public class IComEnumVariantIterator
    extends Object
    implements Iterable<Variant.VARIANT>, Iterator<Variant.VARIANT>, Closeable
    Wrapper for an EnumVariant Iteration. The usecase is a for-loop in the style:
    
     // Aquire an IDispatch, that has a new NewEnum Property (DISPID_NEWENUM)
     for(VARIANT v: IComEnumVariantIterator.wrap(dispatch)) {
          // Work with the acquired Variant
          // ...
          // Finally free it
          OleAuto.INSTANCE.VariantClear(v);
     }
     

    The IComEnumVariantIterator iterator closes the enumeration it wraps after the enumeration is exhausted or when the iterator is GCed, whatever happens earlier.

JNA API 4.5.0

Copyright © 2007-2017 Timothy Wall. All Rights Reserved.