Freigeben über


IMetaDataImport::EnumMembersWithName Method

Enumerates MemberDef tokens representing members of the specified type with the specified name.

HRESULT EnumMembersWithName (
    HCORENUM    *phEnum, 
    mdTypeDef   cl, 
    LPCWSTR     szName, 
    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 with members to enumerate.

szName

[in] The member name that limits the scope of the enumerator.

rMembers

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

cMax

[in] The maximum size of the rMembers array.

pcTokens

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

Remarks

This method enumerates fields and methods, but not properties or events. Unlike IMetaDataImport::EnumMembers Method, EnumMembersWithName discards all field and member tokens that do not have the specified name.

Return Value

HRESULT Description

S_OK

EnumTypeDefs returned successfully.

S_FALSE

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

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