Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - SubclassWindow of CXTPMDiframeWnd fails
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SubclassWindow of CXTPMDiframeWnd fails

 Post Reply Post Reply
Author
Message Reverse Sort Order
alistair.m View Drop Down
Groupie
Groupie


Joined: 14 January 2008
Location: United Kingdom
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote alistair.m Quote  Post ReplyReply Direct Link To This Post Topic: SubclassWindow of CXTPMDiframeWnd fails
    Posted: 14 January 2008 at 9:41am
No, I derive my CMainFrame from CXTPMDIFrameWnd. The document type we use is a fixed size dialog so doesn't really work with a tabbed client format.

Thanks
Al.
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2008 at 9:35am
Hi,
Do you use CXTPTabClientWnd ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
alistair.m View Drop Down
Groupie
Groupie


Joined: 14 January 2008
Location: United Kingdom
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote alistair.m Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2008 at 7:23am
Hi all

I'm trying to get a subclass working that used to work in my non CodeJock app. Now CMainFrame is derived from CXTPMDIFrameWnd, it asserts at the FromHandlePermanent(hWndNew) in CWnd::Attach(). I assume this is because the CodeJock parent class already has some form of subclassing and you can't subclass twice.

The subclassed class simply overrides OnEraseBkgnd and OnSize and paints text to the MDI frame background as described in many tutorials and examples on the net.
In my CMainFrame::OnCreate() I call:

//subclass to allow erasebkgnd to repaint colour of mainframe
CWnd* pChildWnd = GetWindow(GW_CHILD);
if (pChildWnd)
{
    if (!m_wndMDIClient.SubclassWindow (pChildWnd -> m_hWnd)) {
        TRACE ("Failed to subclass MDI client window\n");
        return (-1);
    }
}

Any thoughts on how I can re-implement this functionality.
Thanks
Al.

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.