>By the way, has anyone else run into exception callback problems? Suppose
>you have a Database class, and that class can throw an exception (arguably
>a better way to handle errors). Suppose in order to draw a cell in a table,
>you need to use the Database class (or a class that uses the Database
>class). Watch out that you don't throw exceptions, because they'll throw
>right through you (C callbacks truncate exception headers).
>
>C++ is significantly hamstrung on the Palm.


Yep, this is a problem. For database classes I basically just return errors
and allow the caller to handle the error. In Find code, you can throw a
Palm exception instead of a C++ exception if you want to use exceptions
here. Yes, this is a pain and I wish it were fixed, etc. etc.

I have found that using templates for database classes and/or non-virtual
base classes works pretty well for creating data handlers. It's not ideal,
but it works for data.

But to pick up on this idea of needing vtables in non-sub launch codes, how
about alarms? You create this nice class library to handle forms, but you
can't use it to display an alarm. Also, my customers are asking for fairly
sophisticated things from the alarm screen, like snoozing, goto, or
changing related information in the associated record straight from the
alarm screen. Some of these things would be much easier to do from C++ once
you have created classes to handle things, but you can't do it unless you
are REALLY careful about not throwing C++ exceptions or using virtual
functions, (not to mention the usual problem of not using globals).

Perhaps it might make sense to get some information about how the vtables
are maintained. I wish there was a way when PilotMain was called to detect
that there are no globals, create space for the vtable, initialize it, and
then somehow fill in a pointer so that the temporary one is used. Then when
you exit PilotMain, fix up the pointer and free the memory.

Of course doing it this way, you still wouldn't get to use global objects.
But to my mind, just having a vtable is more important than even having
access to globals.

I know some people out there have hacked around with this stuff. Anyone
have a suggestion on how to do this today?

Shannon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Hands High Software
Award winning software for the Palm(tm) Computing platform

<http://www.handshigh.com/>

[EMAIL PROTECTED]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to