NH> void CComUI::OnCancel()
NH> {
NH> CWnd * pbutton = GetDlgItem(IDCANCEL);
NH> pbutton->EnableWindow(FALSE);
NH> .
NH> .
NH> .
NH> CDialog::OnCancel();
NH> }
CD> CDialog::OnCancel() is a virtual function. It's implementation is
CD> really simple, it just calls CDialog::EndDialog() passing IDCANCEL.
It seems to me like that's circular. Since the object calling
OnCancel() is a CComUI object, wouldn't the virtual call really be
regressive?
CD> If it's something derived from CDialog and this something has no
CD> override for OnCancel(), then CDialog::OnCancel() is called.
That was at the heart of my question: the direction of the
inheritance tree searched when a call is made to a virtual function. I
had it wrong apparently - the real direction of search is to start at
the child and go to the parents, then to the grandparents, then to the
great grand parents, then to the great-great grandparents, etc. ad
nauseum.
* KWQ/2 1.2i *
--- TMail v1.31.5
---------------
* Origin: Diablo Valley PCUG-BBS, Walnut Creek, CA 510/943-6238 (1:161/55)
|