Solved

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

Posted on 1997-12-09
6
279 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
  • 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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

708 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

17 Experts available now in Live!

Get 1:1 Help Now