Print Page | Close Window

CXTTipWindow::CreateShadow() bug

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=17743
Printed Date: 24 June 2025 at 6:33pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTTipWindow::CreateShadow() bug
Posted By: VolkerE
Subject: CXTTipWindow::CreateShadow() bug
Date Posted: 04 January 2011 at 3:42am
To correctly modify the window class style in lines 109 and 114, GetClassLong() must be called instead of GetWindowLong() (which returns 0 instead of the current style).

But even after fixing this: this implemention will cause an assertion in the debug build each time a tip window with m_dwTipStyle == (TWS_XT_ALPHASHADOW | TWS_XT_DROPSHADOW) has been displayed. Next time a tip window is created the following assertion in AfxRegisterWndClass() will fail:

    // see if the class already exists
    WNDCLASS wndcls;
    if (::AfxCtxGetClassInfo(hInst, lpszName, &wndcls))
    {
        // already registered, assert everything is good
       
ASSERT(wndcls.style == nClassStyle);




Replies:
Posted By: Oleg
Date Posted: 04 January 2011 at 10:35am
Thanks a lot. Please also change Create method as

BOOL CXTPTipWindow::Create(CWnd* pParentWnd)
{
// register the wnd class.
XTPDrawHelpers()->RegisterWndClass(0, _T("XTPTipWindow"), CS_SAVEBITS | CS_HREDRAW | CS_VREDRAW);

// call the base class for creation.
if (!CWnd::CreateEx(0, _T("XTPTipWindow"), _T(""), WS_POPUP, 0, 0, 0, 0, pParentWnd->m_hWnd, 0, NULL))
{
...


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


Posted By: VolkerE
Date Posted: 04 January 2011 at 11:02am
Hi Oleg,

thank you for the quick response. Works fine now...

Regards,
Volker




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