The following code fragment retrieves a pointer to the reference counting object with the name "Monday". It assumes that such a reference counting object does exist.
... class CMyobject : public CObject { ... }; _LIT(KMatcher,"Monday"); ... CMyobject* theobject; CObjectCon* thecontainer; TInt thefindhandle; TName objname; ... thecontainer->FindByName(thefindhandle,KMatcher,objname); theobject = (CMyObject*)thecontainer->AtL(thefindhandle); ...
The following code fragment retrieves pointers to all of the reference counting objects whose names end with "day":
... class CMyobject : public CObject { ... }; _LIT(KMatcher,"*day"); ... CMyobject* theobject; CObjectCon* thecontainer; TInt thefindhandle; TName objname; ... thefindhandle = 0; while (thecontainer->FindByName(thefindhandle,KMatcher,objname)==KerrNone) { // objname contains the reference counting object's // name, e.g. "Monday" or "Tuesday" ... theobject = (CMyobject*)thecontainer->AtL(thefindhandle); ... } // Now found all matching reference counting objects ...
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.