exception - Scope of Application.OnException AND Delphi -
i new programmer , trying understand how delphi's application.onexception
event works. colleague has modified default exception handling creating own method , instantiating , passing application.onexception
in initialization
section of unit. unit declared in uses
clause of unit , otherwise unused.
unit adldebug; ... class procedure tadlexceptionhandler.adlhandleexception (sender: tobject; e: exception); ... initialization handler := tadlexceptionhandler.create; application.onexception := handler.adlhandleexception;
i can step initialization
section using debugger, , not adlhandleexception
method. trying cause exception in code caught redefined handleexception
method.
should scope of redefined handleexception
method in units include adldebug
? thinking should application wide, can't seem call it.
the scope of application.onexception indeed application wide. event fire whenever exception raised not handled.
you failing see event fire because raising exception @ startup, before message loop starts.
Comments
Post a Comment