Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - How can i dynamic  add menu iterm
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How can i dynamic add menu iterm

 Post Reply Post Reply
Author
Message
powerlinm View Drop Down
Newbie
Newbie


Joined: 05 August 2004
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote powerlinm Quote  Post ReplyReply Direct Link To This Post Topic: How can i dynamic add menu iterm
    Posted: 05 August 2004 at 3:59am

I want insert a dynamic  menu to File menu, but failt, this is some code i write in CMainFrame::OnCreate, 

CMenu *pMenuBar1  = pCmdUI->m_pMenu;
 if (pMenuBar1 == NULL)
 {
  return;
 }
 CMenu *pSubMenu = pMenuBar1->GetSubMenu(0);
 ASSERT_VALID(pSubMenu);
 pSubMenu->InsertMenu(5, MF_STRING | MF_ENABLED | MF_BYPOSITION, 0, "hello");

 

that does'nt work,  who can tell me how to do!?

Back to Top
spike View Drop Down
Groupie
Groupie


Joined: 13 May 2003
Location: United States
Status: Offline
Points: 48
Post Options Post Options   Thanks (0) Thanks(0)   Quote spike Quote  Post ReplyReply Direct Link To This Post Posted: 05 August 2004 at 6:31pm
They have a message specifically for this....something like XT_WM_INITPOPUPMENU or XT_WM_CREATECONTROLS, XT_WM_CREATECOMMANDBAR, something like that. Search through the samples for OnCreateControls or OnInitPopupMenu...
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.172 seconds.