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

定義

擷取指定之虛擬函式表 (v-table 或 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 位置中的 Managed 成員類型 (因此這三個衍生) 的一般化傳回型 MemberInfo 別。

這個方法傳回的以零起始的插槽編號會考慮三 個 IUnknown ,而且可能有四個 IDispatch 方法,讓第一個可用位置的值可以是 3 或 7。 GetMethodInfoForComSlot 提供 的相反功能 Marshal.GetComSlotForMethodInfo 。 您可以使用 Marshal.GetEndComSlotMarshal.GetStartComSlot 搭配 GetMethodInfoForComSlot ,在指定的範圍內傳遞位置。

參數 memberType 只有在傳回時才重要。 它包含 COM 成員的類型, (對應至傳 MemberInfo 回物件的一般方法或屬性存取子) 。

適用於

另請參閱