System.Runtime.InteropServices.Marshal.GetComSlotForMethodInfo Method

Retrieves the virtual function table (v-table or VTBL) slot for a specified System.Reflection.MemberInfo type when that type is exposed to COM.

Syntax

public static int GetComSlotForMethodInfo (System.Reflection.MemberInfo m)

Parameters

m
An object that represents an interface method.

Returns

The VTBL slot m identifier when it is exposed to COM.

Remarks

The zero-based slot number returned by this method accounts for three tp://go.microsoft.com/fwlink/?LinkId=148003 and possibly four IDispatch methods, making the value of the first available slot either 3 or 7. Marshal.GetComSlotForMethodInfo(System.Reflection.MemberInfo) provides the opposite functionality of Marshal.GetMethodInfoForComSlot(Type, int, ComMemberType@).

You can use this method to retrieve slot numbers for members of interfaces that are not visible from COM and for members of private interfaces. The slot numbers returned correspond to the v-table numbers that would be reserved if the type was exposed to COM. COM-invisible members actually occupy a slot in an exposed v-table, even though the COM client cannot use the slot. You cannot use Marshal.GetComSlotForMethodInfo(System.Reflection.MemberInfo) on a class interface by passing System.Reflection.MemberInfo from a class. For additional information, see Introducing the Class Interface.

Requirements

Namespace: System.Runtime.InteropServices
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0