Solved

ActiveX Events

Posted on 1997-12-19
4
877 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

13 Experts available now in Live!

Get 1:1 Help Now