|
-
April 30th, 1999, 12:17 PM
#1
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]
-
April 30th, 1999, 12:46 PM
#2
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|