IDebugGenericParamField::GetIndex
擷取這個泛用參數的索引。
HRESULT GetIndex(
DWORD* pIndex
);
int GetIndex(
out uint pIndex
);
參數
- pIndex
[] out此泛型參數的索引值。
傳回值
如果成功的話,會傳回S_OK。 否則,會傳回錯誤碼。
備註
比方說,如 Dictionary(K,V),k 是索引為 0,v 為索引 1。
範例
下列範例會示範如何實作這個方法,如 CDebugGenericParamFieldType 物件,公開 (expose) IDebugGenericParamField介面。
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;
}