Solved

ActiveX control in a Dialog Bar

Posted on 1997-11-07
4
305 Views
Last Modified: 2013-11-19
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.
0
Comment
Question by:kobuse
  • 3
4 Comments
 
LVL 7

Accepted Solution

by:
galkin earned 100 total points
ID: 1309547
You can handle event in your dialog bar derived class. Add event sink macros to this class. And also you can handle "reflected events" from ActiveX control in your control's wrapper class. Instead of ON_EVENT macro use ON_EVENT_REFLECT macro.
0
 

Author Comment

by:kobuse
ID: 1309548
Thanks, the second idea sounds interesting too.
0
 

Author Comment

by:kobuse
ID: 1309549
Thanks, the second idea sounds interesting too.
0
 

Author Comment

by:kobuse
ID: 1309550
Grade A.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to calculate times for developing software? 8 67
substring method in java 1 122
sumHeights2  challenge 7 105
Increment column based of a FK 8 23
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question