다음을 통해 공유


IDebugGenericParamField::GetIndex

이 제네릭 매개 변수의 인덱스를 검색합니다.

구문

int GetIndex(
    out uint pIndex
);

매개 변수

pIndex
[out] 이 제네릭 매개 변수의 인덱스 값입니다.

Return Value

성공하면 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;
}

참고 항목