Marshal.GetComInterfaceForObjectInContext(Object, Type) 메서드

정의

호출자가 해당 개체와 동일한 컨텍스트에 있는 경우 개체에 대해 지정된 인터페이스를 나타내는 인터페이스 포인터를 반환합니다.

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

매개 변수

o
Object

인터페이스를 제공하는 개체입니다.

t
Type

요청된 인터페이스의 형식입니다.

반품

IntPtr

nativeint

지정된 t 개체의 인터페이스를 나타내는 인터페이스 포인터 또는 null 호출자가 개체와 동일한 컨텍스트에 있지 않은 경우 지정한 인터페이스 포인터입니다.

특성

예외

t 가 인터페이스가 아닌 경우

-또는-

형식이 COM에 표시되지 않습니다.

o 는 요청된 인터페이스를 지원하지 않습니다.

onull입니다.

-또는-

tnull입니다.

설명

이 메서드는 호출자가 개체와 GetComInterfaceForObject 동일한 컨텍스트에 있지 않은 경우 반환 null 한다는 점을 제외하고 동일합니다. 인터페이스 포인터를 전달해야 하는 관리되지 않는 메서드가 있는 경우 특히 유용합니다.

적용 대상

추가 정보