Click to See Complete Forum and Search --> : Menu Item Check


Dallex
May 17th, 1999, 12:32 PM
I created a menu item and selected popup on the resource editor. I then added 6 menu items added callbacks and all works fine. I set the checked resource for the first menu item in the resource editor but don't know how to make the last menu item selected be the checked item. I'm using Visual C++ 6.0.

Dallex
May 18th, 1999, 09:41 AM
Well I solved the problem two different ways. The first way was to add a OnInitMenu(CMenu* pMenu) method and save the menu pointer to a class attribute. Then in the callback I used the pointer to acces a CheckMenuItem() method. I then realized that I could get the pointer in the callback buy calling GetMenu() and saving the return value. It seems to be cleaner and I'm concerned about saving a pointer at initialization that could pose a problem later on.