How to catch the OLE control event in MFC app? fired by ActiveX control which is created
I dynamically create some ActiveX controls in my MFC app. I want to handle their event such as click, dblclick. But I don't know what kind of message should I catch where to put the code to catch them. I can add the event handler if I put the these control on the dialog window as I design the GUI. The code automatically ad开发者_StackOverflowded by MFC is below:
BEGIN_EVENTSINK_MAP(CButtonMsgDlg, CDialog)
ON_EVENT(CButtonMsgDlg, IDC_CWBOOLEAN1, DISPID_DBLCLICK, CButtonMsgDlg::DblClickCwboolean1, VTS_NONE)
END_EVENTSINK_MAP()
void CButtonMsgDlg::DblClickCwboolean1()
{
// TODO: Add your message handler code here
}
If you already know the event type at compile time, but don't know the control ids, check How to create a sink interface in a MFC-based COM client
精彩评论