[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 302
  • Last Modified:

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

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
gdesclaux
Asked:
gdesclaux
  • 3
  • 2
1 Solution
 
galkinCommented:
Call FireClick() stock event method to fire click event. You can use ActiveX test container to see event fired.
0
 
gdesclauxAuthor Commented:
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
 
galkinCommented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
gdesclauxAuthor Commented:
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
 
PozzoCommented:
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
 
gdesclauxAuthor Commented:
i've just seen it in the Developer's Reference from Microsoft Forms 2.0 Controls...

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now