Click here to Skip to main content
16,005,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: C++ HELL : Object Addresses Pin
RichardS11-Mar-05 1:09
RichardS11-Mar-05 1:09 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux11-Mar-05 1:15
vikramlinux11-Mar-05 1:15 
GeneralRe: C++ HELL : Object Addresses Pin
RichardS11-Mar-05 3:34
RichardS11-Mar-05 3:34 
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen11-Mar-05 1:14
jan larsen11-Mar-05 1:14 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux11-Mar-05 1:20
vikramlinux11-Mar-05 1:20 
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen13-Mar-05 22:13
jan larsen13-Mar-05 22:13 
GeneralRe: C++ HELL : Object Addresses Pin
vikramlinux13-Mar-05 22:16
vikramlinux13-Mar-05 22:16 
GeneralRe: C++ HELL : Object Addresses Pin
TheGreatAndPowerfulOz11-Mar-05 16:27
TheGreatAndPowerfulOz11-Mar-05 16:27 
What you've basically got here is something that is essentially the same as the following: (note this is not inheritance, but aggregation --- done to illustrate a point)

struct Derived
{
    Base1 b1;
    Base2 b2;
}

void main()
{
  Derived D;
  Base1* bptr1 = &D.b1;
  Base2* bptr2 = &D.b2;
}

The reason (Base1*)&D != (Base2*)&D is that each base class has to occupy some part of derived class Derived. In other words, Derived is composed of Base1 and Base2, so when you get a pointer to each of the base classes, it will point at the part of D that is that base class. Try switching the order of the base classes, you will see that the pointer values switch. That will illustrate that pointers to each of the base classes point to the part of Derived that is made up by the respective base class.
GeneralRe: C++ HELL : Object Addresses Pin
jan larsen13-Mar-05 22:16
jan larsen13-Mar-05 22:16 
Generalwindows.h / MessageBox Pin
doneirik11-Mar-05 0:15
doneirik11-Mar-05 0:15 
GeneralRe: windows.h / MessageBox Pin
vikramlinux11-Mar-05 0:53
vikramlinux11-Mar-05 0:53 
GeneralRe: windows.h / MessageBox Pin
Mike Dimmick11-Mar-05 2:21
Mike Dimmick11-Mar-05 2:21 
GeneralProperty headache Pin
Lord Phoenix10-Mar-05 23:06
Lord Phoenix10-Mar-05 23:06 
GeneralRe: Property headache Pin
Mircea Puiu11-Mar-05 4:27
Mircea Puiu11-Mar-05 4:27 
GeneralRe: Property headache Pin
Lord Phoenix11-Mar-05 5:26
Lord Phoenix11-Mar-05 5:26 
GeneralRe: Property headache Pin
includeh1011-Mar-05 4:32
includeh1011-Mar-05 4:32 
GeneralRe: Property headache Pin
Lord Phoenix11-Mar-05 5:27
Lord Phoenix11-Mar-05 5:27 
GeneralMDI Document with data from UDP Pin
schultz.tom10-Mar-05 22:54
schultz.tom10-Mar-05 22:54 
GeneralRe: MDI Document with data from UDP Pin
Neville Franks11-Mar-05 2:56
Neville Franks11-Mar-05 2:56 
GeneralRe: MDI Document with data from UDP Pin
schultz.tom11-Mar-05 8:42
schultz.tom11-Mar-05 8:42 
GeneralRe: MDI Document with data from UDP Pin
Neville Franks11-Mar-05 9:39
Neville Franks11-Mar-05 9:39 
GeneralRe: MDI Document with data from UDP Pin
schultz.tom11-Mar-05 12:21
schultz.tom11-Mar-05 12:21 
GeneralCreating MDI Child windows Pin
laiju10-Mar-05 22:37
laiju10-Mar-05 22:37 
QuestionHow to set background colours for texts in a treeCtrl or CTreeView? Pin
AnoopVarma10-Mar-05 21:36
AnoopVarma10-Mar-05 21:36 
AnswerRe: How to set background colours for texts in a treeCtrl or CTreeView? Pin
Mircea Puiu11-Mar-05 5:05
Mircea Puiu11-Mar-05 5:05 

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.