diff -r 4816d766a08a -r f345bda72bc4 Symbian3/PDK/Source/GUID-2A6C43A6-D5D3-5DC1-871C-C1428D2DB2E6.dita --- a/Symbian3/PDK/Source/GUID-2A6C43A6-D5D3-5DC1-871C-C1428D2DB2E6.dita Tue Mar 30 11:42:04 2010 +0100 +++ b/Symbian3/PDK/Source/GUID-2A6C43A6-D5D3-5DC1-871C-C1428D2DB2E6.dita Tue Mar 30 11:56:28 2010 +0100 @@ -1,50 +1,50 @@ - - - - - -How to access reference counting objects in object containers

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 + + + + + +How to access reference counting objects in object containers

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 ...
\ No newline at end of file