I have learnt that every C++ class should have a virtual destructor, because of inheritance implementation, virtual ensure that the good destructor is called.

C++ classes should only have virtual destructors when they can be inherited. There are plenty of uses of classes that don't support inheritance. Do you need to inherit from a CString? Often, inheritance is better replaced by encapsulation and aggregation anyway.


Moreover, it is written in doc "targeting_palm_os.pdf" that new and delete cant be called if !sysAppLaunchFlagNewGlobals because they throw exceptions and this needs globals.

That's right. You can use inline versions of new/delete (see palmoswerks.com) to avoid this issue.


HOW CAN YOU PROGRAM IN C++ IN THOSE CONDITIONS ???

Very well. Just avoid the trouble spots, and use a mixture of OOP and procedural programming to handle launches where globals aren't available.


--
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com



-- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to