IMetaDataImport::EnumMembers method (rometadataapi.h)

Enumerates MemberDef tokens representing members of the specified type.


HRESULT EnumMembers(
  [in, out] HCORENUM   *phEnum,
  [in]      mdTypeDef  tkTypeDef,
  [out]     mdToken [] rgMembers,
  [in]      ULONG      cMax,
  [out]     ULONG      *pcTokens


[in, out] phEnum

A pointer to the enumerator.

[in] tkTypeDef

A TypeDef token representing the type whose members are to be enumerated.

[out] rgMembers

The array used to hold the MemberDef tokens.

[in] cMax

The maximum size of the rgMembers array.

[out] pcTokens

The actual number of MemberDef tokens returned in rgMembers.

Return value

HRESULT Description
S_OK EnumMembers returned successfully.
S_FALSE There are no MemberRef tokens to enumerate. In this case, pcTokens is 0 (zero).


When enumerating collections of members for a class, EnumMembers returns only members defined directly on the class. It does not return any members that the class inherits, even if the class provides an implementation for those inherited members. To enumerate inherited members, the caller must explicitly walk the inheritance chain. Note that the rules for the inheritance chain may vary depending on the language or compiler that emitted the original metadata.


Target Platform Windows
Header rometadataapi.h

See also