Link to home
Start Free TrialLog in
Avatar of AndyAinscow
AndyAinscowFlag for Switzerland

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_KILLFOCUS, 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).
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndyAinscow

ASKER

Many thanks.
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.
Avatar of AlexFM
AlexFM

Usually TRUE value returned from message handler stops message processing, so this is error in the Technical Note.
It runs OK on Win98 and Win2000.  Does look like a bug in help file.