Compartilhar via


Função CLRCreateInstance

Fornece a interface ICLRDebugging .

Sintaxe

HRESULT CLRCreateInstance (
    [in]  REFCLSID  clsid,
    [in]  REFIID     riid,
    [out] LPVOID  * ppInterface
);

Parâmetros

clsid
[in] Dá suporte apenas ao identificador de classe CLSID_CLRDebugging.

riid
[in] Dá suporte apenas aos identificadores de interface IID_ICLRDebugging.

ppInterface
[out] Uma instância de ICLRDebugging .

Valor de retorno

Esse método retorna os HRESULTs específicos a seguir, bem como erros HRESULT que indicam falha de método.

HRESULT Descrição
S_OK O método foi concluído com êxito.
E_POINTER ppInterface é nulo.

Observações

A tabela a seguir mostra as combinações com suporte para clsid e riid.

clsid riid
CLSID_CLRDebugging IID_ICLRDebugging

O código a seguir mostra como usar CLRCreateInstance para obter a interface:

#include <metahost.h>
#pragma comment(lib, "mscoree.lib")

ICLRDebugging      *pCLRDebugging   = NULL;
HRESULT hr;
hr = CLRCreateInstance (CLSID_CLRDebugging, IID_ICLRDebugging,
                    (LPVOID*)&pCLRDebugging);

Requisitos

Plataformas: Consulte sistemas operacionais com suporte do .NET.

Cabeçalho: dbgshim.h

Biblioteca: dbgshim.dll, libdbgshim.so, libdbgshim.dylib

Versões do .NET: Disponível desde o .NET Core 2.1