From: Wiljan D. <wil...@ph...> - 2005-10-17 08:50:49
|
Hello Gautier, You wrote: > I also noticed that the exception >appears, as if not caught, on a console (when the console has not been >disabled by the -mwindows linker argument of course). I have run into the same problem. In general one wants an exception handler that catches these exceptions and reports them so one has a traceback. That ususually helps a great deal finding the root cause. Th latest gnat release have a different exception mechanism. Exception do not progagate through the stack when there are pieces of non Ada code. For this reason, I addapted Gwindows to establish an exception handler for these cases. In the gwindows-base.ads I added: type Exception_Event is access procedure (Window : in out GWindows.Base.Base_Window_Type'Class; E : Ada.Exceptions.Exception_Occurrence); procedure On_Exception_Handler (Handler : Exception_Event); The exception handler routine in store in a global variable: Exception_Handler : Exception_Event; procedure On_Exception_Handler (Handler : Exception_Event) is begin Exception_Handler := Handler; end On_Exception_Handler; In the routines WndProc and WndProc_Control I use an exception handler in the following form: exception when E : others => if Exception_Handler /= null then Exception_Handler (Win_Ptr.all, E); end if; raise; This mechanism seems to be working fine and can catch all exceptions. The application of cause needs to install such an exception handler. Please anyone comment on these changes. Greetings, Wiljan |