Link to home
Start Free TrialLog in
Avatar of nancytan
nancytan

asked on

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.
ASKER CERTIFIED SOLUTION
Avatar of RONSLOW
RONSLOW

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RONSLOW
RONSLOW

#ifdef _DEBUG
#define BASE CClassA
#else
#define BASE CClassB

class CClassC : public BASE {
...
};

Avatar of nancytan

ASKER

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.



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 :-)