ossentoo
asked on
Subclassing (superclassing?) win controls in (MFC not ATL) activex control
I would like to sub class / superclass my new control (MFC) from a standard tree control, without having to use ATL.
I have a cs.lpszClassNamer("SysTree View32");
statement in my code (created by AppWizard), but would like to replace the SystreeView32 with my own class, which I have previously tested in a standard MFC app. I cannot simply replace the name and include the class files though, as the execution of the control seems to fail.
Why.
Is there something I can do?
Regards
Oscar
I have a cs.lpszClassNamer("SysTree
statement in my code (created by AppWizard), but would like to replace the SystreeView32 with my own class, which I have previously tested in a standard MFC app. I cannot simply replace the name and include the class files though, as the execution of the control seems to fail.
Why.
Is there something I can do?
Regards
Oscar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Have had a look at this, but I think you have misunderstood the question. Control in MFC.
I have subclassed an ActiveX control from SysTreeView32. I also have class CDireTree which I have previously developed.
I would like to know how I can subclass the control from my own class (CDireTree) instead of deriving it directly from CTreeCtrl (effectively).
I have tried registering a new Windows class, AfxRegisterClass, but how do I then make the new registered windows class use my class or methods?
The alternate method is to attach the control's SysTreeView32 CtreeCtrl's object to my own class. But again, where and how do I do this? I cannot find any way of doing it at all.
Regards
Oscar Ssentoogo
I have subclassed an ActiveX control from SysTreeView32. I also have class CDireTree which I have previously developed.
I would like to know how I can subclass the control from my own class (CDireTree) instead of deriving it directly from CTreeCtrl (effectively).
I have tried registering a new Windows class, AfxRegisterClass, but how do I then make the new registered windows class use my class or methods?
The alternate method is to attach the control's SysTreeView32 CtreeCtrl's object to my own class. But again, where and how do I do this? I cannot find any way of doing it at all.
Regards
Oscar Ssentoogo
I have the same problem. Do you solve it???
Under MFC, you can use CWnd::SubclassWindow or CWnd::SubclassDlgItem
Also see KB article Q103786 and the "Making and Using Controls" topic in your online help.