> So what you're saying is that there's nothing analogous to the Win32
> translate exceptions mechanisms?  This lets the OS exceptions (the beloved
> GPF et al) be translated into C++ exceptions.  Otherwise Win32 exceptions
> (which are a quite different animal than their C++ counterparts) tend to
> fall through nasty cracks with nasty results.

Win32 doesn't force you to do C++ exceptions that way -- CodeWarrior for
Win32's zero-overhead exceptions don't catch OS errors, but also have
significantly less overhead in program code and data tables.

> If there is a way to catch various errors before they pop up dialogs, then
> it should be reasonably trivial to wrap these in a mechanism to translate
> into C++ exceptions.  Now, the question is: Is there a way to intercept
> these errors before the system kicks into default behaviors?

You should be able to combine the system's ErrTry/ErrCatch/ErrEndCatch with
C++ exception handling.  You'll just have to be aware that the C++ exception
handlers won't catch the system errors, and vice versa.  However, this only
works if the system routine that originally sees the error uses the ErrThrow
system call.  A quick scan through the PalmOS source code indicates that
ErrThrow is almost never used (but I can't really reveal more than that, due
to the Palm NDA).

Conclusion: use either mechanism, and be consistent.  The system error
trapping calls won't trap real crash-worthy errors.  If you're doing C code,
ErrTry et al looks pretty promising.  If you're doing C++, use the
compiler's exception handling so the language will handle
constructors/destructors correctly.




-- 
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