Solved

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

Posted on 1998-06-21
5
532 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
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
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.
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.

791 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