IMetaDataImport::EnumMembersWithName Method

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

HRESULT EnumMembersWithName (
   [in, out] HCORENUM    *phEnum, 
   [in]      mdTypeDef   cl, 
   [in]      LPCWSTR     szName, 
   [out]     mdToken     rMembers[], 
   [in]      ULONG       cMax, 
   [out]     ULONG       *pcTokens
);

Parameters

  • 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, 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: See .NET Framework System Requirements.

Header: Cor.h

Library: Included as a resource in MsCorEE.dll

.NET Framework Versions: 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0, 1.1, 1.0

See Also

Reference

IMetaDataImport Interface

IMetaDataImport2 Interface