A variable of type POSITION is a key for the list.
CObject*& GetAt( POSITION position ); const CObject*& GetAt( POSITION position ) const;
See the return value description for GetHead.
It is not the same as an index, and you cannot operate on a POSITION value yourself. GetAt retrieves the CObject pointer associated with a given position.
You must ensure that your POSITION value represents a valid position in the list. If it is invalid, then the Debug version of the Microsoft Foundation Class Library asserts.
The following table shows other member functions that are similar to CObList::GetAt.
|
Class |
Member Function |
|---|---|
|
const void*& GetAt( POSITION position ) const; void*& GetAt( POSITION position ); |
|
|
const CString& GetAt( POSITION position ) const; CString& GetAt( POSITION position ); |
See the example for FindIndex.
Header: afxcoll.h