Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to capture mouse events in a CDocument?

Posted on 2014-10-10
1
Medium Priority
?
169 Views
Last Modified: 2014-10-10
Hello,

I have a class derived from CDocument and need to capture a left mouse double click event. How this can be done?

Thanks in advance!

Erik
0
Comment
Question by:WH
[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
1 Comment
 
LVL 31

Accepted Solution

by:
Zoppo earned 2000 total points
ID: 40372466
Hi whselfinvest,

this usually is not done done in the CDocument-derived class since this doesn't fit to MVC paradigma. The common way is to add a message handler for WM_LBUTTONDBLCLK in the related CView-derived class, there it's possible to access the document (via CView::GetDocument) to execute any actions on it.

A description for how to add such a message handler can be found here: http://msdn.microsoft.com/en-us/library/aa232230%28v=vs.60%29.aspx

Hope that helps,

ZOPPO
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

722 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