I have a template based map that is declared as follows :
class CMyMap : public CMap<CString, LPCTSTR, CMyObject, CMyObject&)
CMyObject *GetValuePtrFromPos(POSITION pos);
I stored some items in it.
Now I want to iterate through the map and get a pointer to each object
stored. The pointer has to point to the object embedded in the CAssoc
structure maintained by the map, so that it stays valid until the map´s
elements are removed.
while (pos != NULL)
CMyObject* pObj = map.GetValuePtrFromPos(pos);
map.GetNextAssoc(pos, strKey, Obj);
Could somebody give me some hints of how to implement GetValuePtrFromPos
and tell me what the relation is between a POSITION type variable and an
internal CAssoc structure. Every help would be very appreciated.
Thanx in advance.