Solved

Activating pop-up menu in an ActiveX Control?

Posted on 1998-09-22
2
254 Views
Last Modified: 2013-11-28
I have a pop-up menu assigned to the right button of the mouse. The problem I faced is that the menu are all disabled and I couldn't use the mouse to do any selection. I tried to use EnableMenuItem to enable the items in the pop-up menu but it still didn't enable it. Can anyone please help me with this.
And also in which function should my command be assigned? Because in CWnd, I would place my command in the On_Command function. But in the ActiveX program, I can't seem to utilise the On_OcmCommand in the function.
0
Comment
Question by:g7677
2 Comments
 
LVL 2

Accepted Solution

by:
igroove earned 100 total points
ID: 1173500
If you're using Visual C++ 4.1 or higher...
.open your menu in the resource view (as if you were going to modify it).  Enter the class wizard.  It'll ask you if you want to create a new class or link it to an existing one.  Link it to your class file where your control lives.  Make sure it follows the AFX macros structure (the //{{AFX_MSG() and all those wizard-like things) before you do this.  It should hook it up for you (that is, hook up the proper command routing).  Then its just like doing regular MFC. (ON_COMMAND(x, f)...)

Visual C++, MFC 4.2 note:
Are you just intercepting the WM_RBUTTON message?  If keyboard jocks are hitting the context menu key...intercept WM_CONTEXT...that'll take care of any input way they want. Rbutton, keyboard clicks, etc.
0
 

Author Comment

by:g7677
ID: 1173501
My pop-up menu is created in the program itself upon right mouse click. So I can't open the menu in the resource view or go into the class wizard for the menu.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Owning a franchise can be the dream of a lifetime. It provides a chance for economic growth. You can be as successful as you want.  To make your franchise successful, you need to market it successfully. Here are six of the best marketing strategies …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

747 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

12 Experts available now in Live!

Get 1:1 Help Now