Click here to Skip to main content
15,914,444 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionhow to make a dialog under the main window? Pin
Jefferson Liu22-Oct-03 21:30
Jefferson Liu22-Oct-03 21:30 
AnswerRe: how to make a dialog under the main window? Pin
Ravi Bhavnani22-Oct-03 21:41
professionalRavi Bhavnani22-Oct-03 21:41 
GeneralRe: how to make a dialog under the main window? Pin
Atif Mushtaq22-Oct-03 23:03
Atif Mushtaq22-Oct-03 23:03 
AnswerRe: how to make a dialog under the main window? Pin
Anthony_Yio22-Oct-03 22:08
Anthony_Yio22-Oct-03 22:08 
Generalprint UCS2 character Pin
convert_sg22-Oct-03 21:23
convert_sg22-Oct-03 21:23 
GeneralRe: print UCS2 character Pin
Ravi Bhavnani22-Oct-03 21:42
professionalRavi Bhavnani22-Oct-03 21:42 
GeneralA question for the GURUs Pin
Anonymous22-Oct-03 21:20
Anonymous22-Oct-03 21:20 
GeneralRe: A question for the GURUs Pin
antlers23-Oct-03 8:21
antlers23-Oct-03 8:21 
The compiler figures out the layout of classes/structures in memory. Normally, there is a fixed offset from a pointer to a class object to a pointer to one of its members, sub-objects or base objects, and the compiler can figure out this offset only from the class definition. However, if class B has a virtual base A, the offset from a pointer to B to A is only known when the complete object C that may have multiple base classes that virtually inherit from A is defined. Since a lot of code will be using B without having any idea what C it may be a base object of, classes with virtual bases require a level of indirection. A hidden member is added to B (which you are calling vbptr) that points to the base object A. Code that references A through a B object is transparently changed to use this hidden member to find A at runtime, instead of relying on a fixed offset defined at compile time. When the compiler generates code to create an object of type C, it knows the layout of the complete object and will set the hidden member in B (and any other class with virtual base) appropriately (note that the object code to do this can not be incorporated in the constructor for C, since the constructor may be called when C is a sub-object rather than a complete object; instead the code is generated when the complete object is instantiated on the stack, globally or with new).

Virtual method calls with virtual base classes get really complicated. The compiler has to generate a vtbl for A for each complete virtually derived class C looking at the whole network of base classes in C.
GeneralGPS Pin
abc87622-Oct-03 21:02
abc87622-Oct-03 21:02 
GeneralRe: GPS Pin
Ted Ferenc22-Oct-03 21:49
Ted Ferenc22-Oct-03 21:49 
Generalregex Pin
xiaoxsql22-Oct-03 19:05
xiaoxsql22-Oct-03 19:05 
Generalabout voice chat between a client and a server Pin
yingkou22-Oct-03 19:00
yingkou22-Oct-03 19:00 
GeneralRe: about voice chat between a client and a server Pin
Atif Mushtaq22-Oct-03 21:22
Atif Mushtaq22-Oct-03 21:22 
GeneralRe: about voice chat between a client and a server Pin
yingkou24-Oct-03 20:01
yingkou24-Oct-03 20:01 
GeneralRestrict window space for child process Pin
paulb22-Oct-03 19:00
paulb22-Oct-03 19:00 
GeneralRe: Restrict window space for child process Pin
Ravi Bhavnani22-Oct-03 21:06
professionalRavi Bhavnani22-Oct-03 21:06 
GeneralRe: Restrict window space for child process Pin
paulb23-Oct-03 12:56
paulb23-Oct-03 12:56 
Generalabout voice chat between a client and a server Pin
yingkou22-Oct-03 18:55
yingkou22-Oct-03 18:55 
Generalsimple questions.... Pin
joshfl22-Oct-03 18:09
joshfl22-Oct-03 18:09 
GeneralRe: simple questions.... Pin
abc87622-Oct-03 20:54
abc87622-Oct-03 20:54 
GeneralRe: simple questions.... Pin
David Crow23-Oct-03 4:03
David Crow23-Oct-03 4:03 
GeneralRe: simple questions.... Pin
joshfl23-Oct-03 6:05
joshfl23-Oct-03 6:05 
GeneralGet printer status by parallel port programming Pin
Rapo Lee22-Oct-03 17:48
Rapo Lee22-Oct-03 17:48 
GeneralHelp with a C bug Pin
Sirrius22-Oct-03 16:36
Sirrius22-Oct-03 16:36 
GeneralRe: Help with a C bug Pin
Anthony_Yio22-Oct-03 22:00
Anthony_Yio22-Oct-03 22:00 

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.