Marshal.GetEndComSlot(Type) 方法

定義

擷取公開給 COM 時,類型在虛擬函式表 (v-table 或 VTBL) 中的最後一個位置。

public:
 static int GetEndComSlot(Type ^ t);
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static int GetEndComSlot (Type t);
public static int GetEndComSlot (Type t);
[System.Security.SecurityCritical]
public static int GetEndComSlot (Type t);
[<System.Runtime.Versioning.SupportedOSPlatform("windows")>]
static member GetEndComSlot : Type -> int
static member GetEndComSlot : Type -> int
[<System.Security.SecurityCritical>]
static member GetEndComSlot : Type -> int
Public Shared Function GetEndComSlot (t As Type) As Integer

參數

t
Type

表示介面或類別的類型。

傳回

Int32

公開給 COM 時介面的最後一個 VTBL 位置。 如果 t 參數為類別,傳回的 VTBL 位置是自類別所產生介面中的最後位置。

屬性

備註

這個方法會傳回介面或類別之以零起始的 v 資料表編號。 在類別上使用時,傳回的插槽編號會參考 類別的類別介面。 如果類別介面是自動分派,這個方法一律會傳回 -1,表示僅分派介面不會向受控用戶端公開 v 資料表。 您可以使用 GetEndComSlotMarshal.GetStartComSlot 搭配 Marshal.GetMethodInfoForComSlot 來傳遞指定範圍內的位置。 如需詳細資訊,請參閱 類別介面簡介

適用於

另請參閱