Click here to Skip to main content
15,917,997 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to catch event for dynamic Controls Pin
i2c15-Mar-05 13:51
i2c15-Mar-05 13:51 
AnswerRe: How to catch event for dynamic Controls Pin
Max Santos15-Mar-05 14:17
Max Santos15-Mar-05 14:17 
GeneralRe: How to catch event for dynamic Controls Pin
i2c15-Mar-05 14:37
i2c15-Mar-05 14:37 
GeneralRe: How to catch event for dynamic Controls Pin
Maximilien15-Mar-05 15:02
Maximilien15-Mar-05 15:02 
GeneralRe: How to catch event for dynamic Controls Pin
Max Santos16-Mar-05 0:11
Max Santos16-Mar-05 0:11 
AnswerRe: How to catch event for dynamic Controls Pin
namaskaaram15-Mar-05 18:43
namaskaaram15-Mar-05 18:43 
AnswerRe: How to catch event for dynamic Controls Pin
Cedric Moonen15-Mar-05 20:23
Cedric Moonen15-Mar-05 20:23 
GeneralRe: How to catch event for dynamic Controls Pin
i2c17-Mar-05 4:24
i2c17-Mar-05 4:24 
You all guyz, thank you for u responses. But cedric moonen, got my point 120% right. and his solution is exactly what i needed. I was going through the Wrox "Professional MFC programming with Visual C++", and there the writer took me through the disection of the Different macros used by MFC to declare the Message Maps. they are defined in Afxwin.h.

As suggested by him, too,
ON_COMMAND_RANGE(IDC_BUTTON1, IDC_BUTTON100, OnButtonRange)
will work just fine.

Since i got some inside information from my research, i would like to share it with you guyz. Actually there is a structure for each message handler entry in the message map which is hidden from the programmers. MFC maintains an array of this structure in every class where you use

BEGIN_MESSAGE_MAP( class, baseClass)

That entry structure is something like this:

struct THESTRUCT
{
UINT nMessage;
UINT nID;
UINT nLastID;
UINT nSig;
pointerToFunctionHandler;
};

nMessage is, of course, the message to handle.
nID is, of course, of course, the of target control (for which the message is intended)
nLastID, this is the essence. If you want one function to handle multiple controls having their IDs with in a specific range. Then nID is the Lowest ID inclusive and nLastID is the highest ID.
nSig is a long value that specifies the function Signature of the handler function.

Hope this is helpful.

and Thanks, you've all been very useful. Rose | [Rose]


To hit 3rd floors window you have to AIM for 5th or Higher.
GeneralAuto-fill style listctrl question Pin
djtommye15-Mar-05 13:35
djtommye15-Mar-05 13:35 
GeneralAdding mfc variable .. Pin
vchedalla15-Mar-05 13:05
vchedalla15-Mar-05 13:05 
GeneralRe: Adding mfc variable .. Pin
Christian Graus15-Mar-05 13:30
protectorChristian Graus15-Mar-05 13:30 
GeneralRe: Adding mfc variable .. Pin
vchedalla15-Mar-05 13:54
vchedalla15-Mar-05 13:54 
GeneralRe: Adding mfc variable .. Pin
Christian Graus15-Mar-05 14:04
protectorChristian Graus15-Mar-05 14:04 
GeneralRe: Adding mfc variable .. Pin
vchedalla15-Mar-05 18:24
vchedalla15-Mar-05 18:24 
GeneralRe: Adding mfc variable .. Pin
Christian Graus16-Mar-05 12:20
protectorChristian Graus16-Mar-05 12:20 
QuestionWhy do my icons look like crap on NT? Pin
Ian Bowler15-Mar-05 13:02
Ian Bowler15-Mar-05 13:02 
AnswerRe: Why do my icons look like crap on NT? Pin
Steve Mayfield15-Mar-05 13:39
Steve Mayfield15-Mar-05 13:39 
GeneralRe: Why do my icons look like crap on NT? Pin
Ian Bowler15-Mar-05 13:44
Ian Bowler15-Mar-05 13:44 
GeneralRe: Why do my icons look like crap on NT? Pin
Ian Bowler15-Mar-05 13:57
Ian Bowler15-Mar-05 13:57 
GeneralRe: Why do my icons look like crap on NT? Pin
Steve Mayfield15-Mar-05 15:01
Steve Mayfield15-Mar-05 15:01 
GeneralText Font Pin
Larsson15-Mar-05 12:51
Larsson15-Mar-05 12:51 
GeneralRe: Text Font Pin
Blake Miller15-Mar-05 12:53
Blake Miller15-Mar-05 12:53 
GeneralRe: Text Font Pin
Larsson15-Mar-05 20:56
Larsson15-Mar-05 20:56 
GeneralRe: Text Font Pin
jan larsen16-Mar-05 2:28
jan larsen16-Mar-05 2:28 
GeneralRe: Text Font Pin
Blake Miller16-Mar-05 4:13
Blake Miller16-Mar-05 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.