Click here to Skip to main content
15,907,225 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: close dialog? Pin
Larsson21-Oct-04 21:31
Larsson21-Oct-04 21:31 
GeneralC++ question. Pin
WREY21-Oct-04 20:16
WREY21-Oct-04 20:16 
GeneralRe: C++ question. Pin
Yulianto.21-Oct-04 22:04
Yulianto.21-Oct-04 22:04 
GeneralRe: C++ question. Pin
V.21-Oct-04 23:27
professionalV.21-Oct-04 23:27 
GeneralRe: C++ question. Pin
digwizfox22-Oct-04 11:05
digwizfox22-Oct-04 11:05 
GeneralRe: C++ question. Pin
WREY22-Oct-04 13:46
WREY22-Oct-04 13:46 
GeneralRe: C++ question. Pin
digwizfox25-Oct-04 6:32
digwizfox25-Oct-04 6:32 
GeneralRe: C++ question. Pin
WREY25-Oct-04 7:31
WREY25-Oct-04 7:31 
Thanks for replying again.

My confusion with an ABC is NOT about the position it occupies in the hierarchy structure (meaning, that its ctor is going to be invoked and executed first, ahead of its derived classes). My confusion (and to some extent, 'frustration') is with the evolving role it is called upon to fulfill.

ABC's are promoted first and foremost as class(es) which cannot be instatntiated because it contains a 'pure virtual function', and therefore can ONLY be used as an interface for the hierarchy structure to which it is the base class.

Well, hold on! Don't base classes on a whole perform the same kind of role to the hierarchy structure they, too, are a part of? Base classes contain member variables, and functions that are common to what their derived class(es) will (or might) use. Such kinds of base class also use virtual functions, and act as interface to their derived class(es).

The ONLY difference I see between a regular base class and an ABC, is that you are FORCED to override the 'pure virtual functions' in an ABC, whereas in non-ABC classes, you ONLY override those base class functions if you want the derived ones to be more specific than what the base functions provide. That's it.

The notion of when which class gets instantiated first, or before which other ones, isn't salient.

Then I turn to the next factor which is the multiple CTORs ABC's are sometimes given to bear (in the name of flexibility for its role as 'interface'). Because of the order in which base class(es) are instantiated, I understand data from derived class(es) needs to be passed up the chain in order for the base class(es) to be properly initialized. This fact (sadly) contributes to my whole point of UNNECESSARILY burdening a class which originally started out to be an ABC, simply because its main role was to be an interface, suddenly starts turning out to be a "do all for all" type interface. I just feel the picture would be a lot clearer if some of those gratuitous roles could be reversed and bourned by its own derived class(es).

Lastly, since the time of posting my question and now, I've done quite a bit of reading on ABC and have discovered several "behind the scene" activities the compiler does that are not readily revealed in 99.99% of C++ books. The most important being that it is ONLY a syntactical requirement that ABC's NOT be instantiated by the programmer, while in truth an fact, it DOES get instantiated by the compiler and is treated (by the compiler in its own unique way) as any base class object. The overwhelming difference in identity lies with the way the programmer needs to treat and handle ABC (two different set of rules: one for the programmer, and one reserved for the compiler).

Perhaps, at some time in the future (when time permits), I'll look at the underlying Assembly code to see what those differences are, but for right now, I'll just know that syntactically there are certain things I cannot do with and ABC, whereas the compiler makes amends for whatever it does "behind the scene".

Thanks again for replying.

Smile | :)

William

Fortes in fide et opere!
GeneralReading Field Pin
picasso221-Oct-04 19:58
picasso221-Oct-04 19:58 
GeneralRe: Reading Field Pin
Yulianto.21-Oct-04 22:39
Yulianto.21-Oct-04 22:39 
GeneralRe: Reading Field Pin
David Crow22-Oct-04 4:44
David Crow22-Oct-04 4:44 
Generalusing SHBrowseForFolder Pin
includeh1021-Oct-04 19:53
includeh1021-Oct-04 19:53 
GeneralRe: using SHBrowseForFolder Pin
PJ Arends21-Oct-04 20:08
professionalPJ Arends21-Oct-04 20:08 
QuestionMFC and the MAIN method??? Pin
Anonymous21-Oct-04 19:38
Anonymous21-Oct-04 19:38 
AnswerRe: MFC and the MAIN method??? Pin
Phil J Pearson22-Oct-04 0:24
Phil J Pearson22-Oct-04 0:24 
AnswerRe: MFC and the MAIN method??? Pin
David Crow22-Oct-04 4:47
David Crow22-Oct-04 4:47 
GeneralRe: MFC and the MAIN method??? Pin
dharani26-Oct-04 22:53
dharani26-Oct-04 22:53 
GeneralRe: MFC and the MAIN method??? Pin
David Crow27-Oct-04 3:11
David Crow27-Oct-04 3:11 
Questionhow to create tab control Pin
vc-programmer-21-Oct-04 19:28
vc-programmer-21-Oct-04 19:28 
QuestionWhy I get a black screen while capturing screen? Pin
Guoguor21-Oct-04 17:35
Guoguor21-Oct-04 17:35 
AnswerRe: Why I get a black screen while capturing screen? Pin
YoSilver22-Oct-04 21:35
YoSilver22-Oct-04 21:35 
GeneralOnly Dialogbox getting popped up Pin
Raghunandan S21-Oct-04 17:34
Raghunandan S21-Oct-04 17:34 
Generalgive me samples for Screen capture with GDI,Thanks Pin
Guoguor21-Oct-04 17:24
Guoguor21-Oct-04 17:24 
GeneralRe: give me samples for Screen capture with GDI,Thanks Pin
David Crow22-Oct-04 4:49
David Crow22-Oct-04 4:49 
Generalusing CWebBrowser2 Pin
includeh1021-Oct-04 17:06
includeh1021-Oct-04 17:06 

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.