Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

Different base class for debug & release

Posted on 1998-04-13
4
Medium Priority
?
232 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses

649 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