Click here to Skip to main content
15,892,161 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Initialize a List Box Pin
Jay Hova10-Jul-03 0:53
Jay Hova10-Jul-03 0:53 
GeneralFonts and Colors Pin
The_Server9-Jul-03 2:36
The_Server9-Jul-03 2:36 
GeneralRe: Fonts and Colors Pin
56789012349-Jul-03 3:46
56789012349-Jul-03 3:46 
GeneralProcess Status Pin
Majid Shahabfar9-Jul-03 2:13
Majid Shahabfar9-Jul-03 2:13 
GeneralRe: Process Status Pin
valikac9-Jul-03 5:44
valikac9-Jul-03 5:44 
GeneralRe: Process Status Pin
Mike Dimmick9-Jul-03 6:38
Mike Dimmick9-Jul-03 6:38 
Generaldialog menu & update_command_ui Pin
Steve L.9-Jul-03 1:59
Steve L.9-Jul-03 1:59 
GeneralRe: dialog menu & update_command_ui Pin
Scozturk9-Jul-03 3:20
professionalScozturk9-Jul-03 3:20 
Hi!
This code may help you!It has everything about changing dynamically menu items:
void CExampleView::OnUpdateEditInsertolecontrol(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here

// Specific for the example
pCmdUI->Enable(m_pControl == NULL);
}

void CExampleView::OnEditInsertolecontrol()
{
// TODO: Add your command handler code here
COCBrowserDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

// Your code ...

// Change menu item (Insert OLE Object -> Delete OLE Object)
CMenu *menu;

// 'Edit' is the second submenu (index = 1)
menu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(1);
menu->ModifyMenu(ID_EDIT_INSERTOLECONTROL, MF_BYCOMMAND, ID_EDIT_DELETEOLECONTROL, "&Delete OLE Control");

}


void CExampleView::OnUpdateEditDeleteolecontrol(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here

// Specific for the example
pCmdUI->Enable(m_pControl!= NULL);
}


void CExampleView::OnEditDeleteolecontrol()
{
// TODO: Add your command handler code here

// Your code ...

// Change menu item (Delete OLE Object -> Insert OLE Object )
CMenu *menu;

menu = AfxGetApp()->m_pMainWnd->GetMenu()->GetSubMenu(1);
menu->ModifyMenu(ID_EDIT_DELETEOLECONTROL, MF_BYCOMMAND, ID_EDIT_INSERTOLECONTROL, "&Insert OLE Control...");
}


I didn't write it myself I got it from this website http://cui.unige.ch/OSG/people/Past/fuentes/Mfc/mfc.html

Well... I am a beginner ...
GeneralGDI+ Memory leak Pin
sdanu9-Jul-03 1:23
sdanu9-Jul-03 1:23 
GeneralRe: Is it possible? Pin
Rage9-Jul-03 1:58
professionalRage9-Jul-03 1:58 
GeneralRe: Is it possible? Pin
Ryan Binns9-Jul-03 2:22
Ryan Binns9-Jul-03 2:22 
GeneralRe: Is it possible? Pin
Ryan Binns9-Jul-03 2:28
Ryan Binns9-Jul-03 2:28 
GeneralRe: Is it possible? Pin
Ryan Binns9-Jul-03 2:25
Ryan Binns9-Jul-03 2:25 
GeneralRe: Is it possible? Pin
Ryan Binns9-Jul-03 2:48
Ryan Binns9-Jul-03 2:48 
GeneralRe: Is it possible? Pin
Ryan Binns9-Jul-03 3:24
Ryan Binns9-Jul-03 3:24 
GeneralConsole Screen I/O Pin
RChin9-Jul-03 1:02
RChin9-Jul-03 1:02 
GeneralRe: Console Screen I/O Pin
David Crow9-Jul-03 3:08
David Crow9-Jul-03 3:08 
GeneralRe: Console Screen I/O Pin
RChin9-Jul-03 3:33
RChin9-Jul-03 3:33 
GeneralRe: Console Screen I/O Pin
David Crow9-Jul-03 3:39
David Crow9-Jul-03 3:39 
GeneralFAQ Pin
Andrew Walker9-Jul-03 3:56
Andrew Walker9-Jul-03 3:56 
GeneralRe: FAQ Pin
RChin9-Jul-03 4:10
RChin9-Jul-03 4:10 
GeneralChanging mouse cursor in a CScrollView Pin
Rage9-Jul-03 0:50
professionalRage9-Jul-03 0:50 
GeneralRe: Changing mouse cursor in a CScrollView Pin
Ryan Binns9-Jul-03 2:11
Ryan Binns9-Jul-03 2:11 
GeneralRe: Changing mouse cursor in a CScrollView Pin
Rage9-Jul-03 3:45
professionalRage9-Jul-03 3:45 
GeneralRe: Changing mouse cursor in a CScrollView Pin
Ryan Binns9-Jul-03 3:55
Ryan Binns9-Jul-03 3:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.