ICustomQueryInterface Interface

Definition

Caution

ICustomQueryInterface may be unavailable in future releases.

Enables developers to provide a custom, managed implementation of the IUnknown::QueryInterface(REFIID riid, void **ppvObject) method.

[System.Obsolete("ICustomQueryInterface may be unavailable in future releases.")]
public interface ICustomQueryInterface
public interface ICustomQueryInterface
[System.Runtime.InteropServices.ComVisible(false)]
public interface ICustomQueryInterface
Attributes

Remarks

This class permits advanced users to provide a customized managed implementation of the QueryInterface method.

Managed and native applications can use the customized implementation to return a specific interface for a specified interface ID, except for IID_IUnknown. That is, when QueryInterface is called, it will ignore custom implementations if its riid parameter is set to IID_IUnknown. However, you may still return IUnknown as the ppvObject.

Developers can provide custom implementations for all interfaces (except for IUnknown) if they define and implement a valid corresponding interface.

A valid user-defined interface has a v-table layout that matches the unmanaged COM interface exactly, and its InterfaceTypeAttribute is InterfaceIsIUnknown.

Methods

GetInterface(Guid, IntPtr)

Returns an interface according to a specified interface ID.

Applies to

Product Versions (Obsolete)
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9 (Core 1.0, Core 1.1)
.NET Framework 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
.NET Standard 1.1, 2.0, 2.1 (1.2, 1.3, 1.4, 1.5, 1.6)
UWP (10.0)