Marshal.GetComInterfaceForObject Method (Object, Type, CustomQueryInterfaceMode)
Returns a pointer to an IUnknown interface that represents the specified interface on the specified object. Custom query interface access is controlled by the specified customization mode.
Assembly: mscorlib (in mscorlib.dll)
[SecurityCriticalAttribute] public static IntPtr GetComInterfaceForObject( object o, Type T, CustomQueryInterfaceMode mode )
The object that provides the interface.
The type of interface that is requested.
One of the enumeration values that indicates whether to apply an IUnknown::QueryInterface customization that is supplied by an ICustomQueryInterface.
Return ValueType: System.IntPtr
The interface pointer that represents the interface for the object.
GetComInterfaceForObject(Object, Type) overload to apply query interface customization by default.lets you specify whether to apply query interface customization. Use the
requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.
Available since 8
Available since 4.0
Portable Class Library
Supported in: portable .NET platforms
Available since 8.1