Print Page | Close Window

CXTPOffice2007FrameHook::RedrawFrame() Crashes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Skin Framework
Forum Description: Topics Related to Codejock Skin Framework
URL: http://forum.codejock.com/forum_posts.asp?TID=6517
Printed Date: 21 November 2024 at 7:09pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPOffice2007FrameHook::RedrawFrame() Crashes
Posted By: gwoin
Subject: CXTPOffice2007FrameHook::RedrawFrame() Crashes
Date Posted: 27 February 2007 at 5:17am
Hi,

I am using Ribbon and own Skin in a MFC application and I think there are some problems with that configuration.
The application crashes some times on XTPSkinManagerAPIHook.
I already tried the forum_posts.asp?TID=6291&PID=20604#20604 - patch from SUNGGI , using CCriticalSection, but it doesn't work for me

Here is the call stack (I renamed the DLL "UID" for shorter):

  • msvcr80d.dll!_CxxThrowException(void * pExceptionObject=0x0012daa0, const _s__ThrowInfo * pThrowInfo=0x783cc534)  Ligne 161    C++
  • >    mfc80d.dll!AfxThrowResourceException()  Ligne 1392    C++
  •      mfc80d.dll!CWindowDC::CWindowDC(CWnd * pWnd=0x046fc8c8)  Ligne 1059    C++
  •      UID.dll!CXTPOffice2007FrameHook::RedrawFrame()  Ligne 329 + 0x11 octets    C++
  •      UID.dll!CXTPOffice2007FrameHook::OnHookMessage(HWND__ * __formal=0x002205a8, unsigned int nMessage=134, unsigned int & wParam=0, long & lParam=395284, long & lResult=1)  Ligne 745    C++
  •      UID.dll!CXTPHookManager::CHookSink::OnHookMessage(HWND__ * hWnd=0x002205a8, unsigned int nMessage=134, unsigned int & wParam=0, long & lParam=395284, long & lResult=1)  Ligne 130 + 0x3d octets    C++
  •      UID.dll!CXTPHookManager::HookWndProc(HWND__ * hWnd=0x002205a8, unsigned int message=134, unsigned int wParam=0, long lParam=395284)  Ligne 202 + 0x1c octets    C++
  •      user32.dll!7d9472f8()    
  •      user32.dll!7d9475e3()    
  •      user32.dll!7d947578()    
  •      user32.dll!7d94bc72()    
  •      user32.dll!7d950ea9()    
  •      UID.dll!CXTPSkinManagerApiHook::CallWindowProcOrig(long (HWND__ *, unsigned int, unsigned int, long)* lpPrevWndFunc=0x01b27fae, HWND__ * hWnd=0x002205a8, unsigned int Msg=134, unsigned int wParam=0, long lParam=395284)  Ligne 172 + 0x19 octets    C++
  •      UID.dll!CXTPSkinManager::DoCallWindowProc(long (HWND__ *, unsigned int, unsigned int, long)* lpPrevWndFunc=0x01b27fae, HWND__ * hWnd=0x002205a8, unsigned int Msg=134, unsigned int wParam=0, long lParam=395284)  Ligne 591    C++
  •      UID.dll!CXTPSkinManager::HookWndProc(HWND__ * hWnd=0x002205a8, unsigned int message=134, unsigned int wParam=0, long lParam=395284)  Ligne 646 + 0x19 octets    C++

In the stack, and in the function below, dc  is NULL:
void CXTPOffice2007FrameHook::RedrawFrame()
{
    if (!m_bDwmEnabled)
    {
        CWindowDC dc(GetSite());
        GetPaintManager()->DrawRibbonFrame(&dc, this);
    }
}


This is very annoying because the application can crash at anytime without I can understand why.

Any idea to avoid this bug ?

Thank you.




Replies:
Posted By: gwoin
Date Posted: 01 March 2007 at 5:04am
Hi,

the problem is still there.
My application crashes in the RibbonBar (CommandBarxxx files) redraw.
It happens really quickly, just after few minutes, even if I don't use it.

Each time, the callstack show that a CDC is empty.

Another sample of calls stack:
  •      msvcr80d.dll!memcmp(const void * lhs=0x00000000, const void * rhs=0x00000000, unsigned int siz=168904)  + 0x19a octets    C
  • >    UID.dll!CXTPCommandBarAnimation::RedrawRect(const tagRECT * lpRect=0x0012f5f0, int bAnimate=1)  Ligne 287 + 0x32 octets    C++
  •      UID.dll!CXTPCommandBar::Redraw(const tagRECT * lpRect=0x0012f5f0, int bAnimate=1)  Ligne 1313    C++
  •      UID.dll!CXTPRibbonBar::OnMouseLeave()  Ligne 1848 + 0x1d octets    C++
  •      mfc80d.dll!CWnd::OnWndMsg(unsigned int message=675, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f84c)  Ligne 2028    C++

Could there be a reason why a CDC created with "CreateCompatibleDC" or with "CXTPCompatibleDC dc(pDC, &bmp);" is empty?

The problem can appears at different places in the Ribbon redraw.
Some other times, it crashes in the XTPOffice2007Image.cpp file, in the "DrawImage" function.

After this line (l. 236): CXTPCompatibleDC dc(pDC, &bmp);
dc has a m_hDC = NULL

I looked at the  XTP samples and I am using the same code to create my window, my ribbonbar and apply skin and ribbon theme.

Any idea to avoid this?


Posted By: Didi
Date Posted: 10 October 2016 at 6:03am
I knkow, this post is very old.
But I have actually the same problem. Was there any solution?
Wy returns the constructor  of  CXTPCompatibleDC  sometimes NULL ? Is that a problem wit windows-resources?

Best regards,
Didi


Posted By: Didi
Date Posted: 11 October 2016 at 7:26am
PS solved
The problem was a resource leak in my own code.



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