IOleContainer::EnumObjects method

Enumerates the objects in the current container.

Syntax

HRESULT EnumObjects(
  DWORD        grfFlags,
  IEnumUnknown **ppenum
);

Parameters

grfFlags

Specifies which objects in a container are to be enumerated, as defined in the enumeration OLECONTF.

ppenum

A pointer to an IEnumUnknown pointer variable that receives the interface pointer to the enumerator object. Each time a container receives a successful call to EnumObjects, it must increase the reference count on the ppenum pointer the method returns. It is the caller's responsibility to call IUnknown::Release when it is done with the pointer. If an error is returned, the implementation must set ppenum to NULL.

Return Value

This method returns S_OK on success. Other possible return values include the following.

Return code Description
E_FAIL
The operation failed.
E_NOTIMPL
Object enumeration not supported.

Remarks

A container should implement EnumObjects to enable programmatic clients to find out what objects it holds. This method, however, is not called in standard linking scenarios.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header oleidl.h

See Also

IEnumUnknown

IOleContainer

IOleItemContainer

OLECONTF