TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: CHRIS DOWNS
from: NEIL HELLER
date: 1997-10-18 11:44:00
subject: C++ Inheritance

I have a question about inheritance and the flow of logic.  There is 
a class, CCommUI, which is decended from CDialog.  CComUI contains a
method, OnCancel, which is included in the appropriate message map to
be called whenever the "Cancel" button in the modal dialog box (the
CComUI object) is pressed.
A snippet of code goes something like this:
void CComUI::OnCancel()
{
    CWnd * pbutton = GetDlgItem(IDCANCEL);
    pbutton->EnableWindow(FALSE);
           .
           .
           .
    CDialog::OnCancel();
}
The question I have is this:
Does the line containing the call to the parent "percolate" up to the
child?  What is the purpose of this call in the first place if
CDialog::OnCancel() had never been specifically fleshed out (or even
mentioned) anywhere in the code?
As an aside, I commented this line out and the software ran as
expected.  With that line left in the code there was always a premature
closing of the dialog box.  Does this mean that the method,
CDialog::OnCancel(), was performing some action on its own without me
even being aware of it?
 * KWQ/2 1.2i * 
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.