Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8582287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:15:19+00:00 2026-06-11T21:15:19+00:00

In MFC how to remove a menu-item of POPUP type. RemoveMenu() either take ID

  • 0

In MFC how to remove a menu-item of POPUP type. RemoveMenu() either take ID or position. Since, there is no ID for POPUP menu, option left is by using position.

But I am not getting how and where I can call RemoveMenu().

File  Edit  Test
            Test_submenu_1
            Test_submenu_2
            Test_submenu_3 > submenu_3_item_1
            Test_submenu_4
            Test_submenu_5

I want to remove Test_submenu_3? I am not getting how do find CMenu object for Test so that I can call RemoveMenu() by passing position “2” for submenu_3_item_1.

Any suggestion for doing this will be greatly appreciated.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T21:15:21+00:00Added an answer on June 11, 2026 at 9:15 pm

    You cannot use LoadMenu, since this function does just that.

    After modifying loaded menu it is killed when menu object used to load it goes out of scope. You have to modify menu that is currently used.

    Your menu is a popup part of the main menu, second in position. It contains 5 items and second one is another popup. To my understanding, you want to remove this item and popup of this item.
    To make it work you will have to ask main window for the current menu:

    CMenu* pMenu = GetMenu(); // get the main menu
    CMenu* pPopupMenu = pMenu->GetSubMenu(2);//(Test menu with item....)
    pPopupMenu->RemoveMenu(2, MF_BYPOSITION);
    

    Of course, this code is from the main frame. If you want to use it elsewhere, you will have to access all using pointer to the main frame.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an easy way to remove the close button from an MFC feature
How do you remove a MFC command handler like ON_UPDATE_COMMAND_UI from a C++ file?
In MFC DLL Why do I have to declare theApp using CWinApp theApp;,or else
To think ... there I have been happily programming in an MFC riddled environment
I have created an activex control using mfc and added the control to a
I have an MFC dialog in which there are two radio buttons. I have
I am using mfc CDialog. I need to show the close and minimize/maximize button,
I'm using MFC, and I'm trying to draw an image to the screen. I've
i am using vs2010 and whenever i build any windows application (not using mfc
I'm using C++/CLI on Windows. It's an MFC app built with /clr. I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.