RealProxy.SupportsInterface(Guid) Method

Definition

Requests a COM interface with the specified ID.

public virtual IntPtr SupportsInterface(ref Guid iid);

Parameters

iid
Guid

A reference to the requested interface.

Returns

IntPtr

A pointer to the requested interface.

Examples

public override IntPtr SupportsInterface(ref Guid myGuid)
{
    Console.WriteLine("SupportsInterface method called");
    // Object reference is requested for communication with unmanaged objects
    // in the current process through COM.
    IntPtr myIntPtr = this.GetCOMIUnknown(false);
    // Stores an unmanaged proxy of the object.
    this.SetCOMIUnknown(myIntPtr);
    // return COM Runtime Wrapper pointer.
    return myIntPtr;
}

Remarks

The SupportsInterface method allows the current proxy instance to implement additional COM interfaces on behalf of the server object that the current instance represents. The current method generates the requested interface and returns a pointer to it. The types of COM interfaces that can be generated by this method depend on the proxy type, which in turn might depend on the type of the server object that the current proxy instance represents.

For more information, see ProxyAttribute.

Applies to

Product Versions
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1