MinnisotaFreezing
Programmer
Hey all,
I have a CDialog with a ListCtrl and 3 buttons, but I don't use the buttons, they are not visible. I then derive a new class, UserDialog, from that dialog and enable the buttons. Obviously, I want to do OnButton1. I can easily do this in my parent class using message maps, but the thing is, my derived class does not have that infrastructure. I can add the message mapping to the parent class as virtual, then override the functions in my derived class, but that seems wastfull. Why add the functions to the parent class when I only want to use them in the derived class.
Does this make sense? I want to add message mapping to only the derived class, but do not know how becuase usually the message mapping functions are in place already. I tried just copying this part
BEGIN_MESSAGE_MAP(AccRecReport, CDialog)
//{{AFX_MSG_MAP(AccRecReport)
ON_BN_CLICKED(IDC_FILTER, OnInitDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
but that obviosly was not going to work.
Any ideas or tips would be great.
CJB
I have a CDialog with a ListCtrl and 3 buttons, but I don't use the buttons, they are not visible. I then derive a new class, UserDialog, from that dialog and enable the buttons. Obviously, I want to do OnButton1. I can easily do this in my parent class using message maps, but the thing is, my derived class does not have that infrastructure. I can add the message mapping to the parent class as virtual, then override the functions in my derived class, but that seems wastfull. Why add the functions to the parent class when I only want to use them in the derived class.
Does this make sense? I want to add message mapping to only the derived class, but do not know how becuase usually the message mapping functions are in place already. I tried just copying this part
BEGIN_MESSAGE_MAP(AccRecReport, CDialog)
//{{AFX_MSG_MAP(AccRecReport)
ON_BN_CLICKED(IDC_FILTER, OnInitDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
but that obviosly was not going to work.
Any ideas or tips would be great.
CJB