Does anybody know where there is some example code to hook
into a CPU exception, put in my own code, then pass onto the default
Windows handler?
I want to "talkback enable" my program, post an email with an
error report to me. I got inspired by Mozilla, which does this.

Regards,
Posted on 2002-11-21 18:41:51 by bkauler
You can change ErrorHandler to suit your needs and extended its simple MessageBox error display.
Posted on 2002-11-21 18:45:58 by comrade
Wow, that was quick, I just posted the question, got your reply
one minute later!
Thanks, comrade, I'll unzip and study the code!
Posted on 2002-11-21 18:58:15 by bkauler
Hi All! It's my .try-.catch-.finally macro

Your comments...
Posted on 2002-11-22 00:19:13 by Eviloid
I have just found some more example code at Programmer's Heaven:

http://www.programmersheaven.com/zone15/cat245/index.htm

It's called "except32.zip" and is in assembly code.
Posted on 2002-11-22 01:47:07 by bkauler
I have worked out this really really really simple code:

final_handler PROC STDCALL USES ebx esi edi, pexcept:DWORD
invoke MessageBox,0,ADDR szfatalmess,0,MB_OK
mov eax,1 ;=1 terminate process without showing system message box
ret
final_handler ENDP

start:
;i want to hook the fatal crash of app...
invoke SetUnhandledExceptionFilter,ADDR final_handler

..................
Right at program entry, I call SetUnhandledExceptionFilter().
For any fatal exception, I get my own messagebox and termination of my app.
This is all I need, except that I now need to expand it
-- I have to get the register values when it crashed and give option to
email them to me. I know how to do the email part, but getting the crash
data -- I presume that parameter "pexcept" -- a pointer to a data structure
-- has something to do with it.

Regards,
Barry Kauler
Posted on 2002-11-22 06:38:51 by bkauler
Posted on 2002-11-23 05:05:23 by Eviloid
And here's

a good article
Posted on 2002-11-23 08:34:22 by david