Solved

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SSIS 2010 Convert to SSIS 2013 On Different Box 3 63
PL SQL Developer 7 67
No module found pypyodbc, 3 43
Error building VS2105 solution from repository 1 33
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.

740 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