How to handle dynamic menus in MFC?
Answers were Sorted based on User's Feedback
Answer / fahim
Dynamic menus can be handled using Cmenu's
Createmenu,Insrtmenu and Appendmenu functions.
| Is This Answer Correct ? | 5 Yes | 1 No |
Answer / swetha palanki
//create object of CMenu in .h file of the frame window.
CMenu m_MyMenu;
//implement this is .cpp of frame window.
m_MyMenu = LoadMenu(ID_Menu1);
SetMenu(m_MyMenu);
| Is This Answer Correct ? | 2 Yes | 3 No |
Answer / sudhir kumar singh
CMenu contextMenuitm;
contextMenuitm.LoadMenu(IDR_SUBMIT);
CButton *pButton;
pButton=reinterpret_cast<CButton *>(GetDlgItem
(IDC_SUBMIT_BTN));
CRect rectSubmitButton;
pButton->GetWindowRect(&rectSubmitButton);
CMenu *getPopupMenu=contextMenuitm.GetSubMenu(0);
getPopupMenu->TrackPopupMenu(TPM_LEFTALIGN |
TPM_RIGHTBUTTON, point.x, point.y, this);
| Is This Answer Correct ? | 1 Yes | 2 No |
How you find memory leaks?
What is the difference between the Encapsulation and Abstraction
25 Answers HCL, Invensys, TCS, Wipro,
is there any class which is not derived from Cobject
What function is called by a document class to notify views that the document has been changed?
What is the difference between regular dlls and extended dlls?
what is the use of CCmdTarget?
Explain StretchBlt and BitBlt
1)How to change the size of a button at run time ?
Which CPrintInfo member variable must be set for multiple page printouts?
what is the component of CLR ?
i have created runtime menu -- ( admistrator ->managepackage,manage module). but now i want to open a dialog when i select manage package and any other diaolg when selecting manage module ( whole selection is at run time only ) . Please HELP .its urgently required
Which MFC function is used to display output?