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

Tell me the different controls in MFC ?

5 Answers  


If i derive a new class from CObject what are the basic features my derived wil get ?

4 Answers   Microsoft,


what is message Testing ?

1 Answers   L&T,


In VC++ How to transfer between one exe to another exe while running..

5 Answers   Wipro,


is there any class which is not derived from Cobject

11 Answers   Patni,






What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?

5 Answers   Atos Origin,


Types of DLL's

11 Answers   Invensys,


What are the differences between MFC Exception macros and C++ exception keywords?

2 Answers  


What is userdefine Messages in MFC?

1 Answers   HCL,


What is CArchive class dowes?

4 Answers  


what is message loop how mfc does it internally?

4 Answers   Aspire,


Tell us something about MFC?

7 Answers   Microsoft,


Categories