Marshal.GetEndComSlot(Type) Method

Definition

Retrieves the last slot in the virtual function table (v-table or VTBL) of a type when exposed to COM.

C#
[System.Runtime.Versioning.SupportedOSPlatform("windows")]
public static int GetEndComSlot(Type t);
C#
public static int GetEndComSlot(Type t);
C#
[System.Security.SecurityCritical]
public static int GetEndComSlot(Type t);

Parameters

t
Type

A type that represents an interface or class.

Returns

The last VTBL slot of the interface when exposed to COM. If the t parameter is a class, the returned VTBL slot is the last slot in the interface that is generated from the class.

Attributes

Remarks

This method returns the zero-based, v-table number for an interface or a class. When used on a class, the slot number returned refers to the class interface for the class. If the class interface is auto-dispatch, this method always returns -1 to indicate that the dispatch-only interface does not expose a v-table to managed clients. You can use GetEndComSlot and Marshal.GetStartComSlot in conjunction with Marshal.GetMethodInfoForComSlot to pass slots within a specified range. For additional information, see Introducing the class interface.

Applies to

Product Versions
.NET Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also