Link to home
Start Free TrialLog in
Avatar of gdesclaux
gdesclaux

asked on

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?
Avatar of galkin
galkin

Call FireClick() stock event method to fire click event. You can use ActiveX test container to see event fired.
Avatar of gdesclaux

ASKER

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 ?
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.
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 ?
ASKER CERTIFIED SOLUTION
Avatar of Pozzo
Pozzo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i've just seen it in the Developer's Reference from Microsoft Forms 2.0 Controls...