I have a CDialog created by wizard named CDialogParent, then create a child dialog template has IDD= IDD_CHILD_DLG1, in this child dialog I put one button IDC_BTN1 (I don't create class handler for this child).
BOOL CDialogParent::OnInitDialog()
{
....
CDialog *pChild = new CDialog();
pChild->Create(IDD_CHILD_DLG1, this);
pChild->ShowWindow(SW_NORMAL);
}
Normally, I need to create new class handler CDialogChild for child and add message map like:
BEGIN_MESSAGE_MAP(CDialogChild, CDialog)
ON_BN_CLICKED(IDC_BTN1, &CDialogChild::OnBnClickedBtn1)
END_MESSAGE_MAP()
Problem that I want to catch control's message IDC_BTN1 of child dialog BUT by declare message map in CDialogParent like:
BEGIN_MESSAGE_MAP(CDialogParent, CDialog)
ON_BN_CLICKED(IDC_BTN1, &CDialogParent::OnBnClickedBtn1)
END_MESSAGE_MAP()
How to do this without create new class handler? Thanks for help!