Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This enumerator enumerates objects with the IUnknowninterface. It can be used to enumerate through the objects in a component containing multiple objects. IEnumUnknownhas the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone.

When to Implement

You can implement this whenever you want a caller to be able to enumerate the objects contained in another object. You get a pointer to IEnumUnknownthrough a call to IOleContainer::EnumObjects.

When to Implement

Call the methods of IEnumUnknownto enumerate the objects in a compound document, when you get a pointer to the interface on the enumerator through a call to IOleContainer::EnumObjects.

Methods

The prototypes of the methods are as follows.

Copy Code
HRESULT Next(
  ULONG celt, 
  IUnknown** rgelt, 
  ULONG* pceltFetched 
);
HRESULT Skip(
  ULONG celt  
);
HRESULT Reset(void)
HRESULT Clone(
  IEnumUnknown** ppenum
);

Remarks

To determine whether the platform supports this interface, see Determining Supported COM APIs.

Requirements

Header objidl.h, objidl.idl
Library ole32.lib, uuid.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Windows Mobile Version 5.0 and later