AndyAinscow
asked on
Message being 'eaten' by reflect macro
I have a customised CEdit based class with a reflaect handler for the WM_KILLFOCUS message
ON_CONTROL_REFLECT(EN_KILL FOCUS, OnKillfocus)
In my dialog I have a control subclassed (via DDX, DDX_Control(pDX, IDC_DATE1, m_ctlDateBooking) ) and a message handler for the KillFocus
ON_EN_KILLFOCUS(IDC_DATE1, OnKillfocusDateBooking)
However the OnKillfocusDateBooking in the dialog is never called, the reflected message handler is. My understanding of the reflect is that the dialog should be given first crack at the message (I would want BOTH handlers to be called ideally but I can live with an extra line of code in the dialog to specifically call the fn in the edit based class).
ON_CONTROL_REFLECT(EN_KILL
In my dialog I have a control subclassed (via DDX, DDX_Control(pDX, IDC_DATE1, m_ctlDateBooking) ) and a message handler for the KillFocus
ON_EN_KILLFOCUS(IDC_DATE1,
However the OnKillfocusDateBooking in the dialog is never called, the reflected message handler is. My understanding of the reflect is that the dialog should be given first crack at the message (I would want BOTH handlers to be called ideally but I can live with an extra line of code in the dialog to specifically call the fn in the edit based class).
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Usually TRUE value returned from message handler stops message processing, so this is error in the Technical Note.
ASKER
It runs OK on Win98 and Win2000. Does look like a bug in help file.
ASKER
There is one tiny problem. If I return TRUE as you and the help files suggest the message is still eaten. However returning false allows the dialog to receive the message as well.
I've got to test further. This has reminded me of something some years ago. On Win98 and on Win2000 one required a return of TRUE to do as the help files said, the other OP system required a return of FALSE.