"Butler, Nick" <[EMAIL PROTECTED]> wrote:

>Martin - Your previous email thread you made the following comment
>
>"do-able to write 'good' C++ code for the Palm (which=20
>IMNSHO means you now have support for exceptions & virtual functions,
>and=20
>that 'report' of the MSL library business may even mean you can use=20
>autoptr's and stuff, I hope?  t'would *really* help with almost
>effortless=20
>dynamic memory management...)" ...
>
>Could you expand a little about the current support (or lack of) is for
>virtual functions and exceptions is for CW7?
>
>Also, can you not use autoptr's currently in CW7?

Hmmmmm...  I guess I could have been a bit more explicit about a number of 
things.  First of all, I have not (yet) used CW 7 at all.  I have seen 
discussions on this list mentioning a number of tips about programming in 
C++ in CW 7 for Palm.  If memory serves I remember people saying that both 
virtual functions & exception handling *as implemented in CW 7* make use of 
global objects.  Thus, these 'techniques' (for lack of a better word) can 
not be used in sections of code that will be executed if a Palm receives a 
launch code that doesn't support global variables.  So, CW 7 *does* support 
virtual functions, and exceptions and stuff... but just about the only time 
you can really count on them to work is if you're in the sysAppLaunchNormal 
(or whatever the exact name is) launch code...

As far as my comment about autoptr's goes, I also seem to recall it being 
said that autoptrs, as well as lots of other stuff that used to be part of 
the C++ STL, were all present in the MSL library.  Even the C++ operator new 
requires support for exceptions, as if it fails it is supposed to throw a 
std::bad_alloc exception IIRC.

So, note, I'm *not* saying you *can't* use those techniques under CW 7, its 
just that some of them won't work when an application recieves a launch code 
that doesn't 'support' the use of global objects.  As an aside, I probably 
wouldn't use autoptrs even if I could...  I much prefer smart pointers that 
implement reference counting and will throw an exception if they're 
dereferenced while "being NULL"...  But that's just my 2 cents.

Sincerely,
Martin



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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

Reply via email to