I load my menu and try to check it, but nothing happens--no checky:
cMenu.LoadMenu( IDR_MENU1 );
cMenu.CheckMenuItem( ID_ENABLE_AGENT, MF_BYCOMMAND | MF_CHECKED );
If I retrieve the menu string for the same menu ID, I get the correct text
for the menu item I'm trying to check...
cMenu.GetMenuString( ID_ENABLE_AGENT, cstrMenuText, MF_BYCOMMAND );
What the *&^(*@# is wrong here?
You're my hero if you can tell me what's wrong. Thanks,
-Colin Reinhardt
In between LoadMenu and CheckMenuItem, I am calling
SetMenuItemBitmaps( ID_ENABLE_AGENT, MF_BYCOMMAND, NULL, NULL );
this returns TRUE (success).
but still no checkmarks showing up.
If I call GetMenuState, it reflects the correct state, checked or unchecked.
But no checkmark bitmap on the visible menu.
I even tried calling UpdateWindow( ) in the OnUpdateEnableAgent( ) method...
Help?!?
Colin Reinhardt wrote in message ...
What I am doing is loading the menu and then checking it as described in the
code below. I also call the SetMenuItemBitmaps() function as described in
the addendum message.
I can receive the text string of the menu item correctly, so I know I've got
the right menu item.
I can also call GetMenuState and it will reflect the correct state, either
MF_CHECKED or MF_UNCHECKED,
so the state is actually changing. However, the checkmark bitmap does not
display.
You can repro this problem simply with a basic AppWizard generated Dialog
application.
I am now going to try creating a custom bitmap graphic and see if that
works.
Has anyone else encountered this problem (feature ;-) )...?
THank you,
CENK CIVICI wrote in message ...
> cMenu.LoadMenu( IDR_MENU1 );
> cMenu.CheckMenuItem( ID_ENABLE_AGENT, MF_BYCOMMAND | MF_CHECKED );
I'm curious about this call to LoadMenu, and where cMenu came from.
Have you used SetMenu to attach the menu to the window ?
--
Bob Moore [MVP]
http://www.mooremvp.freeserve.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to an unreasonable amount of queries, I no
longer answer unsolicited email questions. Sorry,
no exceptions, and yes, this DOES mean you.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
On Wed, 6 Oct 1999 14:36:04 -0700, "Colin Reinhardt" <coli...@oz.net>
wrote:
>Some days just aren't my day....
>
>I load my menu and try to check it, but nothing happens--no checky:
>
> cMenu.LoadMenu( IDR_MENU1 );
> cMenu.CheckMenuItem( ID_ENABLE_AGENT, MF_BYCOMMAND | MF_CHECKED );
>
>If I retrieve the menu string for the same menu ID, I get the correct text
>for the menu item I'm trying to check...
>
> cMenu.GetMenuString( ID_ENABLE_AGENT, cstrMenuText, MF_BYCOMMAND );
>
>What the *&^(*@# is wrong here?
>
>You're my hero if you can tell me what's wrong. Thanks,
>
>-Colin Reinhardt
>
Joseph M. Newcomer
email: newc...@flounder.com
Web: www3.pgh.net/~newcomer
MVP Tips: www3.pgh.net/~newcomer/mvp_tips.htm
Author of "Win32 Programming" (with Brent Rector, Addison-Wesley, 1997)
Author of "Developing Windows NT Device Drivers" (with Ed Dekker, AWL, 1999)