Also if you are using CW, you can switch on the expanded mode support. This moves much of the C++ static data (including vtables) into a second data segment. This second data segment is then accessed via the a4 register instead of the a5 (globals) register. CW provides some additional functions (_CW_SetupExpandedMode) you can call to set up this seconds data segment for use during non-global launch codes.

Also you can expose some further functions from the CW runtime library to set up the inter-segment jump tables allowing you to use code that is outside the first code segment (__LoadAndRelocate__)

There are still limits on what you can do with C++ code on the palm, but it can be used for a lot more than most people seam to believe.

Remi wrote:
Hi list.
I've seen a few messages recently which discuss problems using virtual functions.  I've 
searched the archives and found a few posts that discuss how "virtual functions need 
a vtable, which is static resp. global. If your code is started without globals, you 
can't have virtual functions. Sorry."

BUT I've been working off-and-on a few different, large-enough Palm apps - last 
year, using CW8 and this year a new one using CW9.  Both apps are multi-segment 
for 68K and use virtual functions - without problems, yet.

So what gives?  Is this something that's going to bite me in the ass a week 
before I deliver?  How can I tell if my code is started without globals?  Can 
somebody elaborate a bit on this, and help me understand why my apps still work 
- or why they're going to explode in a few weeks?

Regards,
Remi.


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

Reply via email to