Solved

ActiveX control in a Dialog Bar

Posted on 1997-11-07
4
304 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Show shut-down message as Windows 8 shuts down. 9 85
only14 challenge 19 68
post4 challenge 28 93
Change to event 1 101
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

920 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now