Order of Message Map Entries - Does It Matter?
- From: "George B" <ghbennett@xxxxxxxxxxx>
- Date: Wed, 10 Aug 2005 13:20:30 -0400
Using VC6, my SDI app was working properly until I decided to replace
individual message handlers by a handler for a range. Using Class Wizard, I
deleted the individual message handlers and then added my own entry to the
message map following the Class Wizard entries. Is there a requirement that
the message map entries be in numerical order? What's happening is that the
handlers for my last two individual ID's are not being called, but control
is being passed to the handler for the range.
My message map looks something like the following:
BEGIN_MESSAGE_MAP(CMyDoc, CDocument)
//{{AFX_MSG_MAP(CMyDoc)
ON_COMMAND(ID_MY1, OnMy1)
ON_COMMAND(ID_MY2, OnMy2)
ON_COMMAND(ID_MY6, OnMy6)
ON_COMMAND(ID_MY7, OnMy7)
//}}AFX_MSG_MAP
ON_COMMAND_RANGE(ID_MY3,ID_MY5,OnMy3to5)
END_MESSAGE_MAP()
The ID's My1-My7 were created in that order by Class Wizard, and I'm
attempting to have a range handler for 3-5. When I execute the app,
messages 6 and 7 both appear to be diverted to OnMy3to5.
Any ideas?
.
- Follow-Ups:
- Re: Order of Message Map Entries - Does It Matter?
- From: Joseph M . Newcomer
- Re: Order of Message Map Entries - Does It Matter?
- From: Cyde Weys
- Re: Order of Message Map Entries - Does It Matter?
- Prev by Date: Re: How to do Z-axis ordering on elements in a Dialog Box?
- Next by Date: Re: How to do Z-axis ordering on elements in a Dialog Box?
- Previous by thread: CListCtrl Message Handling
- Next by thread: Re: Order of Message Map Entries - Does It Matter?
- Index(es):
Relevant Pages
|