Print Page | Close Window

[solved] Warning:calling DestroyWindow in ~CWnd

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=23296
Printed Date: 23 December 2024 at 10:51am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] Warning:calling DestroyWindow in ~CWnd
Posted By: Alex H.
Subject: [solved] Warning:calling DestroyWindow in ~CWnd
Date Posted: 28 March 2017 at 10:17am
It happens when closing my application.
It looks like a problem with CXTPFrameShadow ?

Hi codejock team any idea whats going wrong here?

Stack:

>    cRM.exe!CWnd::~CWnd() Line 804    C++
     cRM.exe!CXTPFrameShadow::~CXTPFrameShadow() Line 225    C++
     [External Code]   
     cRM.exe!CXTPFrameShadow::OnFinalRelease() Line 543    C++
     cRM.exe!CCmdTarget::InternalRelease() Line 177    C++
     cRM.exe!CXTPFrameShadowManager::DisableShadow(HWND__ * hWnd) Line 408    C++
     cRM.exe!CXTPFrameShadowManager::OnHookMessage(tagCWPRETSTRUCT * pc) Line 701    C++
     cRM.exe!CXTPFrameShadowManager::CFrameShadowHook::OnHookMessage(HWND__ * __formal, unsigned int __formal, unsigned int & __formal, long & lParam, long & __formal) Line 108    C++
     cRM.exe!CXTPHookManager::CHookSink::OnHookMessage(HWND__ * hWnd, unsigned int nMessage, unsigned int & wParam, long & lParam, long & lResult) Line 302    C++
     cRM.exe!CXTPHookManager::OnWindowsHookProc(int idHook, int nCode, unsigned int wParam, long lParam) Line 524    C++
     cRM.exe!CXTPHookManager::OnWH_CALLWNDPROCRET(int nCode, unsigned int wParam, long lParam) Line 502    C++
     [External Code]   
     cRM.exe!CFrameWnd::OnClose() Line 937    C++
     cRM.exe!CUIMainFrame::OnClose() Line 4295    C++
     cRM.exe!CWnd::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 2458    C++
     cRM.exe!CXTPCommandBarsSiteBase<CMDIFrameWnd>::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 199    C++
     cRM.exe!CUIMainFrame::OnWndMsg(unsigned int message, unsigned int wParam, long lParam, long * pResult) Line 9659    C++
     cRM.exe!CWnd::WindowProc(unsigned int message, unsigned int wParam, long lParam) Line 2093    C++
     cRM.exe!AfxCallWndProc(CWnd * pWnd, HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 265    C++
     cRM.exe!AfxWndProc(HWND__ * hWnd, unsigned int nMsg, unsigned int wParam, long lParam) Line 418    C++
     [External Code]   
     cRM.exe!CXTPHookManager::HookWndProc(HWND__ * hWnd, unsigned int message, unsigned int wParam, long lParam) Line 431    C++
     [External Code]   
     cRM.exe!CWnd::SendMessageW(unsigned int message, unsigned int wParam, long lParam) Line 32    C++
     cRM.exe!CWinApp::OnAppExit() Line 24    C++
...


We use XTP 17.3 with VS 2015.

Please help!



Replies:
Posted By: olebed
Date Posted: 28 March 2017 at 10:37am
Hello Alex H.,

We have already fixed this warning. New versions of methods are below:
Source\Common\FrameShadow\XTPFrameShadowManager.cpp 
void CXTPFrameShadowManager::DisableShadow(HWND hWnd)
{
    CXTPSimpleCriticalSection::CLock lock(*m_pGuard);

    CXTPFrameShadow* pShadow = GetShadow(hWnd);
    if (NULL != pShadow)
    {
        Notify(&IXTPFrameShadowManagerEvents::OnFrameShadowDisabled, hWnd, pShadow);
        SetShadowThreadMessageHook(pShadow, FALSE);
        m_mapWnd.RemoveKey(hWnd);

        if (::IsWindow(*pShadow))
        {
            pShadow->DestroyWindow();
        }

        DWORD refs = pShadow->InternalRelease();
......
}

Source\TaskPanel\Themes\XTPTaskPanelVisualStudio2010Theme.cpp
void CXTPTaskPanelVisualStudio2010Theme::RefreshMetrics()
{
.......    
            m_themeTreeExplorer->OpenThemeData(wnd, L"TREEVIEW");

            wnd.DestroyWindow();
        }
    }
}

Regards,
 Oleksandr Lebed



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