kobuse
asked on
ActiveX control in a Dialog Bar
Platform: VC++ 5.0 on NT4.0
I am using an ActiveX Control (Microsoft TreeView version 5.0) in a dialog bar. However I don't get any events from this ActiveX control.
I created the dialog bar in OnCreate() of the CMainFrame class and the events from all controls on the dialog bar are handled in the CMainFrame class itself. For other controls it works fine but in the case of the ActiveX control the CMainFrame doesn't seem to get any Events fired from the ActiveX control.
This is the code for handling an event from the AtiveX control:
BEGIN_EVENTSINK_MAP(CMainF rame, CMDIFrameWnd)
//{{AFX_EVENTSINK_MAP(CMai nFrame)
ON_EVENT(CMainFrame, IDC_TREECTRL1, -600 /* Click */, OnClickTreectrl1, VTS_NONE)
//}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()
void CMainFrame::OnClickTreectr l1()
{
// TODO: Add your control notification handler code here
AfxMessageBox("Inside OnClickTreectrl1()");
}
NOTE: The same control works fine when I create it as part of a dialog box
and handle events in a CDialog derived class or CFormView derived class.
I am using an ActiveX Control (Microsoft TreeView version 5.0) in a dialog bar. However I don't get any events from this ActiveX control.
I created the dialog bar in OnCreate() of the CMainFrame class and the events from all controls on the dialog bar are handled in the CMainFrame class itself. For other controls it works fine but in the case of the ActiveX control the CMainFrame doesn't seem to get any Events fired from the ActiveX control.
This is the code for handling an event from the AtiveX control:
BEGIN_EVENTSINK_MAP(CMainF
//{{AFX_EVENTSINK_MAP(CMai
ON_EVENT(CMainFrame, IDC_TREECTRL1, -600 /* Click */, OnClickTreectrl1, VTS_NONE)
//}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()
void CMainFrame::OnClickTreectr
{
// TODO: Add your control notification handler code here
AfxMessageBox("Inside OnClickTreectrl1()");
}
NOTE: The same control works fine when I create it as part of a dialog box
and handle events in a CDialog derived class or CFormView derived class.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, the second idea sounds interesting too.
ASKER
Grade A.
ASKER