Hi!
I've found information about this feature on SO some time ago, but the topic was a duplicate of Hidden Features of Visual Studio (2005-2008)? and I can't find it anymore.
I want to use something like this:
#ifdef DEBUG
#define break_here(condition) if (condition) ... // don't remember, what must be here
#else
#define break_here(condition) if (condition) return H_FAIL;
#endif
//...
hresult = do_something(...);
break_here(hresult != H_OK);
//...
var = do_other_thing(...);
break_here(var > MAX_VAR);
It must behave like a breakpoint on error. It's something like assertion, but no dialogs, and more light-weight.
I can't use normal breakpoints here, because my module is a part of several projects and can be edited in several VS solutions. This causes breakpoints, which was set in one solution, shift somewhere in source, when code edited in other solution.