Click here to Skip to main content
15,912,457 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: puzzled about this: STL vector Pin
Christian Graus12-Feb-03 9:29
protectorChristian Graus12-Feb-03 9:29 
GeneralRe: puzzled about this: STL vector Pin
Tim Smith12-Feb-03 9:30
Tim Smith12-Feb-03 9:30 
GeneralRe: puzzled about this: STL vector Pin
palbano12-Feb-03 9:30
palbano12-Feb-03 9:30 
GeneralRe: puzzled about this: STL vector Pin
nss12-Feb-03 11:00
nss12-Feb-03 11:00 
GeneralProblem with sub menus Pin
Anonymous12-Feb-03 9:09
Anonymous12-Feb-03 9:09 
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 2:34
KaЯl13-Feb-03 2:34 
GeneralRe: Problem with sub menus Pin
Anonymous13-Feb-03 3:10
Anonymous13-Feb-03 3:10 
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 3:31
KaЯl13-Feb-03 3:31 
Ok, I thin I've understood. It's not the good way to set menu item sensitivity. MFC framework uses another system, the "OnUpdateUI" mechanism.

Basically:
In the MainFrame (or View, as you wish) message map, add
ON_UPDATE_COMMAND_UI(ID_MYMENUCOMMAND, OnUpdateMyMenu)

Next, add the method
void CMainFrame::OnUpdateMyMenu(CCmdUI* pCmdUI)<br />
{<br />
 pCmdUI->Enable(FALSE); // disable the menu item<br />
}

It's possible to do this using the ClassWizard.

You may find useful info on this mechanism on
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_ccmdui.asp

HTH,

K.





Angels banished from heaven have no choice but to become demons
Cowboy Bebop

GeneralRe: Problem with sub menus Pin
Scorp1us13-Feb-03 9:18
Scorp1us13-Feb-03 9:18 
GeneralRe: Problem with sub menus Pin
KaЯl13-Feb-03 10:15
KaЯl13-Feb-03 10:15 
GeneralRe: Problem with sub menus Pin
tim63520-Mar-05 21:56
tim63520-Mar-05 21:56 
GeneralRe: Problem with sub menus Pin
KaЯl20-Mar-05 23:11
KaЯl20-Mar-05 23:11 
GeneralRe: Problem with sub menus Pin
tim63521-Mar-05 2:59
tim63521-Mar-05 2:59 
GeneralShareable objects... Pin
BlackSmith12-Feb-03 9:05
BlackSmith12-Feb-03 9:05 
GeneralRe: Shareable objects... Pin
palbano12-Feb-03 9:26
palbano12-Feb-03 9:26 
GeneralRe: Shareable objects... Pin
BlackSmith12-Feb-03 9:48
BlackSmith12-Feb-03 9:48 
GeneralRe: Shareable objects... Pin
palbano12-Feb-03 11:58
palbano12-Feb-03 11:58 
GeneralRe: Shareable objects... Pin
Chris Richardson12-Feb-03 11:58
Chris Richardson12-Feb-03 11:58 
QuestionCan I add a menu to a dialog based application? Pin
work_to_live12-Feb-03 8:48
work_to_live12-Feb-03 8:48 
AnswerRe: Can I add a menu to a dialog based application? Pin
Chris Losinger12-Feb-03 8:52
professionalChris Losinger12-Feb-03 8:52 
GeneralRe: Can I add a menu to a dialog based application? Pin
work_to_live12-Feb-03 9:05
work_to_live12-Feb-03 9:05 
GeneralCImage & Transparency Pin
loading12-Feb-03 8:01
loading12-Feb-03 8:01 
QuestionReliable way to convert float to a double? Pin
Member 9612-Feb-03 7:40
Member 9612-Feb-03 7:40 
AnswerRe: Reliable way to convert float to a double? Pin
Chris Losinger12-Feb-03 7:51
professionalChris Losinger12-Feb-03 7:51 
GeneralRe: Reliable way to convert float to a double? Pin
Member 9612-Feb-03 8:10
Member 9612-Feb-03 8:10 

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.