Newbie Menu Problem 
Author Message
 Newbie Menu Problem

Hi. I am trying to code an event handler for a menu event in VC++.NET,
and it seems that the event procedure is never running.

I created a dialog based MFC app with the wizard. Then, I added a menu
through the resource editor, created a menu item, assigned it an ID,
right clicked on it and selected Add Event Handler...added a function
in my main class and coded that function to put up a message box. I
also associated the menu with the main dialog in the properties
window.

The problem is that when I select the menu item, nothing happens. My
event handler never runs. I did the exact same procedure in VC++ 6 and
it works just fine.

Anyone ever seen anything like this? What am I missing?

Thanks a lot!

Pat



Sun, 24 Apr 2005 20:52:51 GMT  
 Newbie Menu Problem

Quote:
>Hi. I am trying to code an event handler for a menu event in VC++.NET,
>and it seems that the event procedure is never running.

>I created a dialog based MFC app with the wizard. Then, I added a menu
>through the resource editor, created a menu item, assigned it an ID,
>right clicked on it and selected Add Event Handler...added a function
>in my main class and coded that function to put up a message box. I
>also associated the menu with the main dialog in the properties
>window.

>The problem is that when I select the menu item, nothing happens. My
>event handler never runs. I did the exact same procedure in VC++ 6 and
>it works just fine.

Pat,

It works fine for me with VS7.

Have you added the menu handler to the dialog class or the application
class? I used the dialog class.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



Mon, 25 Apr 2005 15:17:14 GMT  
 Newbie Menu Problem
I added it to the dialog class. I did, eventually get it to work, by
adding other menu items. It was wierd, and I am not able to reproduce
the problem, but it seems as if maybe the IDE was messing with the
resource file or something.

Who knows...anyway, thanks for your help!

Quote:

> >Hi. I am trying to code an event handler for a menu event in VC++.NET,
> >and it seems that the event procedure is never running.

> >I created a dialog based MFC app with the wizard. Then, I added a menu
> >through the resource editor, created a menu item, assigned it an ID,
> >right clicked on it and selected Add Event Handler...added a function
> >in my main class and coded that function to put up a message box. I
> >also associated the menu with the main dialog in the properties
> >window.

> >The problem is that when I select the menu item, nothing happens. My
> >event handler never runs. I did the exact same procedure in VC++ 6 and
> >it works just fine.

> Pat,

> It works fine for me with VS7.

> Have you added the menu handler to the dialog class or the application
> class? I used the dialog class.

> Dave



Tue, 26 Apr 2005 17:30:22 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. newbie: Menu problem

2. Problem with context menu command routing ,in a dialog app (newbie)

3. Toolbar drop-down menu problem trying to display popup menu (IE Deskbar)

4. Problem with owner-draw menus and items with popup-menu

5. problem: How to change the background color of menu items and menu bar

6. Newbie: Menus

7. Newbie question - menu

8. Newbie, help with menu in a modal PropertySheet

9. newbie: menu and icons not loaded ?

10. newbie: menu is not visible

11. Newbie: Menu and icons not showing ?

12. Help: Newbie Menu Question

 

 
Powered by phpBB® Forum Software