Solved

Subclassing (superclassing?) win controls in (MFC not ATL) activex control

Posted on 1998-06-21
5
529 Views
Last Modified: 2013-11-25
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("SysTreeView32");
 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
0
Comment
Question by:ossentoo
  • 3
5 Comments
 
LVL 11

Accepted Solution

by:
alexo earned 100 total points
Comment Utility
Check http://www.frogpond.org/~markg/articles.html.
It contains (among others) articles about window subclassing and superclassing.
0
 
LVL 11

Expert Comment

by:alexo
Comment Utility
Also see http://www.eu.microsoft.com/win32dev/ui/classy32.htm for some explanations

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.

0
 
LVL 11

Expert Comment

by:alexo
Comment Utility
I keep finding more and more info...
  http://www.develop.com/fritz/Articles/cpprep0797.htm
0
 

Author Comment

by:ossentoo
Comment Utility
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


0
 

Expert Comment

by:DAE
Comment Utility
I have the same problem. Do you solve it???
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

After several hours of googling I could not gather any information on this topic. There are several ways of controlling the USB port connected to any storage device. The best example of that is by changing the registry value of "HKEY_LOCAL_MACHINE\S…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now