Marshal.GetMethodInfoForComSlot(Type, Int32, ComMemberType) 方法

定义

检索指定的虚拟功能表(v 表或 VTBL)槽的 MemberInfo 对象。

public:
 static System::Reflection::MemberInfo ^ GetMethodInfoForComSlot(Type ^ t, int slot, System::Runtime::InteropServices::ComMemberType % memberType);
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref System.Runtime.InteropServices.ComMemberType memberType);
[System.Security.SecurityCritical]
public static System.Reflection.MemberInfo GetMethodInfoForComSlot (Type t, int slot, ref System.Runtime.InteropServices.ComMemberType memberType);
static member GetMethodInfoForComSlot : Type * int * ComMemberType -> System.Reflection.MemberInfo
[<System.Security.SecurityCritical>]
static member GetMethodInfoForComSlot : Type * int * ComMemberType -> System.Reflection.MemberInfo
Public Shared Function GetMethodInfoForComSlot (t As Type, slot As Integer, ByRef memberType As ComMemberType) As MemberInfo

参数

t
Type

要检索的 MemberInfo 的类型。

slot
Int32

VTBL 槽。

memberType
ComMemberType

在成功返回时,为指定成员类型的枚举值之一。

返回

表示指定 VTBL 槽上成员的对象。

属性

例外

t 在 COM 中不可见。

注解

返回值可以是 FieldInfoMethodInfoPropertyInfo 对象。 返回值取决于给定 COM 槽中存在的托管成员的类型, (因此所有三个都派生) 的通用返回类型 MemberInfo

此方法返回的从零开始的槽号占 3 个 IUnknown 和可能四个 IDispatch 方法,因此第一个可用槽的值为 3 或 7。 GetMethodInfoForComSlot 提供 相反的功能 Marshal.GetComSlotForMethodInfo。 可以将 Marshal.GetEndComSlotMarshal.GetStartComSlot 与 结合使用 GetMethodInfoForComSlot 来传递指定范围内的槽。

参数 memberType 仅在返回时很重要。 它包含 COM 成员的类型 (与返回 MemberInfo 的对象相对应的常规方法或属性访问器) 。

适用于

另请参阅