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 method enumerates component monikers.

Syntax

HRESULT Enum( 
  BOOL 
fForward, 
  IEnumMoniker** 
ppenumMoniker
);

Parameters

fForward

[in] Boolean value that is set to TRUE to enumerate the monikers from left to right, or to FALSE to enumerate from right to left.

ppenumMoniker

[out] Address of IEnumMoniker* pointer variable that receives the interface pointer to the enumerator object for the moniker.

When successful, the implementation must call the IUnknown::AddRefmethod on the enumerator object.

It is the caller's responsibility to call the IUnknown::Releasemethod.

If an error occurs or if the moniker has no enumerable components, the implementation sets * ppenumMonikerto NULL.

Return Value

The method supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as S_OK, which indicates success. S_OK is returned even if the moniker does not provide an enumerator (if ppenumMonikerequals NULL).

Remarks

IMoniker::Enummust supply an IEnumMonikerpointer to an enumerator that can enumerate the components of a moniker.

For example, the implementation of the IMoniker::Enummethod for a generic composite moniker creates an enumerator that can determine the individual monikers that make up the composite, while the IMoniker::Enummethod for a file moniker creates an enumerator that returns monikers representing each of the components in the path.

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

Notes to Callers

Call this method to examine the components that make up a composite moniker.

Notes to Implementers

If the new moniker class has no discernible internal structure, your implementation of this method can simply return S_OK and set ppenumMonikerto NULL.

Requirements

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

See Also