?
Solved

Activating pop-up menu in an ActiveX Control?

Posted on 1998-09-22
2
Medium Priority
?
263 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
igroove earned 200 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
There is a massive demand for content on the web right now, and it doesn't look like it's going to stop any time soon. But, if you are running a business blog, it's not just enough to offer your audience lots of content. It needs to be high-quality…
Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

752 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