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 |
Will there be any difference in the image buffer size if it is loaded in from CString to LPTSTR using GetBuffer()? lptstr = string.GetBuffer(0);
What interface must be supported by an ActiveX control?
What function is used to disable a control at runtime?
1)At run-time, you can change the icon by calling the LoadIcon() function?
what is the component of CLR ?
What is a message map, and what is the advantage of a message map over virtual functions?
What is #progma and where it is used?
What is Thread ?(VC++)What is the difference between Cmutex and Csemaphone?
Difference between Cclint DC & Cpaint Dc
Explain StretchBlt and BitBlt
What is the difference between Extension DLL and Regular DLL?
How do you change the properties for a tree view control that is part of the CTreeView class?