Click here to Skip to main content
15,901,122 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Help with selecting Visual Studio option Pin
Saurabh.Garg6-Nov-08 15:24
Saurabh.Garg6-Nov-08 15:24 
GeneralRe: Help with selecting Visual Studio option Pin
Geurt Bloem6-Nov-08 20:49
Geurt Bloem6-Nov-08 20:49 
GeneralRe: Help with selecting Visual Studio option Pin
Saurabh.Garg6-Nov-08 21:11
Saurabh.Garg6-Nov-08 21:11 
QuestionResolving hostnames in a domain Pin
Green Fuze6-Nov-08 1:23
Green Fuze6-Nov-08 1:23 
QuestionRe: Resolving hostnames in a domain Pin
led mike6-Nov-08 4:25
led mike6-Nov-08 4:25 
AnswerRe: Resolving hostnames in a domain Pin
Green Fuze6-Nov-08 6:12
Green Fuze6-Nov-08 6:12 
QuestionDynamic CMenu Pin
h@$@n6-Nov-08 0:20
h@$@n6-Nov-08 0:20 
AnswerRe: Dynamic CMenu Pin
Iain Clarke, Warrior Programmer6-Nov-08 0:37
Iain Clarke, Warrior Programmer6-Nov-08 0:37 
To disable them is dead easy with MFC. You just provide an ON_UPDATE_COMMAND handler for a command, and away you go.

For 99% of my menus, I prefer to go this way. Then a user can say "ah, here the option is, I just can't use it right now for some reason".

The option is the one MFC uses by default - switch the menu set completely. It has one for "no view", and each view has an associated menu it puts in place. No point in having much more than open, close and help for an MDI app with no documents... I just use one global menu, but their approach is a perfectly good one.

The last thing I do is to have a setup submenu on my Tools menu. The first menu option on that submenu has an ID of IDM_CONTROL_EDITBUSFILE. If the user has not put a specific flag on the command line, I remove the submenu completely. This saves them accidentally doing something that only knowledgable people (ie me and my colleagues) can do.

Iain.

...
ON_UPDATE_COMMAND_UI(IDM_CONTROL_EDITBUSFILE, OnUpdateControls)
...
void	CIOBus::OnUpdateControls (CCmdUI* pCmdUI) 
{
    if (pCmdUI->m_pSubMenu)	// Whole of the control submenu
    {
        // Is this the Tools | Setup system sub menu we are validating?
        if ( (pCmdUI->m_nID == IDM_CONTROL_EDITBUSFILE) && !CGlobals::IsSettingUp () )
            pCmdUI->m_pMenu->DeleteMenu (pCmdUI->m_nIndex, MF_BYPOSITION);
        return;
    }
...

QuestionSaving Toolbar buttons List in Dynamic Array Pin
h@$@n5-Nov-08 23:20
h@$@n5-Nov-08 23:20 
AnswerRe: Saving Toolbar buttons List in Dynamic Array Pin
KarstenK5-Nov-08 23:54
mveKarstenK5-Nov-08 23:54 
QuestionCRichEditCtrl and text colors Pin
prithaa5-Nov-08 22:53
prithaa5-Nov-08 22:53 
AnswerRe: CRichEditCtrl and text colors Pin
Dhiraj kumar Saini5-Nov-08 23:02
Dhiraj kumar Saini5-Nov-08 23:02 
GeneralRe: CRichEditCtrl and text colors Pin
prithaa5-Nov-08 23:21
prithaa5-Nov-08 23:21 
AnswerRe: CRichEditCtrl and text colors Pin
Iain Clarke, Warrior Programmer6-Nov-08 1:00
Iain Clarke, Warrior Programmer6-Nov-08 1:00 
QuestionDialog Box Problem Pin
Dhiraj kumar Saini5-Nov-08 22:11
Dhiraj kumar Saini5-Nov-08 22:11 
QuestionADVAPI32.dll Pin
izyani5-Nov-08 21:51
izyani5-Nov-08 21:51 
AnswerRe: ADVAPI32.dll Pin
Saurabh.Garg5-Nov-08 22:55
Saurabh.Garg5-Nov-08 22:55 
GeneralRe: ADVAPI32.dll Pin
izyani6-Nov-08 14:36
izyani6-Nov-08 14:36 
Questionencrypted formate Pin
cpvc++5-Nov-08 20:51
cpvc++5-Nov-08 20:51 
AnswerRe: encrypted formate Pin
sashoalm5-Nov-08 21:22
sashoalm5-Nov-08 21:22 
JokeRe: encrypted formate Pin
CPallini5-Nov-08 22:12
mveCPallini5-Nov-08 22:12 
QuestionHide and show Dialog Application Pin
MsmVc5-Nov-08 19:52
MsmVc5-Nov-08 19:52 
AnswerRe: Hide and show Dialog Application Pin
sashoalm5-Nov-08 21:48
sashoalm5-Nov-08 21:48 
GeneralRe: Hide and show Dialog Application Pin
MsmVc5-Nov-08 22:10
MsmVc5-Nov-08 22:10 
GeneralRe: Hide and show Dialog Application Pin
sashoalm6-Nov-08 3:23
sashoalm6-Nov-08 3:23 

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.