System.Runtime.InteropServi ...


.NET Framework Class Library
ICustomQueryInterface Interface

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

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

Namespace:  System.Runtime.InteropServices
Assembly:  mscorlib (in mscorlib.dll)
Syntax

Visual Basic (Declaration)
<ComVisibleAttribute(False)> _
Public Interface ICustomQueryInterface
Visual Basic (Usage)
Dim instance As ICustomQueryInterface
C#
[ComVisibleAttribute(false)]
public interface ICustomQueryInterface
Visual C++
[ComVisibleAttribute(false)]
public interface class ICustomQueryInterface
F#
[<ComVisibleAttribute(false)>]
type ICustomQueryInterface =  interface end
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.

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Version Information

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4
See Also

Reference

Page view tracker