Solved

ActiveX Events

Posted on 1997-12-19
4
891 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Add content to output file 4 72
Whole sheet autoscrub still needed 19 54
withoutTen challenge 14 140
Is there a simple front-end menu system. 9 146
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…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Suggested Courses

734 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