Handling Exceptions

[b][red]This message was edited by GarryPaxton at 2004-7-30 7:2:4[/red][/b][hr]
I'm a rookie programmer.

My program calls a dll, and it all seems to work fine while the main form has a borderstyle like bsSingle or bsSizeable. However, when I make the form bsNone or bsDialog I get the following error when I Close the program:

"Project PicBase.exe raised an exception class EAccessViolation with message "Access violation at address 00BAD0C0. Read Address of 00BAD0C0'. Process stopped. Use Step or Run to continue"....
followed by a messagebox with the message

"Runtime error 216 at 0045501C"

It is important that my program has a border style of bsNone, but I have no idea what is going on. I would appreciate any pointers to how to debug exceptions.

The error occurs when I click on the button that simply issues "Close;".

many thanks for any help and advice.


Comments

  • : [b][red]This message was edited by GarryPaxton at 2004-7-30 7:2:4[/red][/b][hr]
    : I'm a rookie programmer.
    :
    : My program calls a dll, and it all seems to work fine while the main form has a borderstyle like bsSingle or bsSizeable. However, when I make the form bsNone or bsDialog I get the following error when I Close the program:
    :
    : "Project PicBase.exe raised an exception class EAccessViolation with message "Access violation at address 00BAD0C0. Read Address of 00BAD0C0'. Process stopped. Use Step or Run to continue"....
    : followed by a messagebox with the message
    :
    : "Runtime error 216 at 0045501C"
    :
    : It is important that my program has a border style of bsNone, but I have no idea what is going on. I would appreciate any pointers to how to debug exceptions.
    :
    : The error occurs when I click on the button that simply issues "Close;".
    :
    : many thanks for any help and advice.
    :
    :
    :
    Appearantly some resources are freed too soon if the border is set to bsNone or bsDialog, and not if the border is set to another bsXXXX.
    The best course of action is to use the following steps:
    1 - Rebuild the project
    2 - Try localize the error by stepping through the shut down procedures and events (like OnDestroy()'s, etc.)
    4 - Add if-then statements to check if certain resources, which you expect to exists, actually still exist
    3 - Selectively stripping your program until the error doesn't occur anymore. You can do this by commenting out statements. Again start with the OnDestroy.
    From this you might find out which resource is causing the problem. These errors are very hard to track down and will take a lot of recompiles before you actually know where it is.
Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion