Marshal.GetIDispatchForObjectInContext(Object) 方法

定义

如果调用方与该对象位于同一上下文中,则从托管对象返回 IDispatch 接口指针。

public:
 static IntPtr GetIDispatchForObjectInContext(System::Object ^ o);
public static IntPtr GetIDispatchForObjectInContext(object o);
[System.Security.SecurityCritical]
public static IntPtr GetIDispatchForObjectInContext(object o);
static member GetIDispatchForObjectInContext : obj -> nativeint
[<System.Security.SecurityCritical>]
static member GetIDispatchForObjectInContext : obj -> nativeint
Public Shared Function GetIDispatchForObjectInContext (o As Object) As IntPtr

参数

o
Object

请求其 IDispatch 接口的对象。

返回

IntPtr

nativeint

IDispatch指定对象的接口指针,或者null调用方与指定对象不在同一上下文中。

属性

例外

o 不支持请求的接口。

onull

注解

此方法与在调用方与对象不在同一上下文中时返回GetIDispatchForObject的方法相同null

适用于

另请参阅