Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - CXTPOffice2007FrameHook::RedrawFrame()  Crashes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPOffice2007FrameHook::RedrawFrame() Crashes

 Post Reply Post Reply
Author
Message
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post Topic: CXTPOffice2007FrameHook::RedrawFrame() Crashes
    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 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.

Back to Top
gwoin View Drop Down
Groupie
Groupie
Avatar

Joined: 09 September 2004
Location: France
Status: Offline
Points: 52
Post Options Post Options   Thanks (0) Thanks(0)   Quote gwoin Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Didi View Drop Down
Groupie
Groupie


Joined: 05 July 2013
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Didi Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Didi View Drop Down
Groupie
Groupie


Joined: 05 July 2013
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote Didi Quote  Post ReplyReply Direct Link To This Post Posted: 11 October 2016 at 7:26am
PS solved
The problem was a resource leak in my own code.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.063 seconds.