How to handle assert() in Windows GUI apps?
Andrej Mitrovic
none at none.none
Thu Apr 7 14:12:25 PDT 2011
It turns out that using assert() that throws in a Windows application will show an error such as this:
---------------------------
first.exe - Application Error
---------------------------
The instruction at "0x00411e6a" referenced memory at "0x00000044". The memory could not be "read".
---------------------------
I'm not sure if this is a bug or expected behavior. If it's expected, isn't it possible to reroute assert() to use a dialog box and report the failed assert there?
Here's the code, using WindowsAPI from dsource, non-unicode mode:
http://codepad.org/LOvfAwSR
More information about the Digitalmars-d-learn
mailing list