AFAIK there is nothing you can do about this; unless there is an
undocumented #pragma I don't know about. In my experience, I think this one
of the biggest gotchas of C++ with PalmOS. I don't know why vtables are
placed in the data segment. Yes, it is data (compared with instructions) but
the data *never* changes. The best place to put them would be in the same
code segment as the actual class code; that way classes in the first segment
would be virtually accessible when an app runs without globals.
FYI: I haven't investigated this deeply; I hope someone from Metrowerks can
shine some light on why the problem exists, why it hasn't been solved and
when it will be solved. This *really* is a disability for C++ programmers
and in my opinion the C++ lanaguage brings a lot of advantage to Palm
programmer if only the C++ implementations where *fine* tuned to the unique
properties of the Palm paltform.
I'll stop gripeing now, because I haven't help you at all.
James.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dan
Samber
Sent: Wednesday, 27 June 2001 14:11
To: Palm Developer Forum
Subject: C++ virtual functions are global with Code Warrior
I've been happily coding an application in C++ using Code Warrior
and run into an (apparently) very well understood problem.
I've created all these nice classes and subclasses and arranged a neat
series of virtual functions to access databases. Works Great! Then.....
I tried to use them in response to an alarm launch code (where global
variables
are not allowed) and BAM! I "discovered" that Metrowerks implements
the virtual function functionality via a GLOBAL lookup table.
I've checked out the archive and people have posted about this topic....
but nothing recently....... Is there a workaround? Or do I have to do
something
sleazy?
Thanks!
Dan
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/