Solved

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

Posted on 1997-12-09
6
280 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MSVCR80.dll crash 2 134
Handle Exceptions during instantiation 28 411
C++ dll will not run on machine without VS installed 10 80
trigs fail! I thought I knew how to do trignometry 3 56
Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
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…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
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.

863 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

24 Experts available now in Live!

Get 1:1 Help Now