Link to home
Start Free TrialLog in
Avatar of kobuse
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(CMainFrame, CMDIFrameWnd)
//{{AFX_EVENTSINK_MAP(CMainFrame)
ON_EVENT(CMainFrame, IDC_TREECTRL1, -600 /* Click */, OnClickTreectrl1, VTS_NONE)
//}}AFX_EVENTSINK_MAP END_EVENTSINK_MAP()
void CMainFrame::OnClickTreectrl1()
{
// 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
Avatar of galkin
galkin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kobuse
kobuse

ASKER

Thanks, the second idea sounds interesting too.
Avatar of kobuse

ASKER

Thanks, the second idea sounds interesting too.
Avatar of kobuse

ASKER

Grade A.