Marshal.GetIDispatchForObjectInContext(Object) 方法     
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
如果调用方与托管对象在同一上下文中,则从该对象返回一个 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 -> nativeintPublic Shared Function GetIDispatchForObjectInContext (o As Object) As IntPtr参数
- o
- Object
其 IDispatch 接口被请求的对象。
返回
nativeint
指定对象的 IDispatch 接口指针;如果调用方与指定对象不在同一上下文中,则为 null。
- 属性
例外
              o 不支持请求的接口。
              o 为 null。
注解
此方法与 相同 GetIDispatchForObject ,只是当调用方与 对象不在同一上下文中时,此方法返回 null 。