MFC Subclassing 
Author Message
 MFC Subclassing

Hi,

How do we accomplish dynamic subclassing using CWnd/CFrameWnd derived
classes?  I understand something called "SubclassWindow" exists.  What I
need to do is that a child window must sub-class the parent window to
intercept a few messages and perform pre-processing, i.e., the child window,
after doing its thing must delegate the call to the original "WndProc" so
that the original functionality is retained.

Using Win32, this is a simple issue.  How can this be done using MFC?

Thanks a lot.
:).

--
Ranju. V
--



Sat, 29 Nov 2003 16:26:30 GMT  
 MFC Subclassing

CWnd::SubclassWindow
BOOL SubclassWindow( HWND hWnd );

quote from MSDN...

Quote:

> Hi,

> How do we accomplish dynamic subclassing using CWnd/CFrameWnd derived
> classes?  I understand something called "SubclassWindow" exists.  What I
> need to do is that a child window must sub-class the parent window to
> intercept a few messages and perform pre-processing, i.e., the child
window,
> after doing its thing must delegate the call to the original "WndProc" so
> that the original functionality is retained.

> Using Win32, this is a simple issue.  How can this be done using MFC?

> Thanks a lot.
> :).

> --
> Ranju. V
> --



Sat, 29 Nov 2003 20:10:48 GMT  
 MFC Subclassing
Just crate a subclass in the ClasWizard, then use this as your class
type. Avoids SubClassWindow having to be explicitly used.
                        joe

Quote:

>Hi,

>How do we accomplish dynamic subclassing using CWnd/CFrameWnd derived
>classes?  I understand something called "SubclassWindow" exists.  What I
>need to do is that a child window must sub-class the parent window to
>intercept a few messages and perform pre-processing, i.e., the child window,
>after doing its thing must delegate the call to the original "WndProc" so
>that the original functionality is retained.

>Using Win32, this is a simple issue.  How can this be done using MFC?

>Thanks a lot.
>:).

>--
>Ranju. V

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Mon, 01 Dec 2003 02:07:18 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Subclassing in MFC

2. Subclassing Windows class in MFC

3. newbie: subclassing richedit in an ActiveX MFC ctl

4. subclassing a MFC subclassed window

5. Subclassing Activex controls from commctrl (treectrl) in MFC

6. Subclassing (superclassing?) MFC control from commctrl (treectrl)

7. Subclassing MFC

8. MFC OCX Subclassing Problem

9. MFC Clist control subclassing

10. Subclassing MFC windows

11. US-TX-DFW DALLAS DEVELOPERS - Visual C++ / MFC / JUST ONE YEAR OF MFC ----MFC---MFC

12. Subclassing System.Web.UI.Page

 

 
Powered by phpBB® Forum Software