Dynamic menu text

closed account (Lv0f92yv)
I have a list of filenames (strings) stored in a file. What I want to do is have the program read the file, parse the list of file names (all this is done so far), and then to set the name of buttons (specifically, MENUITEM objects) to the strings read in.

I am using VC++ 6.0 with MFC... I am creating the buttons in a resource file:

1
2
3
4
5
POPUP "&Recent Files" BEGIN
      MENUITEM "Rec (%s)", IDM_RECFILES


END

How can I change the "Rec (%s)" text at runtime dynamically?

Thanks.
Not having used MFC ever before, I would say you use CWnd::GetMenu() (http://msdn.microsoft.com/en-us/library/7xkd69hf(VS.80).aspx) to obtain a pointer to the main menu object, and then use this object's members (http://msdn.microsoft.com/en-us/library/k599xa5a(VS.80).aspx) to get to the menu items in question.
Topic archived. No new replies allowed.