Namespaces
Variants
Actions

Constructor

Jump to: navigation, search
Article Metadata

Article
Created: vin2ktalks (20 Mar 2007)
Last edited: hamishwillee (20 Jul 2012)

Constructor creates an object and initializes it. It also creates vtable for virtual functions. It is different from other methods in a class.

Some Important facts about Constructor in Symbian:

  • Never leave from a C++ constructor.
  • Never allocate memory from within a C++ constructor.
  • Put construction functions that might leave into a second-phase constructor such as ConstructL().
  • Instead of expecting your user to call ConstructL() and/or a C++ constructor explicitly, use NewL() and NewLC() to wrap up allocation and construction. You can enforce this by making the C++ constructors private.

This page was last modified on 20 July 2012, at 09:22.
114 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved