Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 1998-06-21
5
Medium Priority
?
544 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
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.

688 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