Print Page | Close Window

SubclassWindow of CXTPMDiframeWnd fails

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=9300
Printed Date: 16 April 2024 at 11:22am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: SubclassWindow of CXTPMDiframeWnd fails
Posted By: alistair.m
Subject: SubclassWindow of CXTPMDiframeWnd fails
Date 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.




Replies:
Posted By: Oleg
Date Posted: 14 January 2008 at 9:35am
Hi,
Do you use CXTPTabClientWnd ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: alistair.m
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net