5c9 Subj : Re: Borland C++ 5.02 Application Constructor XP Problem To : borland.public.cpp.borlandcpp From : Bruce Salzman Date : Fri Nov 12 2004 09:58 am > I've got a legacy ap written in Borland C++ 5.02. > Running under XP the program crashes after about 2/3 days. The > problem appears to be that the applications constructor is recalled > throwing an exception. Can't work out why the constructor can be > being recalled. This app has been working for years without issue on > previous operating systems. As to why the app constructor is called, an AppExpert-generated OWLMain by default catches any unhandled exceptions, then gives the user a chance to re-rerun the application. Something like this: bool done = false; do { try { App = new MyAp(InitInst, PrevInst, cmd, show); App->Run(); } catch (TXOwl& x) { bool found; string s = x.ResourceIdToString(&found, x.GetErrorCode()); done = status = HandleGlobalException(s, "Abnormal Termination, unhandled exception","Run Again?"); } catch(...) { done = status = HandleGlobalException(string(), "Abnormal Termination, unhandled ...","Run Again?"); } delete App; } while (!done); That may be why the constructor executes again. But you should see the "Run Again?" prompt before that happens. As to why an exception is being thrown, that is another problem. Regards, Bruce . 0