VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



wExceptionHandler

by Thushan Fernando (3 Submissions)
Category: Debugging and Error Handling
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (22 Votes)

wExceptionHandler will let your application be near-bullet proof from crashing for unhandled errors because of bad subclassers, windows GPF's and any other unhandled exceptions.
This will get the description of the exception caused, allow you to resume executing/running your application if an unhandled exception is thrown and shows you a dialog with some debug information about the exception whcih you could email to the developer etc.
I decided to post this almost a year ago but didnt get around to doing it but after (https://www.vbcoders.com/vb/scripts/showcode.asp?txtCodeId=41421&lngWId=1)Will Barden did I decided i'll upload mine too...
I must give credit to Jonathan Lunman who wrote a (https://archive.devx.com/premier/mgznarch/vbpj/1999/05may99/bb0599.pdf)VBPJ Article(Not from MSDN Mag as i thought)a few years back(1999) which is where this code is inspired/backboned by and thank-you to Vlad Vissoultchev for pointing this out:)

API Declarations
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDest As EXCEPTION_RECORD, ByVal LPEXCEPTION_RECORD As Long, ByVal lngBytes As Long)
Private Declare Function SetUnhandledExceptionFilter Lib "kernel32" (ByVal lpTopLevelExceptionFilter As Long) As Long
Private Declare Sub RaiseException Lib "kernel32" (ByVal dwExceptionCode As Long, ByVal dwExceptionFlags As Long, ByVal nNumberOfArguments As Long, lpArguments As Long)

Rate wExceptionHandler

Download wExceptionHandler

Download wExceptionHandler (138 KB)

wExceptionHandler Comments

No comments have been posted about wExceptionHandler. Why not be the first to post a comment about wExceptionHandler.

Post your comment

Subject:
Message:
0/1000 characters