Solved

ActiveX Events

Posted on 1997-12-19
4
882 Views
Last Modified: 2013-11-19
How do I get the ActiveX Events on a CView, NOT A DIALOG box? I have a control that sends click events(VB) and I need to trap them and process, but I can't get click events without ClassWiz and ClassWiz does not show ActiveX events on CView
0
Comment
Question by:SirThomas
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1312681
You'll need to do these by hand. If you take a look at the generated maps for the dialog, you can pretty much copy them directly into your view. Look for DECLARE_EVENTSINK_MAP() in your .h, and BEGIN_EVENTSINK_MAP() in your .cpp files.

0
 

Author Comment

by:SirThomas
ID: 1312682
I thought of that when I copy the lines from the dlg to my CView class I get the following errors:

D:\ActiveX Test1\ActiveX Test1View.cpp(131) : error C2509: '_GetBaseEventSinkMap' : member function not declared in 'CActiveXTest1View'
D:\ActiveX Test1\ActiveX Test1View.cpp(131) : error C2509: 'GetEventSinkMap' : member function not declared in 'CActiveXTest1View'
D:\ActiveX Test1\ActiveX Test1View.cpp(131) : warning C4273: 'protected: static struct AFX_EVENTSINKMAP const  CCmdTarget::eventsinkMap' : inconsistent dll linkage.  dllexport assumed.
D:\ActiveX Test1\ActiveX Test1View.cpp(131) : error C2491: 'CActiveXTest1View::CView::CWnd::CCmdTarget::eventsinkMap' : definition of dllimport static data member not allowed

I looked in the ON-Line help and these functions GetEventSinkMap are not even defind.

Next Guess
0
 
LVL 23

Accepted Solution

by:
chensu earned 50 total points
ID: 1312683
It seems that you didn't copy the part in the header file.
0
 

Author Comment

by:SirThomas
ID: 1312684
You were correct. I must have been missing one line. It took 5 time to get it to work. I wish the MS product was complete.
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
How to calculate times for developing software? 8 65
Looking for a specific application/software 2 104
mapAB Challlenge 35 128
Capture logon name 13 48
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 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

18 Experts available now in Live!

Get 1:1 Help Now