sub-classing CComboBox
-
compiler: VC++ 6.0, SP 6 I subclassed CComboBox into CMyComboBox, then setup up event handlers for several of the reflected events -- one being CBN_CLOSEUP event. I have an object of type CMyComboBox in an MFC program, which also needs to catch the CBN_CLOSEUP event. I used ClassWizard to create all event handlers. Problem: The event handler in CMyComboBox works ok, but the handler in the application program never gets called. I tried having the event handler in CMyBomcoBox post a message to parent, but parent never got it. Is there a way around this problem?
-
compiler: VC++ 6.0, SP 6 I subclassed CComboBox into CMyComboBox, then setup up event handlers for several of the reflected events -- one being CBN_CLOSEUP event. I have an object of type CMyComboBox in an MFC program, which also needs to catch the CBN_CLOSEUP event. I used ClassWizard to create all event handlers. Problem: The event handler in CMyComboBox works ok, but the handler in the application program never gets called. I tried having the event handler in CMyBomcoBox post a message to parent, but parent never got it. Is there a way around this problem?
Try using ON_xxx_REFLECT_EX inplace of ON_xxx_REFLECT. The _EX macro returns a BOOL, which determines whether the parent receives the message. There's a blurb about it here: http://www.microsoft.com/msj/1198/c/c1198.aspx (I found you have to return FALSE, not TRUE as the article states)
Painted on the side of a dog trainer's van: SIT HAPPENS
-
Try using ON_xxx_REFLECT_EX inplace of ON_xxx_REFLECT. The _EX macro returns a BOOL, which determines whether the parent receives the message. There's a blurb about it here: http://www.microsoft.com/msj/1198/c/c1198.aspx (I found you have to return FALSE, not TRUE as the article states)
Painted on the side of a dog trainer's van: SIT HAPPENS