Hi all.......
I ma getting confused about the NOT SO EASY construction process of objects in Symbian. In some Examples, the objects are constructed using NewL, NewLC and then from NewLC calling ContructL. And sometimes, objects are made by only calling ConstructL directly, no NewL or NewLC. I am getting confused.............can someone please tell me a little more about this things?....
I suggest you read thru alla the material about series 60 that can be found on Nokias website all this is explained there Idont remeber which PDF but it doesnt hurt if you read alla of them 😊
Yap.....thanx for the advice...actually I have read the docs, but now do not
remember all......sometimes u just don't have enough time to read through all docs and need some help from someone who already knows ans remembers..........
The process of creating new objects on Symbian OS can seem complicated, because of the two-phase construction process which is frequently used. The reason for this is to protect against memory leaks in the event of construction failing for whatever reason.
The majority of objects which use two-phase construction should have a NewL function and (possibly) a NewLC function. These functions usually just create a new object and attempt to call ConstructL on it. If an object has a NewL, this is the preferred way to create it. NewLC is exactly the same, it just leaves the object on the cleanup stack after creating it.
Some objects (such as list boxes) don't have a NewL, just a constructor and a ConstructL function. In this case, you should call ConstructL yourself after creating the object. But be careful to avoid memory leaks in case ConstructL leaves.
Hope this helps.