Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Marshal.GetMethodInfoForComSlot Method

Retrieves a MemberInfo object for the specified virtual function table (v-table or VTBL) slot.

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)
public static MemberInfo GetMethodInfoForComSlot(
	Type t,
	int slot,
	ref ComMemberType memberType
)

Parameters

t
Type: System.Type

The type for which the MemberInfo is to be retrieved.

slot
Type: System.Int32

The VTBL slot.

memberType
Type: System.Runtime.InteropServices.ComMemberType

On successful return, one of the enumeration values that specifies the type of the member.

Return Value

Type: System.Reflection.MemberInfo
The object that represents the member at the specified VTBL slot.
ExceptionCondition
ArgumentException

t is not visible from COM.

The return value may be a FieldInfo, MethodInfo, or PropertyInfo object. The return value depends on the type of managed member that exists in the given COM slot (hence the generalized return type MemberInfo from which all three derive).

The zero-based slot number that is returned by this method accounts for three IUnknown and possibly four IDispatch methods, making the value of the first available slot either 3 or 7. GetMethodInfoForComSlot provides the opposite functionality of Marshal.GetComSlotForMethodInfo. You can use Marshal.GetEndComSlot and Marshal.GetStartComSlot in conjunction with GetMethodInfoForComSlot to pass slots within a specified range.

The memberType parameter is important only on return. It contains the type of the COM member (a regular method or a property accessor) that corresponds to the returned MemberInfo object.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library
  • SecurityCriticalAttribute 

    requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.