Click here to Skip to main content
15,891,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Scope problem with CList? Pin
Cpt Rick24-Nov-04 6:49
Cpt Rick24-Nov-04 6:49 
AnswerRe: Scope problem with CList? Pin
BaldwinMartin23-Nov-04 9:51
BaldwinMartin23-Nov-04 9:51 
QuestionAre class definitions constant? Pin
One Stone23-Nov-04 0:51
One Stone23-Nov-04 0:51 
AnswerRe: Are class definitions constant? Pin
vikramlinux23-Nov-04 1:05
vikramlinux23-Nov-04 1:05 
AnswerRe: Are class definitions constant? Pin
Andrew Walker23-Nov-04 1:48
Andrew Walker23-Nov-04 1:48 
Questionabstract base class and data member doubt ? Pin
xcavin23-Nov-04 0:51
xcavin23-Nov-04 0:51 
AnswerRe: abstract base class and data member doubt ? Pin
geo_m23-Nov-04 1:30
geo_m23-Nov-04 1:30 
AnswerRe: abstract base class and data member doubt ? Pin
Andrew Walker23-Nov-04 1:41
Andrew Walker23-Nov-04 1:41 
Unlike Java and C# these terms tend to have less meaning in C++, where the rules are far more flexible. The language designers of C++ aim was (and still is) 'you don't pay for what you don't use'. and in doing so they discovered many of the potential programmer pitfalls which more modern languages seek to avoid.

The answers to both questions is yes, you can do what you like - although most programmers now follow some general guidelines when preparing these types of classes.

A C++ abstract base class is any class that cannot be instantiated due to having one or more pure virtual functions. Some developers make the choice to flag this in other ways as well by making constructors and/or destructors private.

Standard C++ has no concept of an interface, however java-like interfaces can be implemented in two ways. One is through the use of a class with only virtual functions, the second is an ugly mess of templates which you generally need a code generator to assist with - this was described in a recent article of the C/C++ Users Journal see Heronfront for more information. Interfaces tend to provide a single concrete function (a virtual destructor), whilst avoiding data.

The presence of member variables for classes in these situations can have an impact on a number of factors, mainly to do with language implementation details (class sizes and v-tables). These issues are largely irrelevant, provided you aren't doing weird casts on classes and/or using multiple inheritance.



If you can keep you head when all about you
Are losing theirs and blaming it on you;
If you can dream - and not make dreams your master;
If you can think - and not make thoughts your aim;
Yours is the Earth and everything that's in it.

Rudyard Kipling

GeneralHelp with writing class and imp them Pin
bhangie23-Nov-04 0:46
bhangie23-Nov-04 0:46 
GeneralRe: Help with writing class and imp them Pin
Maximilien23-Nov-04 2:41
Maximilien23-Nov-04 2:41 
GeneralRe: Help with writing class and imp them Pin
BaldwinMartin23-Nov-04 9:57
BaldwinMartin23-Nov-04 9:57 
GeneralAfxBeginThread Pin
jaime.lopez23-Nov-04 0:27
jaime.lopez23-Nov-04 0:27 
GeneralRe: AfxBeginThread Pin
shiraztk23-Nov-04 0:42
shiraztk23-Nov-04 0:42 
GeneralRe: AfxBeginThread Pin
BlackDice23-Nov-04 2:39
BlackDice23-Nov-04 2:39 
GeneralWM_SHUTDOWN notification Win32 dll Pin
AssemblySoft22-Nov-04 23:58
AssemblySoft22-Nov-04 23:58 
GeneralRe: WM_SHUTDOWN notification Win32 dll Pin
geo_m23-Nov-04 1:37
geo_m23-Nov-04 1:37 
GeneralRe: WM_SHUTDOWN notification Win32 dll Pin
AssemblySoft23-Nov-04 10:43
AssemblySoft23-Nov-04 10:43 
GeneralRe: WM_SHUTDOWN notification Win32 dll Pin
BaldwinMartin23-Nov-04 10:21
BaldwinMartin23-Nov-04 10:21 
GeneralRe: WM_SHUTDOWN notification Win32 dll Pin
AssemblySoft23-Nov-04 10:40
AssemblySoft23-Nov-04 10:40 
GeneralRe: WM_SHUTDOWN notification Win32 dll Pin
BaldwinMartin23-Nov-04 10:46
BaldwinMartin23-Nov-04 10:46 
GeneralThread termination problem. Pin
ledallam22-Nov-04 21:38
ledallam22-Nov-04 21:38 
GeneralRe: Thread termination problem. Pin
Joaquín M López Muñoz22-Nov-04 22:35
Joaquín M López Muñoz22-Nov-04 22:35 
GeneralRe: Thread termination problem. Pin
ledallam22-Nov-04 22:47
ledallam22-Nov-04 22:47 
QuestionReBar - how to set button state on it? Pin
Darked developer22-Nov-04 20:57
Darked developer22-Nov-04 20:57 
AnswerRe: ReBar - how to set button state on it? Pin
Darked developer22-Nov-04 21:02
Darked developer22-Nov-04 21:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.