Instead of declaring ON_MESSAGE macros for the Button Clicked events, you need to learn how to use
Class Wizard[
^] for creating message handling for the controls.
To handle Button Clicked events in your dialogs the following methods should be defined:
afx_msg void OnBnClickedButton1();
And the handler for the button should be mapped using this macro:
BEGIN_MESSAGE_MAP(CFirstDlg, CDialog)
...
ON_BN_CLICKED(IDC_BUTTON1, &CFirstDlg::OnBnClickedButton1)
...
END_MESSAGE_MAP()
...
void CFirstDlg::OnBnClickedButton1()
{
try
{
CFirstDlg::CapturePhoto();
}
catch(const std::exception& rSEX)
{
ShowException(rSEX);
}
return 0;
}
Similarly, define the message handlers for the button on the second dialog