Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: how to schedule a a thread to a specific CPU? Pin
Michael Dunn4-Sep-03 13:20
sitebuilderMichael Dunn4-Sep-03 13:20 
GeneralRe: how to schedule a a thread to a specific CPU? Pin
Anonymous5-Sep-03 13:15
Anonymous5-Sep-03 13:15 
GeneralNeed for derived class to show base clase object. Pin
WREY4-Sep-03 12:29
WREY4-Sep-03 12:29 
Generalbad design Pin
dog_spawn4-Sep-03 12:46
dog_spawn4-Sep-03 12:46 
GeneralTalk is cheap!! Show me the money!! Pin
WREY4-Sep-03 14:29
WREY4-Sep-03 14:29 
GeneralEr Pin
dog_spawn4-Sep-03 16:36
dog_spawn4-Sep-03 16:36 
GeneralRe: Need for derived class to show base clase object. Pin
Alvaro Mendez4-Sep-03 17:28
Alvaro Mendez4-Sep-03 17:28 
GeneralRe: Need for derived class to show base clase object. Pin
WREY4-Sep-03 21:17
WREY4-Sep-03 21:17 
Thanks for replying.

I am NOT disputing the compiler at any time is wrong; just the opposite (which is why I am still looking for a way to get what I'm trying to accomplish.)

It is because the compiler is right, why the code (the way it's shown in the example) is "showing B's data instead of A's." By that I mean, because 'ShowExpandedInfo' is activated from inside a B's function, the "this" pointer is physically and logically referring to 'B' as its object, and is what gets shown. It has nothing here to do with 'B' being a part of 'A' due to the inheritance relationship.

While it is true that B's data is also A's (due to the inheritance relationship), the converse is NOT true (that 'A' is a part of 'B'). Therefore, when 'B' uses a pointer to refers to data (as "this" in the case at hand), even if that pointer could be used to access A's data, what you end up getting, is strictly B's data.

Yes, there is the matter of explicit casting, but that is something I prefer to stay away from (for the time being) and use ONLY as the very last resort.

Thanks again for replying. Wink | ;)


William

Fortes in fide et opere!
GeneralRe: Need for derived class to show base clase object. Pin
Jason Henderson4-Sep-03 18:24
Jason Henderson4-Sep-03 18:24 
GeneralRe: Need for derived class to show base clase object. Pin
WREY4-Sep-03 22:25
WREY4-Sep-03 22:25 
GeneralSetting intermediate files path to a global folder using an environment variable Pin
Jean-Marc Molina4-Sep-03 12:08
Jean-Marc Molina4-Sep-03 12:08 
QuestionHow to open a folder using MFC Pin
nachilau4-Sep-03 10:57
nachilau4-Sep-03 10:57 
AnswerRe: How to open a folder using MFC Pin
Ravi Bhavnani4-Sep-03 11:13
professionalRavi Bhavnani4-Sep-03 11:13 
GeneralRe: How to open a folder using MFC Pin
nachilau4-Sep-03 12:01
nachilau4-Sep-03 12:01 
GeneralRe: How to open a folder using MFC Pin
Rickard Andersson204-Sep-03 12:09
Rickard Andersson204-Sep-03 12:09 
GeneralRe: How to open a folder using MFC Pin
Ravi Bhavnani4-Sep-03 12:43
professionalRavi Bhavnani4-Sep-03 12:43 
GeneralScreen Coordinates/Front-Back Pin
DougW484-Sep-03 9:22
DougW484-Sep-03 9:22 
GeneralRe: Screen Coordinates/Front-Back Pin
PJ Arends4-Sep-03 10:01
professionalPJ Arends4-Sep-03 10:01 
GeneralRe: Screen Coordinates/Front-Back Pin
dog_spawn4-Sep-03 12:47
dog_spawn4-Sep-03 12:47 
GeneralAntivirus Pin
Anonymous4-Sep-03 9:22
Anonymous4-Sep-03 9:22 
GeneralRe: Antivirus Pin
David Crow4-Sep-03 9:32
David Crow4-Sep-03 9:32 
GeneralRe: Antivirus Pin
dog_spawn4-Sep-03 12:51
dog_spawn4-Sep-03 12:51 
Questionhow to access the view from the doc? Pin
Binayak4-Sep-03 9:18
Binayak4-Sep-03 9:18 
AnswerRe: how to access the view from the doc? Pin
Larry J. Siddens4-Sep-03 9:28
Larry J. Siddens4-Sep-03 9:28 
AnswerRe: how to access the view from the doc? Pin
David Crow4-Sep-03 9:38
David Crow4-Sep-03 9:38 

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.