Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. sub-classing CComboBox

sub-classing CComboBox

Scheduled Pinned Locked Moved C / C++ / MFC
c++sharepointhelpquestionworkspace
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Stober
    wrote on last edited by
    #1

    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?

    J 1 Reply Last reply
    0
    • S Stober

      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?

      J Offline
      J Offline
      Jack Puppy
      wrote on last edited by
      #2

      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

      S 1 Reply Last reply
      0
      • J Jack Puppy

        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

        S Offline
        S Offline
        Stober
        wrote on last edited by
        #3

        Perfect -- thank you so very much!:)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups