Click here to Skip to main content
15,898,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VS2005 toolbar messages Pin
Davros2-Feb-08 8:08
Davros2-Feb-08 8:08 
GeneralRe: VS2005 toolbar messages Pin
Mark Salsbery2-Feb-08 8:18
Mark Salsbery2-Feb-08 8:18 
GeneralRe: VS2005 toolbar messages Pin
Davros3-Feb-08 0:15
Davros3-Feb-08 0:15 
GeneralRe: VS2005 toolbar messages Pin
Davros4-Feb-08 8:13
Davros4-Feb-08 8:13 
QuestionHow to run NT Service on Windows Vista Pin
Abhijit A2-Feb-08 0:12
Abhijit A2-Feb-08 0:12 
AnswerRe: How to run NT Service on Windows Vista Pin
Mark Salsbery2-Feb-08 7:52
Mark Salsbery2-Feb-08 7:52 
GeneralVirtual function and multiple inheritance Pin
George_George1-Feb-08 21:12
George_George1-Feb-08 21:12 
GeneralRe: Virtual function and multiple inheritance Pin
Bram van Kampen1-Feb-08 22:50
Bram van Kampen1-Feb-08 22:50 
Well this is realy a question on how the compiler designers decided how the compiler should lay out the code, and why. The answer takes a Lazy chair, a glass of wine and a cigar, but there we go.
When the Ancestors of both Foo and Goo were written, No one was aware (at least conceptually) that at a later date someone might want to combine both in a single multiple inherrited decendant. So, the compiler has to lay out the code inrespect of both Foo and Goo in the conventional way, i.e. with the __vtable pointer at the head of the class. with multiple inheritance, we include a copy of each base class in the decendant. The Casting operator is implemented at compile time, so (Foo*)(&Derived) effectively returns a Pointer to the 'Foo' part of the Derrived class. As as stated before the Ancestors of Foo are unaware of the Derived Class, they would expect the __vtable to be at the head of what the cast points at. And of course, the same would apply to Goo. To combine the two __vtable's into one sounds like a good idea, BUT:
The ancestral code for Foo and Goo may well reside in a library to which there is no access when 'Derived' is compiled. The solution with the two __vtable pointers leaves the problem of calling the correct virtual function at the place where it belongs, namely there where the Derived Multiple Inheritance is compiled into code. In a nutshell I cannot see a way of combining the two vtables, without also having to recompile ancestrial code.

Hope this explains it clearly (sort of)


Regards,

Smile | :)

Bram van Kampen

GeneralRe: Virtual function and multiple inheritance Pin
George_George1-Feb-08 23:14
George_George1-Feb-08 23:14 
QuestionCString::Empty() Pin
gReaen1-Feb-08 20:01
gReaen1-Feb-08 20:01 
GeneralRe: CString::Empty() Pin
John R. Shaw1-Feb-08 23:00
John R. Shaw1-Feb-08 23:00 
GeneralRe: CString::Empty() Pin
Bram van Kampen1-Feb-08 23:00
Bram van Kampen1-Feb-08 23:00 
GeneralRe: CString::Empty() Pin
CPallini2-Feb-08 5:13
mveCPallini2-Feb-08 5:13 
Questionhow to hide / show menubar in mfc mdi application? Pin
Prasann Mayekar1-Feb-08 19:14
Prasann Mayekar1-Feb-08 19:14 
Questionpicture box problem Pin
trioum1-Feb-08 18:23
trioum1-Feb-08 18:23 
GeneralRe: picture box problem Pin
Hamid_RT1-Feb-08 18:32
Hamid_RT1-Feb-08 18:32 
GeneralRe: picture box problem Pin
trioum1-Feb-08 23:36
trioum1-Feb-08 23:36 
GeneralRe: picture box problem Pin
Hamid_RT2-Feb-08 2:09
Hamid_RT2-Feb-08 2:09 
QuestionHow to share controls between property pages Pin
tigre2151-Feb-08 17:37
tigre2151-Feb-08 17:37 
AnswerRe: How to share controls between property pages Pin
Joan M2-Feb-08 5:04
professionalJoan M2-Feb-08 5:04 
GeneralRe: How to share controls between property pages Pin
tigre2154-Feb-08 8:13
tigre2154-Feb-08 8:13 
GeneralRe: How to share controls between property pages Pin
Joan M4-Feb-08 9:21
professionalJoan M4-Feb-08 9:21 
Questionhow to read windows2003 IPsec Settings Pin
jianxin08051-Feb-08 15:14
jianxin08051-Feb-08 15:14 
GeneralRunning Software on a remote machine Pin
Bram van Kampen1-Feb-08 14:44
Bram van Kampen1-Feb-08 14:44 
GeneralCreateHardwareEventMoniker Pin
act_x1-Feb-08 12:54
act_x1-Feb-08 12:54 

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.