Solved

Activating pop-up menu in an ActiveX Control?

Posted on 1998-09-22
2
261 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

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

Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this blog, I will share you some basic tips for content marketing and to rank your website on Google.
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.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

749 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