Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Controls
  New Posts New Posts RSS Feed - CXTTipWindow::CreateShadow() bug
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTTipWindow::CreateShadow() bug

 Post Reply Post Reply
Author
Message
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Topic: CXTTipWindow::CreateShadow() bug
    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);

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: 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
Back to Top
VolkerE View Drop Down
Newbie
Newbie
Avatar

Joined: 09 February 2006
Location: Germany
Status: Offline
Points: 8
Post Options Post Options   Thanks (0) Thanks(0)   Quote VolkerE Quote  Post ReplyReply Direct Link To This Post Posted: 04 January 2011 at 11:02am
Hi Oleg,

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

Regards,
Volker

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.109 seconds.