Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Error statically linking to V10.40
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Error statically linking to V10.40

 Post Reply Post Reply
Author
Message
snhd View Drop Down
Newbie
Newbie


Joined: 09 July 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote snhd Quote  Post ReplyReply Direct Link To This Post Topic: Error statically linking to V10.40
    Posted: 23 December 2006 at 12:28pm

First-chance exception in app.exe: 0xC0000005: Access Violation.
I am statically linking to CodeJock Lib. with #define _XTP_STATICLINK
when I compile GUI_Outlook sample in VC6.0 with #define _XTP_STATICLINK it also asserts

When I link with V10.31 everything works just fine.
 
The problem occurs while resizing the app.
void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
 CXTPFrameWnd::OnSize(nType, cx, cy);
}


CXTPStatusBar.cpp
void CXTPStatusBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
 CControlBar::OnWindowPosChanged(lpwndpos);

 if (GetPaintManager()->BaseTheme() == xtpThemeRibbon)
<Access violation on the above line>

Output of Call Stack from my application :
CXTPStatusBar::OnWindowPosChanged(tagWINDOWPOS * 0x0012dffc) line 1360 + 14 bytes
CWnd::OnWndMsg(unsigned int 71, unsigned int 0, long 1236988, long * 0x0012dc2c) line 1954
CXTPStatusBar::OnWndMsg(unsigned int 71, unsigned int 0, long 1236988, long * 0x0012dc2c) line 1439
CWnd::WindowProc(unsigned int 71, unsigned int 0, long 1236988) line 1585 + 30 bytes
CControlBar::WindowProc(unsigned int 71, unsigned int 0, long 1236988) line 480 + 20 bytes
AfxCallWndProc(CWnd * 0x00345d50 {CXTPStatusBar hWnd=???}, HWND__ * 0x0001036c, unsigned int 71, unsigned int 0, long 1236988) line 215 + 26 bytes
AfxWndProc(HWND__ * 0x0001036c, unsigned int 71, unsigned int 0, long 1236988) line 368
AfxWndProcBase(HWND__ * 0x0001036c, unsigned int 71, unsigned int 0, long 1236988) line 220 + 21 bytes

Best Regards
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 24 December 2006 at 9:15am
I can't reproduce :( Maybe you didn't add toolkt resources.
 
in GUI_Outlook  try also add to res\GUI_Outlook.rc2" before #include "CodejockSample.rc"
#define _XTP_STATICLINK
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
Kukis View Drop Down
Newbie
Newbie


Joined: 24 May 2006
Status: Offline
Points: 11
Post Options Post Options   Thanks (0) Thanks(0)   Quote Kukis Quote  Post ReplyReply Direct Link To This Post Posted: 28 December 2006 at 11:00am
Problem is related to a new handler
void CXTPStatusBar::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
   CControlBar::OnWindowPosChanged(lpwndpos);
 
   if (GetPaintManager()->BaseTheme() == xtpThemeRibbon)
   {
   ...........
   }
}
 
Roots of the problem are GetPaintManager() call. It can return 0 if m_bCommandBarsTheme == FALSE
(at least i'm using this style, had to make quick fix myself)
 
CXTPPaintManager* CXTPStatusBar::GetPaintManager() const
{
   if (!m_bCommandBarsTheme)  <---------------------- here
      return NULL;
 
   if (m_pCommandBars)
      return m_pCommandBars->GetPaintManager();
   return XTPPaintManager();
}
 
Quick solution would be to change library and recompile, or add your own status bar and add handler
ON_WM_WINDOWPOSCHANGED() with check for NULL return:
 
void CStatusBarEx::OnWindowPosChanged(WINDOWPOS* lpwndpos)
{
   CControlBar::OnWindowPosChanged(lpwndpos);
 
   CXTPPaintManager* pManager = GetPaintManager();
   if (pManager && pManager->BaseTheme() == xtpThemeRibbon)
   {
   ...............
   }
}
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


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: 28 December 2006 at 3:10pm
Thanks. You right. Changed.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
snhd View Drop Down
Newbie
Newbie


Joined: 09 July 2006
Status: Offline
Points: 15
Post Options Post Options   Thanks (0) Thanks(0)   Quote snhd Quote  Post ReplyReply Direct Link To This Post Posted: 29 December 2006 at 2:57am
Hi Kukis
 
Thanks
Merry Christmas.
A very Happy & Prosperous New Year to you & all.
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.032 seconds.