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

x
?
Solved

Activating pop-up menu in an ActiveX Control?

Posted on 1998-09-22
2
Medium Priority
?
269 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 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Read this article and get to know some best tips for outsourcing client PPC work to a white label PPC agency.
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

872 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