Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - [solved] Warning:calling DestroyWindow in ~CWnd
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] Warning:calling DestroyWindow in ~CWnd

 Post Reply Post Reply
Author
Message
Alex H. View Drop Down
Senior Member
Senior Member
Avatar

Joined: 12 February 2004
Status: Offline
Points: 266
Post Options Post Options   Thanks (0) Thanks(0)   Quote Alex H. Quote  Post ReplyReply Direct Link To This Post Topic: [solved] Warning:calling DestroyWindow in ~CWnd
    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!
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
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.215 seconds.