Freigeben über


IDebugGenericParamField::GetIndex

Retrieves the index of this generic parameter.

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

Reference

IDebugGenericParamField