Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

position structure

Status
Not open for further replies.

michaelkrauklis

Programmer
Dec 5, 2001
226
US
I've looked all over the place but I can't find any good reference on the position structure. Most importantly, how to create an instance of the position structure. All I'm trying to do is reference a CObject in a CObList at a particular index, but you can't pass an int. The parameter must be of POSITION type. MYenigmaSELF
myenigmaself@yahoo.com
 
to declare a struct of type POSITION you just type

POSITION p = myObjList.GetHeadPostion();

while(p)
{
objListType* type = myObjList.GetNext(p);

do what you need to do with type
}


SOmething along those lines should do it for you :)

Matt
 
hmmm... ok, so it's like an iterator. but there's no way to access a particular index right off the bat? Like in a Vector in java:
Vector.elementAt(int)
You can't do that?

Thanks MYenigmaSELF
myenigmaself@yahoo.com
 
Hi! I thing that :

CObList::GetAt(pos)

and

CObList::SetAt(pos)

will be ok.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top