IDebugComPlusSymbolProvider::CreateTypeFromPrimitive

Belirtilen ilkel türden bir tür oluşturur.

Sözdizimi

int CreateTypeFromPrimitive(
    uint          dwPrimType,
    IDebugAddress pAddress,
    IDebugField   ppType
);

Parametreler

dwPrimType
[in] Temel türü temsil eden CorElementType Sabit Listesi'nden alınan değer.

pAddress
[in] IDebugAddress arabirimi tarafından temsil edilen bir adres nesnesi.

ppType
[in] Türü tanımlayan bir IDebugField nesnesi döndürür.

İade Değeri

Başarılı olursa döndürür S_OK; aksi takdirde bir hata kodu döndürür.

Örnek

Aşağıdaki örnek, IDebugComPlusSymbolProvider arabirimini kullanıma sunan bir CDebugSymbolProvider nesnesi için bu yöntemin nasıl uygulandığını gösterir.

HRESULT CDebugSymbolProvider::CreateTypeFromPrimitive(
    DWORD dwPrimType,
    IDebugAddress* pAddress,
    IDebugField** ppType)
{
    HRESULT hr = S_OK;
    CDEBUG_ADDRESS addr;
    const COR_SIGNATURE* pTypeInfo = (const COR_SIGNATURE*) & dwPrimType;
    CDebugGenericParamScope* pGenScope = NULL;

    //
    // This function will only work for primitive types
    //

    METHOD_ENTRY( CDebugSymbolProvider::CreateTypeFromPrimitive );

    IfFailGo( pAddress->GetAddress( &addr ) );

    IfNullGo( pGenScope = new CDebugGenericParamScope(addr.GetModule(), addr.tokClass, addr.GetMethod()), E_OUTOFMEMORY );

    IfFailGo( CreateType( pTypeInfo,
                          1,
                          addr.GetModule(),
                          addr.GetMethod(),
                          pGenScope,
                          ppType ) );

    METHOD_EXIT( CDebugSymbolProvider::CreateTypeFromPrimitive, hr );

Error:

    RELEASE( pGenScope );
    return hr;
}

Ayrıca bkz.