Solved

Visual c++ 5.0, ActiveX and RightClick Event...

Posted on 1997-12-09
6
286 Views
Last Modified: 2012-08-14
Hi,

I'm trying to build an activeX control in VC++ 5.0.
I'm using the MFC ActiveX ControlWizard.
My ActiveX Control works fine but now i want to manage event, and especially the rightclick...

I've add Click event to the interface (the odl file) using the classwizard. I've made that with the classwizard of vc++ choosing the ActiveX event tab. It's implemented as a stock event.
Then i've added the event WM_RBUTTONUP in the control itself, always using the ClassWizard, in the Message Maps tab. The classwizard has added the OnRButtonUp method and i've customized the methode to do what i want...

BUT !

But it doesnt work !
I dont catch the rightclick event but the DOUBLE rightclick event !! why ? what's wrong in my implementation of the activeX control?
0
Comment
Question by:gdesclaux
[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
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:galkin
ID: 1175405
Call FireClick() stock event method to fire click event. You can use ActiveX test container to see event fired.
0
 

Author Comment

by:gdesclaux
ID: 1175406
tell me more...

When i've added the Click event in the ActiveX event tab of the classwizard i've choosen the stock implementation. This Click event is automatically linked to the FireClick() stock event method... so ? what do u mean ? where i do call the fireclick()
method in my code ? or do u mean that i'll should overloaded the fireclick() methode in my activeX control ?
0
 
LVL 7

Expert Comment

by:galkin
ID: 1175407
I didn't step into code but to my experience some times click event is not fired so I hade to call this function explicity. You can step into COleControl::OnRButtonDown and check why FireClick is not called.
0
Independent Software Vendors: 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!

 

Author Comment

by:gdesclaux
ID: 1175408
i explicitly call FireClick() in my OnRButtonDown method...
and behavior of the activeX is the same... i catch only
the right double click... not some times, but all the time !

i've followed step-by-step the inline help : ActiveX Controls: Adding Custom Events to an ActiveX Control and it doesnt work...

so i do something easier :
i create an activeX and add the click event as ActiveX event in the classwizard, the i add the OnClick event in the message map tab of the classwizard to add the event in my control.
and guess ? when i left click on my mouse i properly catch the event... and when i right click i dont catch event...
or the click event is suppose to manage the left, the center or the right button...
and ! if i double right click the event is catched !

what's going on with it ?
0
 

Accepted Solution

by:
Pozzo earned 100 total points
ID: 1175409
Left-clicking changes the value of a control, thus it initiates the Click event. Right-clicking does not change the value of the control, so it does not initiate the Click event.

So you don't do that !

Use the RightMouseDown event instead...
0
 

Author Comment

by:gdesclaux
ID: 1175410
i've just seen it in the Developer's Reference from Microsoft Forms 2.0 Controls...

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

707 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