Question

Locked

c++ help with EnableMenuItem

By jean_guy_bureau ·
i am looking to gray out the submenu option department and manager in my sort menu
if i select a option in the filter
the code that i have is
CMenu* pMenu = GetParent()->GetMenu();
CMenu* submenu = pMenu->GetSubMenu(0);


//pMenu->EnableMenuItem(3,MF_BYPOSITION|MF_GRAYED);
submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYPOSITION | MF_GRAYED);
submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYPOSITION | MF_GRAYED);

GetParent()->DrawMenuBar();
OnSortName();

This conversation is currently closed to new comments.

14 total posts (Page 1 of 2)   01 | 02   Next
| Thread display: Collapse - | Expand +

All Answers

Collapse -

Eaxample ...

by OldER Mycroft In reply to c++ help with EnableMenu ...
Collapse -

i saw that wb site

by jean_guy_bureau In reply to Eaxample ...

there is some thing that i am misssing

Collapse -

Alert !! > Rift in space-time continuum ...

by OldER Mycroft In reply to i saw that wb site

Sorry, but I'm pretty sure you told me something after "there is some thing that i am missing.." But it never came through.

Please re-transmit.

Collapse -

what am i missing i have look in the page you sent me did not work

by jean_guy_bureau In reply to Alert !! > Rift in space- ...

what am i missing i have look in the page you sent me did not work
i did some chage to my code what is missing or what am i missing

CMenu* pMenu = GetParent()->GetMenu();
CMenu* submenu = pMenu->GetSubMenu(0);


//pMenu->EnableMenuItem(3,MF_BYPOSITION|MF_GRAYED);
submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYCOMMAND | MF_GRAYED|MF_DISABLED);
submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYCOMMAND | MF_GRAYED|MF_DISABLED);

GetParent()->DrawMenuBar();
OnSortName();

Collapse -

The clue was in the TITLE of the last entry ...

by OldER Mycroft In reply to what am i missing i have ...

SPACE - TIME continuum.

Take some time and check the SPACE you have between your [line] values.

You appear to be incapable of checking the SPACING of your typing.


HINT:

Cut & Paste the example from the M$ webpage, into Notepad, place the cursor in front of the top left character, then using the 'advance' cursor key - do a character count of the values.

Do the same for your own code.

Do it line for line.

The example has spaces that you don't.

Collapse -

ok just call me stupid i do not see it

by jean_guy_bureau In reply to The clue was in the TITLE ...

CMenu* pMenu = GetParent()->GetMenu();
CMenu* submenu = pMenu->GetSubMenu(0);


submenu->EnableMenuItem(ID_SORT_MANAGER,MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);

submenu->EnableMenuItem(ID_SORT_DEPARTMENT,MF_BYCOMMAND | MF_GRAYED | MF_DISABLED);
GetParent()->DrawMenuBar();
OnSortName();

Collapse -

OK - You're STUPID !! ...

by OldER Mycroft In reply to ok just call me stupid i ...

Now, pardon me if I'm wrong, but your command of the English language appears to be substantive. Now notwithstanding the fact that you are American, and may have formed your own methodology of formatting written English, there are still a few constraints that have to be adhered to, one of which is that after every comma there is usually a SPACE. This conformity is not just confined to written English

Sorry, if that is beyond your understanding then, that is wholly your concern. I DO NOT wish to be harsh, but if you cannot read then why are you asking questions within a text-based forum ?

I also suggest you attempt to develop a personal sense of humour.

Collapse -

i am not american i am french canadian

by jean_guy_bureau In reply to ok just call me stupid i ...

I i did put a space and the Comma
And the sudmenu are still not going gray
CMenu* pMenu = GetParent()->GetMenu();
CMenu* submenu = pMenu->GetSubMenu(0);


submenu->EnableMenuItem(ID_SORT_MANAGER, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);

submenu->EnableMenuItem(ID_SORT_DEPARTMENT, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED);
GetParent()->DrawMenuBar();

Collapse -

Use the Force - jean_guy_bureau@...

by OldER Mycroft In reply to ok just call me stupid i ...

I'm going to give you a simple piece of advice...

If you are incapable of viewing 2 pieces of code side-by-side (or one above the other), making adjustments as you go, you will never make it to the point of achievement.

I gave you the chance, you DID make amendments, never admitted them then maintained there was no difference. You can't do that if I'm snap-shotting what you post.

READ the code - don't just look at it.

Collapse -

WHAT is the possible difference between ...

by OldER Mycroft In reply to ok just call me stupid i ...

"MF_BYCOMMAND"

&

"MF_BYPOSITION"

...so why the juxtapose?

You changed the code...

Back to Web Development Forum
14 total posts (Page 1 of 2)   01 | 02   Next

Related Discussions

Related Forums