How to handle dynamic menus in MFC?

Answers were Sorted based on User's Feedback



How to handle dynamic menus in MFC?..

Answer / fahim

Dynamic menus can be handled using Cmenu's
Createmenu,Insrtmenu and Appendmenu functions.

Is This Answer Correct ?    5 Yes 1 No

How to handle dynamic menus in MFC?..

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

How to handle dynamic menus in MFC?..

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

Post New Answer

More MFC Interview Questions

How WM_PAINT message gets called in MFC,please explain it . a)Who calls the WM_PAINT message? b)When it gets called? c)how it comes to message queue? Please Explain it

8 Answers  


what is the use of CCmdTarget?

4 Answers   Siemens,


what is the use of Mutex and critical section

2 Answers  


What is the base class for most MFC classes?

7 Answers   CMC, Siemens,


1)How to change the size of a button at run time ?

1 Answers  






how to repaint when working with horizontal scroll bar

0 Answers  


what is message Testing ?

1 Answers   L&T,


What is the base class for MFC

3 Answers   HCL,


What is the use of CCmdTarget ?

4 Answers  


Difference between Cclint DC & Cpaint Dc

6 Answers   E Logic,


I want recent paper pattern for HP company?

0 Answers   HP,


what are the feauters of CObject

4 Answers   Siemens, Wipro,


Categories