troubleshooting Question

ON_UPDATE_COMMAND_UI_RANGE question

Avatar of alan93
alan93 asked on
System Programming
15 Comments1 Solution586 ViewsLast Modified:
I'm using this to update menu items in a view/doc app and had no problems using it to enable or disable items based on doc data.

But now I'm trying to change the text of an item.

using:





code:--------------------------------------------------------------------------------

ON_UPDATE_COMMAND_UI_RANGE(32845, 32916, OnMenuEnableDisable)


void CMyView::OnMenuEnableDisable(CCmdUI* pCmdUI)
{

.......

if(something)
       pMenu-> ModifyMenu(ID_THE_ID_TO_CHANGE,MF_BYCOMMAND|MF_STR
ING,0,"One Text");
else
     pMenu-> ModifyMenu(ID_THE_ID_TO_CHANGE,MF_BYCOMMAND|MF_STR
ING,0,"Another Text");

.........

}

--------------------------------------------------------------------------------



but this function is not itterating all the items in the set ranges when a menu is accessed. ?
So the menu item I'm trying to change the text to, gets changed only when the view loads.

Is there a reason that this only gets called, like maybe on OnInitialUpdate(), or something.

I thought it is called everytime a menu is accessed.

MSDN is very brief on this.
ASKER CERTIFIED SOLUTION
Zoppo

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros