Different base class for debug & release

VC5, WinNt4.0

I would like to do the following.  How can i code it?

I have a CClassC.
In debug setting, i want its base class to be CClassA.
In release setting, i want its base class to be CClassB.
CClassB is derived from CClassA.
nancytanAsked:
Who is Participating?
 
RONSLOWConnect With a Mentor Commented:
use a #define

0
 
RONSLOWCommented:
#ifdef _DEBUG
#define BASE CClassA
#else
#define BASE CClassB

class CClassC : public BASE {
...
};

0
 
nancytanAuthor Commented:
How do i code if i also want in the debug mode to skip
certain functions.  These functions are to be
processed during the Release setting only.



0
 
RONSLOWCommented:
same way ... use the pre-processor with #ifdef _DEBUG/#else/#endif

You can make the release and debug versions as different as you want .. they could be completely different programs if you like .. but that may not help you much :-)

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.