Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ - Totally suspend windows application
    text
    copied!<p>I am developing a simple WinAPI application and started from writing my own assertion system.</p> <p>I have a macro defined like <code>ASSERT(X)</code> which would make pretty the same thing as <code>assert(X)</code> does, but with more information, more options and etc.</p> <p>At some moment (when that assertion system was already running and working) I realized there is a problem. </p> <p>Suppose I wrote a code that does some action using a timer and (just a simple example) this action is done while handling <code>WM_TIMER</code> message. And now, the situation changes the way that this code starts throwing an assert. This assert message would be shown every <code>TIMER_RESOLUTION</code> milliseconds and would simply flood the screen.</p> <p>Options for solving this situation could be:</p> <p>1) Totally pause application running (probably also, suspend all threads) when the assertion messagebox is shown and continue running after it is closed</p> <p>2) Make a static counter for the shown asserts and don't show asserts when one of them is already showing (but this doesn't pause application)</p> <p>3) Group similiar asserts and show only one for each assert type (but this also doesn't pause application)</p> <p>4) Modify the application code (for example, <code>Get / Translate / Dispatch</code> message loop) so that it suspends itself when there are any asserts. This is good, but not universal and looks like a hack.</p> <p>To my mind, option number 1 is the best. But I don't know any way how this can be achieved. What I'm seeking for is a way to pause the runtime (something similiar to <code>Pause</code> button in the debugger). Does somebody know how to achieve this?</p> <p>Also, if somebody knows an efficient way to handle this problem - I would appreciate your help. Thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload