Expand Minimize
This topic has not yet been rated - Rate this topic

Marshal.GetStartComSlot Method

Gets the first slot in the virtual function table (VTBL) that contains user defined methods.

[Visual Basic]
Public Shared Function GetStartComSlot( _
   ByVal t As Type _
) As Integer
[C#]
public static int GetStartComSlot(
 Type t
);
[C++]
public: static int GetStartComSlot(
 Type* t
);
[JScript]
public static function GetStartComSlot(
   t : Type
) : int;

Parameters

t
A Type representing an interface.

Return Value

The first VTBL (also called v-table) slot that contains user defined methods. The first slot is 3 if the interface is IUnknown based, and 7 if the interface is IDispatch based.

Exceptions

Exception Type Condition
ArgumentException t is not visible from COM.

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 GetStartComSlot and Marshal.GetEndComSlot in conjunction with Marshal.GetMethodInfoForComSlot to pass slots within a specified range. For additional information on class interfaces, see Introducing the Class Interface.

Note   This method uses SecurityAction.LinkDemand to prevent it from being called from untrusted code; only the immediate caller is required to have SecurityPermissionAttribute.UnmanagedCode permission. If your code can be called from partially trusted code, do not pass user input to Marshal class methods without validation. For important limitations on using the LinkDemand member, see Demand vs. LinkDemand.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Marshal Class | Marshal Members | System.Runtime.InteropServices Namespace | Marshal.GetEndComSlot | Marshal.GetMethodInfoForComSlot

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.