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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. newbie low-level mfc subclassing q.

newbie low-level mfc subclassing q.

Scheduled Pinned Locked Moved C / C++ / MFC
c++question
2 Posts 2 Posters 1 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
    SirMorrisBig
    wrote on last edited by
    #1

    Hello all! I'm writing an app which uses many mfc controls. I am using subclasses of ScrollBars and DialogBars, TreeCtrls and some raw CWnds each of which require a common set of properties and methods. It would appear that subclassing CWnd at the object (as opposed to HWND) level would be the ideal solution. There's a couple of ways I can think of to achieve this, but I was wondering if anyone has solved this more elegantly than I could. One way I thought of would be to have all of my controls bolted onto a common placeholder class. Another would be to have an HWND->CWnd map and associate a class with each window which could be used to hold all my data. The final one would be to hook CWnd somehow and store a pointer to my data in one of the window data slots. Any takers?!! Thanks, (C:= Charlie.

    L 1 Reply Last reply
    0
    • S SirMorrisBig

      Hello all! I'm writing an app which uses many mfc controls. I am using subclasses of ScrollBars and DialogBars, TreeCtrls and some raw CWnds each of which require a common set of properties and methods. It would appear that subclassing CWnd at the object (as opposed to HWND) level would be the ideal solution. There's a couple of ways I can think of to achieve this, but I was wondering if anyone has solved this more elegantly than I could. One way I thought of would be to have all of my controls bolted onto a common placeholder class. Another would be to have an HWND->CWnd map and associate a class with each window which could be used to hold all my data. The final one would be to hook CWnd somehow and store a pointer to my data in one of the window data slots. Any takers?!! Thanks, (C:= Charlie.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You may use the macro procedures in this way. //this's link to param1=parent (container) //and param2=child inline macro_name(param1,param2){ //implementation } where parent contains a std::vector of child pointers; this's is a solution. gianfranco lanzetta.

      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