[openbeos] Exception Handling with gcc2.95

Hey everyone,

this  might be the wrong place to answer this question, but since the old BeOS 
developer mailing lists do not seem to be active anymore, I think I will reach 
more of the knowledgeable people here. My question relates to whether it's 
possible to throw Exception objects (and handle) them using gcc2.95

Currently, I'm busy implementing a preferences framework for two of my 
projects: Bme and BeTeX. Previously, the BeTeX code contained heaps of message 
related code, to get and store preferences. Most of them something like "if 
(message->FindString(...) == B_OK)" Therefore, I decided to replace this code 
with Exception handling code. A Preference object wraps around a message object 
(and hence has all Find, Add, and Replace methods) but now it would be possible 
to replace all the "if" code by the following snippet:

try
{
    Preference *prefs = GetPreference("MainAppPrefs");
    BString prefString = prefs->FindString("stringname");
    int32 prefInt = prefs->FindInt32("intname");
}
catch (Exception e)
{
    cout << "missing preferences" << endl;
}

This I all already implemented, but now it turns out the "throw" command 
somewhere down in the preference object just blocks, and halts all my other 
code. Could this be a gcc 2.95 specific bug or am I probably doing something 
wrong in my code?

Hope you can help and sorry if this is the wrong place to ask...

regards,

Tim



      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html

Other related posts: