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. subclassing concept

subclassing concept

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 3 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.
  • 2 Offline
    2 Offline
    23_444
    wrote on last edited by
    #1

    I am a little fuzzy on this concept of subclassing. I have derived my own control (derived from CEdit). I am able to utilize all of the messages common to CEdit doing this. I have seen other examples of code where the function SubClassWindow (not necessarily with a CEdit) is used by itself and also in addition to a derived class. What's the difference? When should one be used with/instead of the other. Seems both methods are doing the same thing.

    H J 2 Replies Last reply
    0
    • 2 23_444

      I am a little fuzzy on this concept of subclassing. I have derived my own control (derived from CEdit). I am able to utilize all of the messages common to CEdit doing this. I have seen other examples of code where the function SubClassWindow (not necessarily with a CEdit) is used by itself and also in addition to a derived class. What's the difference? When should one be used with/instead of the other. Seems both methods are doing the same thing.

      H Offline
      H Offline
      HumanOsc
      wrote on last edited by
      #2

      Hello... mx483 wrote: What's the difference? Nothing... In front of the subclassing concept... It's only a difference of the design concept... I believe you have read two different solutions of subclassing, the first "used by itself" in the good old c style without inhertance and the other one in c++ with oo aspects... :) Best regards... :)

      1 Reply Last reply
      0
      • 2 23_444

        I am a little fuzzy on this concept of subclassing. I have derived my own control (derived from CEdit). I am able to utilize all of the messages common to CEdit doing this. I have seen other examples of code where the function SubClassWindow (not necessarily with a CEdit) is used by itself and also in addition to a derived class. What's the difference? When should one be used with/instead of the other. Seems both methods are doing the same thing.

        J Offline
        J Offline
        Jose Lamas Rios
        wrote on last edited by
        #3

        There is one "subclassing" meaning in the usual class derivation: if class A derives from B, then A is a subclass of B. The meaning of "sublassing" in methods like SubclassWindow is different. It refers to the act of changing the function that processes the messages directed to a given window (its window proc) to the one you want. -- jlr http://jlamas.blogspot.com/[^]

        2 1 Reply Last reply
        0
        • J Jose Lamas Rios

          There is one "subclassing" meaning in the usual class derivation: if class A derives from B, then A is a subclass of B. The meaning of "sublassing" in methods like SubclassWindow is different. It refers to the act of changing the function that processes the messages directed to a given window (its window proc) to the one you want. -- jlr http://jlamas.blogspot.com/[^]

          2 Offline
          2 Offline
          23_444
          wrote on last edited by
          #4

          I believe those messages are being captured when you derive a class from another class. So would the real difference be that using the derivation method you are able to add your own functions and implementation rather than just capture messages using the SubClassWindow function?

          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