Share via


IMetaDataImport::EnumMembers Method

Enumerates MemberDef tokens representing members of the specified type.

HRESULT EnumMembers ( 
    HCORENUM    *phEnum, 
    mdTypeDef   cl, 
    mdToken     rMembers[], 
    ULONG       cMax, 
    ULONG       *pcTokens
);

Parameters

Parameter Description

phEnum

[in, out] A pointer to the enumerator.

cl

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

rMembers

[out] The array used to hold the MemberDef tokens.

cMax

[in] The maximum size of the rMembers array.

pcTokens

[out] The actual number of MemberDef tokens returned in rMembers.

Return Value

HRESULT Description

S_OK

EnumMembers returned successfully.

S_FALSE

There are no MemberDef tokens to enumerate. In that case, pcTokens is zero.

Remarks

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.

Requirements

Platforms: Windows 2000, Windows XP, Windows Server 2003 family

Header: Cor.h

Library: Included as a resource in Mscoree.dll

.NET Framework Version: 2.0, 1.1, 1.0

See Also

Reference

IMetaDataImport Interface
IMetaDataImport2 Interface