thx,
thx,
Give an example of what you are asking. Are you talking about OOP?
Kuphryn
Window Frames concept,Originally posted by kuphryn
Give an example of what you are asking. Are you talking about OOP?
Kuphryn
Like VC++ -> MFC,
getParent() == getOwner(); // is the same thing. why????
I am familiar with this concept in VCL, and my guess is that it is the same in MFC.
The owner is the object responsible for creating and destroying an aggregated or linked object. Normally an owner destroys the objects it owns in its destructor.
A parent is an object which has a visual interface. Visual control objects appear in the space of their parent. For example, a button may have a parent window.
The owner and parent objects are not necessarily the same.
I think of this slightly differently.
Parent is usually a control or dialog, not a window. The parent of a control or dialog is the one who gets its windows msg's. If the parent is Destroyed so will the child. The child can not exist without the parent. The child is usually asociated with a single parent.
ie any control created at run time (without the resource editor)
Owner is usually a dialog or window not a control. The owned item can exist independently of its owner but will also be closed if the owner does. Many different items may 'own' the item.
ie a dialog to show a tasks progress.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill