Re: Deriving from a class derived from a CDialog
Joseph M. Newcomer wrote:
See my essay on this topic on my MVP Tips site. It applies to deriving from CDialog,
CFormView, and CPropertyPage. I use it all the time; I even go back and read my own essay
when I need to do it, to remind me of all the details.
Are you refering to this essay: "Subclassing Dialogs and Property Pages" ?
Because I think I already do the passing of the resource ID.
Here is the original code of the CTab class.
class MyTabCtrl :: public CTabCtrl
class CTab : public CDialog
explicit CTab(LPCTSTR lpszTemplateName, CWnd* pParentWnd = NULL)
: CDialog(lpszTemplateName, pParentWnd)
explicit CTab(UINT nIDTemplate, CWnd* pParentWnd = NULL)
: CDialog(nIDTemplate, pParentWnd)
CTab() : CDialog()
virtual void TabSelected()
virtual void TabDeselected()
Now I make my tabs like
class CTabEPC : public CMyTabCtrl::CTab
and the constructor is
CTabEPC::CTabEPC(CWnd* pParent /*=NULL*/)
: CMyTabCtrl::CTab(CTabEPC::IDD, pParent)
, [variable initialization]
So this should essentially be what your essay suggests. But the problem persists that
visual studio 2008 looses its ability to add event handlers to the CTabEPC class.
I select a control in the resource editor and then start the 'add event handler wizard'.
Anytime I select one of the CMyTabCtrl::CTab derived classes the wizard will not present
any events for selection. Whereas when I select a directly CDialog derived class it works
So how do I get the functionallity of the event handler wizard back?
Note: a "tab" control uses "tabs". I do not know what a "tabulator control" is, but a
"tabulator" was an early computing device that used punched cards and was programmed with
a wired control panel.
I meant the tab-control.