subclassing concept
-
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.
-
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.
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... :)
-
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.
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/[^]
-
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/[^]
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?