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

What is the difference between OnInitialUpdate and OnUpdate?

5 Answers  


Tell me the different controls in MFC ?

5 Answers  


What is serialization ?which function is responsible for serializing data ?

5 Answers  


I can i set size of integer variable should be fixed for different operating systems(Ex i want integer size is 2bytes in OS)

2 Answers   Invensys,


what is the use of AFX_MANAGE_STATE ?

4 Answers   HCL,






What is the base class for MFC

3 Answers   HCL,


What is a critical section and how is it implemented?

2 Answers  


Explain Doc/View architecture

6 Answers   Huawei,


what message is sent to an application when the user presses the primary button?

0 Answers   University Exams,


What are the special requirements for dialog box resources used in a form view?

2 Answers  


What is LPCTSTR? What does LP denote it?

4 Answers  


What is subclassing?

2 Answers  


Categories