VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

wExceptionHandler

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

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 (23(23 Vote))

Download wExceptionHandler

wExceptionHandler Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters