Click here to Skip to main content
15,907,149 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionClearing CDC Pin
Jagadeesh VN7-Oct-05 2:31
Jagadeesh VN7-Oct-05 2:31 
GeneralRe: Clearing CDC Pin
ddmcr7-Oct-05 2:34
ddmcr7-Oct-05 2:34 
GeneralRe: Clearing CDC Pin
Jagadeesh VN7-Oct-05 2:38
Jagadeesh VN7-Oct-05 2:38 
GeneralRe: Clearing CDC Pin
Jack Puppy7-Oct-05 14:36
Jack Puppy7-Oct-05 14:36 
QuestionHow to change the print font? Pin
vikas amin7-Oct-05 2:22
vikas amin7-Oct-05 2:22 
AnswerRe: How to change the print font? Pin
douglasjordan7-Oct-05 6:48
douglasjordan7-Oct-05 6:48 
AnswerRe: How to change the print font? Pin
ThatsAlok7-Oct-05 20:26
ThatsAlok7-Oct-05 20:26 
QuestionOnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 2:11
professional#realJSOP7-Oct-05 2:11 
VC6
Win2K

I have a main menu with the following arrangement

<br />
File<br />
---Select Folder<br />
---Configure<br />
---Exit<br />
Start<br />
Stop<br />
Pause<br />
Resume<br />


I'm trying want the Stop, Pause and Resume items to grey out when they're disabled, but the methods I've tried in order to accomplish this have all failed in one way or another.

Calling pCmdUI->Enable(FALSE); in the update handler will disable the menu item, but it won't gray out.

If I use the following code, the menu item will gray out only after the user tries to click on it, and then, it doesn't un-gray unless it's allowed to AND the user clicks on it again.

BOOL   bEnable = (m_bShowRunning && !m_bShowPaused);
DWORD  dwFlags = (bEnable) ? MF_BYCOMMAND | MF_ENABLED
                           : MF_BYCOMMAND | MF_DISABLED | MF_GRAYED;
CMenu* pMenu   = GetMenu();
pMenu->EnableMenuItem(ID_SHOW_PAUSE, dwFlags);


Does anyone have any helpful ideas?

Confused | :confused:


------- sig starts

"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt

"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001



-- modified at 8:11 Friday 7th October, 2005
AnswerRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 2:58
David Crow7-Oct-05 2:58 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 3:05
professional#realJSOP7-Oct-05 3:05 
GeneralRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 3:52
David Crow7-Oct-05 3:52 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 6:54
professional#realJSOP7-Oct-05 6:54 
AnswerRe: OnUpdateCommand and menu Items Pin
David Crow7-Oct-05 8:10
David Crow7-Oct-05 8:10 
GeneralRe: OnUpdateCommand and menu Items Pin
#realJSOP7-Oct-05 9:10
professional#realJSOP7-Oct-05 9:10 
AnswerRe: OnUpdateCommand and menu Items Pin
Michael Dunn7-Oct-05 9:10
sitebuilderMichael Dunn7-Oct-05 9:10 
Questionobj versus &amp;obj - performance test Pin
ddmcr7-Oct-05 2:08
ddmcr7-Oct-05 2:08 
AnswerRe: obj versus &amp;obj - performance test Pin
vikas amin7-Oct-05 2:16
vikas amin7-Oct-05 2:16 
GeneralRe: obj versus &amp;amp;obj - performance test Pin
ddmcr7-Oct-05 2:23
ddmcr7-Oct-05 2:23 
QuestionRe: obj versus &amp;amp;obj - performance test Pin
toxcct7-Oct-05 2:47
toxcct7-Oct-05 2:47 
GeneralRe: obj versus &amp;amp;amp;obj - performance test Pin
ddmcr7-Oct-05 2:53
ddmcr7-Oct-05 2:53 
GeneralRe: obj versus &amp;amp;amp;obj - performance test Pin
toxcct7-Oct-05 2:58
toxcct7-Oct-05 2:58 
GeneralRe: obj versus &amp;amp;amp;obj - performance test Pin
ddmcr7-Oct-05 3:06
ddmcr7-Oct-05 3:06 
AnswerRe: obj versus &amp;amp;amp;obj - performance test Pin
toxcct7-Oct-05 3:15
toxcct7-Oct-05 3:15 
GeneralRe: obj versus &amp;amp;amp;obj - performance test Pin
Maximilien7-Oct-05 3:19
Maximilien7-Oct-05 3:19 
GeneralRe: obj versus &amp;amp;amp;obj - performance test Pin
ddmcr7-Oct-05 3:24
ddmcr7-Oct-05 3:24 

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.