Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Component exceptions

martbasemartbase Member Posts: 49
Hi Everyone,

I was wondering if there was a way to handle exceptions on a global scope for custom components. I am thinking along the lines of the application OnException event. Any ideas out there.

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi Everyone,
    :
    : I was wondering if there was a way to handle exceptions on a global scope for custom components. I am thinking along the lines of the application OnException event. Any ideas out there.
    :
    You can create your own events for your objects. And it is also possible to add a try..except block in each method, which calls that event. So your OnException set-up can be created for each component individually. It is not set at a global scope. For that you'll need o hook into the ExceptProc, and check if the exception was raised inside one of your components. This can be done in two ways:
    1: Hooking each component individually into the ExceptProc list
    2: Making a memory map of each method in the component.
    The first way will be the easiest to code, but can reduce the performance of your program if an exception is raised.
Sign In or Register to comment.