IDebugGenericParamField::GetIndex

检索此泛型参数的索引。

语法

int GetIndex(
    out uint pIndex
);

参数

pIndex
[out] 此泛型参数的索引值。

返回值

如果成功,则返回 S_OK;否则,返回错误代码。

备注

例如,对于 Dictionary(K,V),K 为索引 0,V 为索引 1。

示例

以下示例演示如何为公开 IDebugGenericParamField 接口的 CDebugGenericParamFieldType 对象实现此方法

HRESULT CDebugGenericParamFieldType::GetIndex(DWORD* pIndex)
{
    HRESULT hr = S_OK;

    METHOD_ENTRY( CDebugGenericParamFieldType::GetIndex );

    IfFalseGo(pIndex, E_INVALIDARG );
    IfFailGo( this->LoadProps() );
    *pIndex = m_index;

Error:

    METHOD_EXIT( CDebugGenericParamFieldType::GetIndex, hr );
    return hr;
}

另请参阅