Click here to Skip to main content
15,887,376 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString Problems Pin
palbano26-Jul-04 7:33
palbano26-Jul-04 7:33 
Questionno copy constructor? Pin
feline_dracoform26-Jul-04 0:09
feline_dracoform26-Jul-04 0:09 
AnswerRe: no copy constructor? Pin
David Crow26-Jul-04 3:53
David Crow26-Jul-04 3:53 
GeneralRe: no copy constructor? Pin
feline_dracoform27-Jul-04 2:02
feline_dracoform27-Jul-04 2:02 
GeneralRe: no copy constructor? Pin
David Crow27-Jul-04 3:39
David Crow27-Jul-04 3:39 
AnswerRe: no copy constructor? Pin
palbano26-Jul-04 7:53
palbano26-Jul-04 7:53 
GeneralRe: no copy constructor? Pin
feline_dracoform27-Jul-04 1:12
feline_dracoform27-Jul-04 1:12 
Generaldisable a submenu item on runtime in an MFC app Pin
caykahve25-Jul-04 23:35
caykahve25-Jul-04 23:35 
Hi,

To disable and enable a submenu item on runtime in an MFC app, I have used the following

code but seen no change. What is the problem with it?

MSDN says m_bAutoMenuEnable should be set to FALSE in the constructor of CMainFrame (in CMenu::EnableMenuItem), but in CDialog class there doesn't seem to be such a variable, or is there?

If I have to use ON_UPDATE_COMMAND_UI, can you give me some information on what to do?

Thanks...

// I want to disable the item "F" in the Settings Submenu, which has the ID ID_SETTINGS_F 
// File   Settings   Help
// A      B          C
// D      E    
//        F

// disable
CMenu* pMenu, *subMenu;	
pMenu = AfxGetMainWnd()->GetMenu();	
subMenu = pMenu->GetSubMenu(1);
subMenu->EnableMenuItem(ID_SETTINGS_F, MF_BYPOSITION | MF_DISABLED | MF_GRAYED);	
DrawMenuBar();
//


//enable
//...the same as above
subMenu->EnableMenuItem(ID_SETTINGS_F, MF_BYPOSITION | MF_ENABLED);
//...the same as above

GeneralRe: disable a submenu item on runtime in an MFC app Pin
Anonymous25-Jul-04 23:45
Anonymous25-Jul-04 23:45 
GeneralRe: disable a submenu item on runtime in an MFC app Pin
caykahve25-Jul-04 23:52
caykahve25-Jul-04 23:52 
GeneralRe: disable a submenu item on runtime in an MFC app Pin
V.25-Jul-04 23:47
professionalV.25-Jul-04 23:47 
GeneralRe: disable a submenu item on runtime in an MFC app Pin
caykahve26-Jul-04 0:24
caykahve26-Jul-04 0:24 
Generalmultiple text in status-bar Pin
Anonymous25-Jul-04 23:21
Anonymous25-Jul-04 23:21 
GeneralPosition the mouse on a web browser programmatically Pin
yourbuddy7725-Jul-04 21:22
yourbuddy7725-Jul-04 21:22 
Generalline comparison on word basis Pin
mfc_surfer25-Jul-04 20:46
mfc_surfer25-Jul-04 20:46 
Questiondynamically create controls and attaching listeners to them? Pin
misterbear25-Jul-04 20:23
misterbear25-Jul-04 20:23 
AnswerRe: dynamically create controls and attaching listeners to them? Pin
KarstenK25-Jul-04 21:14
mveKarstenK25-Jul-04 21:14 
GeneralBut how to attach a message handler dynamically? Pin
misterbear26-Jul-04 0:04
misterbear26-Jul-04 0:04 
Questiondynamically create controls and attaching listeners to them? Pin
misterbear25-Jul-04 20:23
misterbear25-Jul-04 20:23 
GeneralGDI Objects Pin
0v3rloader25-Jul-04 13:25
0v3rloader25-Jul-04 13:25 
GeneralRe: GDI Objects Pin
Ravi Bhavnani25-Jul-04 14:54
professionalRavi Bhavnani25-Jul-04 14:54 
GeneralRe: GDI Objects Pin
Michael Dunn25-Jul-04 18:21
sitebuilderMichael Dunn25-Jul-04 18:21 
GeneralRe: GDI Objects Pin
Antony M Kancidrowski26-Jul-04 2:06
Antony M Kancidrowski26-Jul-04 2:06 
GeneralReadfile from *.txt Pin
71cwill25-Jul-04 8:39
71cwill25-Jul-04 8:39 
GeneralRe: Readfile from *.txt Pin
Michael Dunn25-Jul-04 11:33
sitebuilderMichael Dunn25-Jul-04 11:33 

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.