| Thread overview | |||||||
|---|---|---|---|---|---|---|---|
|
April 07, 2011 How to handle assert() in Windows GUI apps? | ||||
|---|---|---|---|---|
| ||||
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 | ||||
April 07, 2011 Re: How to handle assert() in Windows GUI apps? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | In fact throwing any kind of exception gives the same error, even if I change the exceptionHandler to not rethrow, or if I try to use show a dialog box within exceptionHandler (it won't show up). What is going on? | |||
April 07, 2011 Re: How to handle assert() in Windows GUI apps? | ||||
|---|---|---|---|---|
| ||||
Oh I'm so stupid I didn't realize my commands were outside the try catch statement. | ||||
April 07, 2011 Re: How to handle assert() in Windows GUI apps? | ||||
|---|---|---|---|---|
| ||||
Everything works fine now, please disregard my silly thread. :) | ||||
April 08, 2011 Re: How to handle assert() in Windows GUI apps? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Andrej Mitrovic | Andrej Mitrovic Wrote:
> Oh I'm so stupid I didn't realize my commands were outside the try catch statement.
LOL, nice joke.
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply