John,

The Palm OS Garnet APIs use C calling conventions, but that doesn't
require you to write C code to access them.  There is a strong legacy of
using C, but it's not a requirement.

There are a number of ways you can use C++ in a Palm app that targets
Palm OS Garnet.  

1) You can use C++ as a "better C".  That is, you write C code for the
most part, but take advantage of the type checking in C++ and some of
the convenience features (such as on-the-fly variables).  This will
produce compact code.  
2) You could take advantage of some of the class features of C++ without
using virtual functions, templates or exceptions and still produce
reasonably compact code.  
3) You can use virtual functions, templates and exceptions in C++ code,
but you will need to familiarize yourself with the term multi-segment
(or multi-section depending on whom you are talking with).

The Palm Object Library (POL) that comes with CodeWarrior uses
templates, virtual functions, and exceptions.  I had to start segmenting
after about the 8th form.  POL is a great place to start writing code
for Garnet, but it currently can only be used with CodeWarrior.

I have not used STL in a Palm app, so I can't comment there.

The only real pitfall is that you have to be aware of your memory
situation and deal with it accordingly.

-E

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of John Kern
> Sent: Thursday, September 30, 2004 10:06 AM
> To: Palm Developer Forum
> Subject: What's the state of the C++ environment on Palm OS?
> 
> 
> Hello,
> 
> Over the past decade C++ has undergone a lot of change.  This 
> made C++ development a bit tricky on UNIX.  In the mid/late 
> 90's, it wasn't prudent to use templates, exceptions and 
> RTTI( see http://www.mozilla.org/hacking/portable-cpp.html). 
> Cerca 2000, it became possible to use all these and the STL 
> with portable code. 
> 
> I have noticed C is the dominate language used  for examples 
> and open source projects.  Since the API's are in C, this make sense.
> 
> What is the state of the C++ environment?  Is C++ available 
> in all its glory? Are some facilities not available? Are 
> there significant pitfalls to watch out for?
> 
> Sincerely,
> 
> John 
> -- 
> For information on using the Palm Developer Forums, or to 
> unsubscribe, please see http://www.palmos.com/dev/support/forums/
> 

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

Reply via email to