Solved

ActiveX control in a Dialog Bar

Posted on 1997-11-07
4
303 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
Comment Utility
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
Comment Utility
Thanks, the second idea sounds interesting too.
0
 

Author Comment

by:kobuse
Comment Utility
Thanks, the second idea sounds interesting too.
0
 

Author Comment

by:kobuse
Comment Utility
Grade A.
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

762 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

6 Experts available now in Live!

Get 1:1 Help Now