?
Solved

Different base class for debug & release

Posted on 1998-04-13
4
Medium Priority
?
228 Views
Last Modified: 2010-04-10
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.
0
Comment
Question by:nancytan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 10

Accepted Solution

by:
RONSLOW earned 200 total points
ID: 1184261
use a #define

0
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1184262
#ifdef _DEBUG
#define BASE CClassA
#else
#define BASE CClassB

class CClassC : public BASE {
...
};

0
 

Author Comment

by:nancytan
ID: 1184263
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
 
LVL 10

Expert Comment

by:RONSLOW
ID: 1184264
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question