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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 178
  • Last Modified:

RichEditCtrl

I'm an Newbee on MFC and try to develop my first application using RichEditCtrl.
When I start my MDI application one file is opened and the menu icons are activated.
If I close all views most of the icons will be disabled. Which window message handles that ?
And where can I found it in the class assistant under Visual C++ IDE.
Is it possible to start the RichEditCtrl Editor without one active RichEditView ? How can I change that ?

Thanks in advance
Martin
0
martinmoessner
Asked:
martinmoessner
1 Solution
 
nabehsCommented:
1. the message that handles the enabling and disabling of menu items and toolbar buttons is: ON_UPDATE_COMMAND_UI

// IN THE MESSAGE MAP
ON_UPDATE_COMMAND_UI(ID_MYTOOLBARBUTTON, OnMyToolbarButton)

void CMainFrm::OnMyToolbarButton(CCmdUI* pCmdUI)
{
    pCmdUI->Enable(FALSE);

OR

    pCmdUI->Enable(TRUE);
}

2. For help on the topic u can search the MSDN for ON_UPDATE_COMMAND_UI

3. The RichEditCtrl is embedded in RichEditView. If you need to create your own view then derive a class from CView and do the implementation yourself

Hope this helps

0
 
AndyAinscowCommented:
Just a bit more to nabehs comment.
By default the menu/toolbar item is enabled IF there is a handler function for that item.  You can use the ON_UPDATE_COMMAND_UI for the case that a function might only be allowed under certain conditions (eg, save is disabled when no changes have been made)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now