Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

not to disable undo menu

Posted on 2002-04-03
3
Medium Priority
?
331 Views
Last Modified: 2013-11-20
In CEditView, if  I select some text and cut it, my Undo menu gets disabled. Also my toolbar button to handle Undo command gets greyed. I want to control the enable/disable of these by myself. How can I do it?
0
Comment
Question by:britney
[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
3 Comments
 
LVL 4

Accepted Solution

by:
mblat earned 400 total points
ID: 6915672
first you need to set

m_bAutoMenuEnable  = FALSE;

it is member of CFrameWnd, so if you are using standard SDI/MDI app you can do it in CMainFrame constractor

Downside here is that now you need to overwrite UPDATE_COMMAND_UI handler for EVERY menu item you want to enable/disable based on certain conditions.

something like this:

void CMainFrame::OnUpdateFileLogon(CCmdUI* pCmdUI)
{
     if (SecurityDLL_IsUserLoggedOn())
          pCmdUI->Enable(FALSE);
}
otherwise they will always be enabled.

Hope it helps
0
 

Author Comment

by:britney
ID: 6915934
hi mblat,
I set m_bAutoMenuEnable  = FALSE; in constructor of my CMainFrame. It still disables the menu and toolbar button on using Cut. It's ok for  me if they never get disabled. Comment with m_bAutoMenuEnable in AFXWIN.H says:

BOOL m_bAutoMenuEnable;
          // TRUE => menu items without handlers will be disabled

I think this is for automatic enabling/disabling of menu items with/without handlers. What I need is the  menu item never gets automatically disabled.



0
 
LVL 4

Expert Comment

by:mblat
ID: 6916197
// TRUE => menu items without handlers will be disabled

so, did you define handler?  try to define it and then try to define UPDATE_COMMAND_UI handler.
0

Featured Post

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

704 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