# IMoniker::Enum

Supplies a pointer to an enumerator that can enumerate the components of a composite moniker.

HRESULT Enum(

BOOL fForward, | //Specifies direction of enumeration
IEnumMoniker **ppenumMoniker | //Indirect pointer to the IEnumMoniker pointer
); |

Parameters

fForward
  [in] If TRUE, enumerates the monikers from left to right. If FALSE, enumerates from right to left.
ppenumMoniker
  [out] When successful, indirect pointer to an IEnumMoniker enumerator on this moniker. In this case, the implementation must call IUnknown::AddRef on the parameter. It is the caller’s responsibility to call IUnknown::Release. If an error occurs or if the moniker has no enumerable components, the implementation sets ppenumMoniker to NULL.

Return Values

The method supports the standard return values E_OUTOFMEMORY and E_UNEXPECTED, as well as the following:

S_OK
  Indicates success. This value is returned even if the moniker does not provide an enumerator (if ppenumMoniker equals NULL).

Remarks

IMoniker::Enum must supply an IEnumMoniker pointer to an enumerator that can enumerate the components of a moniker. For example, the implementation of the IMoniker::Enum method for a generic composite moniker creates an enumerator that can determine the individual monikers that make up the composite, while the IMoniker::Enum method for a file moniker creates an enumerator that returns monikers representing each of the components in the path.

#### 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 ppenumMoniker to NULL.

See Also

IEnumXXXX