Hi Jijo,
The update UI mechanism doesn't work for a dialog box-based application
because CDialog has no OnInitMenuPopup handler and it uses CWnd's default
handler, which does not call update command UI handlers for menu items.
Please check the article below for detailed information:
Q242577 PRB: Update Command UI Handlers Do Not Work Properly on Dialogs
http://www.*-*-*.com/
In addition, you may want post MFC questions to microsoft.public.vc.mfc
newsgroup.
Best Regards,
Leo Chen
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Subject: Disabling menu item
| Date: Thu, 29 Aug 2002 12:33:18 +0530
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2600.0000
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
| Newsgroups: microsoft.public.vc.language
| NNTP-Posting-Host: 203.200.149.183
| Path: cpmsftngxa08!tkmsftngp01!tkmsftngp13
| Xref: cpmsftngxa08 microsoft.public.vc.language:169974
| X-Tomcat-NG: microsoft.public.vc.language
|
| Hi,
|
| I attached a menu to a dialog through the resource editor.
| I want to make one menu item grayed.I tried to do it in the onupdate
command
| UI.
| I did the same thing with a menu in the view and it perfectly worked.
|
| void CDlg::OnUpdateSend(CCmdUI* pCmdUI)
| {
| pCmdUI->Enable(FALSE);
| }
|
| I tried the following code also
|
| pCmdUI->Enable(FALSE);
| CMenu *pMenu = pCmdUI->m_pMenu;
| if(NULL!=pMenu)
| pMenu->EnableMenuItem(ID_SEND_FILE,MF_GRAYED);
|
| The menu is disabled but not grayed.
|
| Thanks for any help
|
| Regards,
| Jijo
|
|
|
|
|
|
|
|
|
|
|
|
|