Is it possible to do macro...
I want to do 2 macros... the first one will be called:
#define BEGIN_DEBUG
and the second will be called:
#define END_DEBUG
The goal is when i'm in debugging mode i want be abl to do things like that:
BEGIN_DEBUG
{
// Some c++ code...
}
END_DEBUG
But when i'm in release mode this block of code must disapears..
Is this possible?
If it is ... whats the trick?
Tanks.
Reply to : [email protected]
Re: Is it possible to do macro...
Two tricks:
1). Use the _DEBUG macro that is already defined by the compiler:
#ifdef _DEBUG
DoVeryLongAndBoringTest();
EvenMoreSlowDebugging();
#endif
2). If it's only going to take one line of code, do this:
DEBUG_ONLY(AfxMessageBox("Got this far without crashing!"));
HTH.
LA Leonard - http://www.DefinitiveSolutions.com