IDebugGenericParamField::GetIndex

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Retrieves the index of this generic parameter.

Syntax

HRESULT GetIndex(
    DWORD* pIndex
);
int GetIndex(
    out uint pIndex
);

Parameters

pIndex
[out] Index value of this generic parameter.

Return Value

If successful, returns S_OK; otherwise, returns an error code.

Remarks

For example, for Dictionary(K,V), K is index 0, V is index 1.

Example

The following example shows how to implement this method for a CDebugGenericParamFieldType object that exposes the IDebugGenericParamField interface.

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;
}

See also