Compartilhar via


Método ICustomQueryInterface.GetInterface (Guid, IntPtr)

 

Dica

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Retorna uma interface de acordo com uma ID de interface especificada.

Namespace:   System.Runtime.InteropServices
Assembly:  mscorlib (em mscorlib.dll)

Sintaxe

[SecurityCriticalAttribute]
CustomQueryInterfaceResult GetInterface(
    [InAttribute] ref Guid iid,
    out IntPtr ppv
)
[SecurityCriticalAttribute]
CustomQueryInterfaceResult GetInterface(
    [InAttribute] Guid% iid,
    [OutAttribute] IntPtr% ppv
)
[<SecurityCriticalAttribute>]
abstract GetInterface : 
        iid:Guid byref *
        ppv:nativeint byref -> CustomQueryInterfaceResult
<SecurityCriticalAttribute>
Function GetInterface (
    <InAttribute> ByRef iid As Guid,
    <OutAttribute> ByRef ppv As IntPtr
) As CustomQueryInterfaceResult

Parâmetros

  • iid
    Type: System.Guid

    O GUID da interface solicitada.

  • ppv
    Type: System.IntPtr

    Uma referência à interface solicitada, quando esse método é retornado.

Valor Retornado

Type: System.Runtime.InteropServices.CustomQueryInterfaceResult

Um dos valores de enumeração que indica se uma implementação personalizada de IUnknown::QueryInterface foi usado.

Comentários

Um aplicativo pode usar código gerenciado para especificar sua própria implementação de interfaces personalizados e do tempo de execução padrão.

O CustomQueryInterfaceResult retornar o valor pode ser usado para habilitar ou desabilitar implementações personalizadas mostrando ou ocultando interfaces específicas durante o acesso de COM.

Esse método é invisível para COM.

Segurança

SecurityCriticalAttribute

requires full trust for the immediate caller. This member cannot be used by partially trusted or transparent code.

Informações de Versão

Plataforma Universal do Windows
Disponível desde 8
.NET Framework
Disponível desde 4.0
Biblioteca de Classes Portátil
Com suporte no: plataformas portáteis do .NET
Windows Phone Silverlight
Disponível desde 8.0
Windows Phone
Disponível desde 8.1

Confira Também

Interface ICustomQueryInterface
Namespace System.Runtime.InteropServices

Retornar ao início