
Dynamically setting menu text
Quote:
>In OnInitialUpdate() of my view I use
>CString strMenu = "&Dale";
>CMenu *pMenu = AfxGetApp()->GetMainWnd()->GetMenu();
>if (pMenu != NULL) {
> pMenu->ModifyMenu(1, MF_BYPOSITION | MF_STRING, 0, strMenu);
>}
>to dynamically set the menu text. It doesn't work for the 1st document
>opened initially, but it does for all others. How do i get it set for all?
Well, my first guess would be that it _is_ working for all of them, but
the changes aren't always getting reflected on the screen, because you
aren't calling DrawMenuBar. Does this code work for you if you add
"AfxGetApp()->GetMainWnd()->DrawMenuBar();" immediately after the ModifyMenu
call?
--
\o\ If you're interested in books and stories with transformation themes, \o\
/o/ please have a look at <URL:http://www.halcyon.com/phaedrus>. Thanks! /o/
\o\ FC1.21:FC(W/C)p6arw A- C->++ D>++ H+ M>+ P R T++++ W** Z+ Sm RLCT \o\
/o/ a cmn++++$ d e++ f+++ h- i++wf p-- sm# /o/