共用方式為


IDiaTable::Item

Note

This article applies to Visual Studio 2015. 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 a reference to the specified entry in the table.

Syntax

HRESULT Item (   
   DWORD      index,  
   IUnknown** element  
);  

Parameters

index
[in] The index of the table entry in the range 0 to count-1, where count is returned by the IDiaTable::get_Countmethod.

element
[out] Returns an IUnknown object that represents the specified table entry.

Return Value

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

Remarks

A table represents a collection of objects. Depending on those objects, the element parameter can be cast to the appropriate interface. For example, if a table contains IDiaSegment objects, then the element parameter can be cast to the IDiaSegment interface.

It is a more common approach to call the QueryInterface method in the IDiaTable interface for the appropriate enumerator interface and use the enumerator's specific methods to access the table contents. See the IDiaEnumInjectedSources interface for an example.

See Also

IDiaTable
IDiaTable::get_Count
IDiaSegment
IDiaEnumInjectedSources