VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

GPF Exception Handler

Will Barden  (3 Submissions)   Debugging and Error Handling   Visual Basic 5.0   Intermediate   Wed 3rd February 2021

Tired of your favourite VB program crashing because of General Protection Faults? Bad subclassing code? Well... if any unhandled exceptions occur, your program will be able to cope, and even continue running. Please leave a line or two to let me know if this has been useful. Thanks.
10/12/02 - Updated: Now the module top level exception handler will raise the error via Err.Raise to allow VB to handle the error using On Error statements. GPFs can now be caught, just the same as any other error :) Thanks to those below who suggested this.
Also, I added some more constants, to allow deriving of more information from the EXCEPTION_RECORD structure. This means more info for your user, which is always good.

Side Effects
Note that this won't catch normal VB errors, since these are handled by the VB runtime DLL. This will protect against General Protection Faults, which would ordinarily bring your application to it's knees.

Rate GPF Exception Handler (21(21 Vote))

Download GPF Exception Handler

GPF Exception Handler Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters