Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 1998-06-21
5
Medium Priority
?
549 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 200 total points
ID: 1166405
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
ID: 1166406
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
ID: 1166407
I keep finding more and more info...
  http://www.develop.com/fritz/Articles/cpprep0797.htm
0
 

Author Comment

by:ossentoo
ID: 1166408
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
ID: 9728693
I have the same problem. Do you solve it???
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

963 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