IEnumUnknown

This enumerator enumerates objects with the IUnknown interface. It can be used to enumerate through the objects in a component containing multiple objects. IEnumUnknown has the same methods as all enumerator interfaces: Next, Skip, Reset, and Clone. For general information on these methods, refer to IEnumXXXX.

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 IEnumUnknown through a call to IOleContainer::EnumObjects.

When to Implement

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

The prototypes of the methods are as follows:

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

QuickInfo

  Windows NT: Use version 3.1 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in objidl.h.

See Also

IOleContainer