Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Skin Framework
  New Posts New Posts RSS Feed - Bug in Xtrem Toolkit 11.1.0 -> Calendar Demo crash
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in Xtrem Toolkit 11.1.0 -> Calendar Demo crash

 Post Reply Post Reply
Author
Message
inforapid View Drop Down
Groupie
Groupie


Joined: 31 March 2006
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote inforapid Quote  Post ReplyReply Direct Link To This Post Topic: Bug in Xtrem Toolkit 11.1.0 -> Calendar Demo crash
    Posted: 18 April 2007 at 7:24pm
There is a bug in Xtreme Toolkit version 11.1.0 which occures when you statically link the calendar demo sample with the MFC dll and the XTreme Toolkit dll. I'm using Visual Studio .Net 2003. In CCalendarDemoView::OnOfficeThemeChanged, a new CXTPCalendarThemeOffice2007 is created. This leads to a crash in CXTPCalendarThemePart::RefreshMetrics. Please help me soon, so that I don't have to switch back to version 10.4.2.
Thanks in advance
Ingo
Back to Top
inforapid View Drop Down
Groupie
Groupie


Joined: 31 March 2006
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote inforapid Quote  Post ReplyReply Direct Link To This Post Posted: 18 April 2007 at 7:34pm
Sorry, I meant
"which occures when you statically link the calendar demo sample with the MFC LIB and the XTreme Toolkit LIB"."
Ingo
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 19 April 2007 at 2:35am
Hello,
 
Sorry, can't reproduce it, what line of code in CXTPCalendarThemePart::RefreshMetrics has problem? Guess its something with resources related.
 
btw. Why you wrote it in SkinFramework forum. May be you somehow modified sample before run?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
inforapid View Drop Down
Groupie
Groupie


Joined: 31 March 2006
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote inforapid Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2007 at 3:22pm
Hello Oleg,
 
The only thing I have changed is that I have switched the project settings from dynamically linking the MFC dll to statically linking the MFC library. I have used Visual Studio .Net 2003.
 
The exception occures in line 597 of xtpcalendartheme.cpp (int nCount = m_arMembers.GetCount();). When I set a breakpoint on this line, the crash occures the second time when the line is passed at program start.
 
The call stack is:
 
> CalendarDemoD.exe!CXTPCalendarThemePart::RefreshMetrics(int bRefreshChildren=1)  Zeile 597 + 0xe C++
  CalendarDemoD.exe!CXTPCalendarTheme::CTOHeader::RefreshMetrics(int bRefreshChildren=1)  Zeile 1479 C++
  CalendarDemoD.exe!CXTPCalendarThemeOffice2007::CTOHeader::RefreshMetrics(int bRefreshChildren=1)  Zeile 747 C++
  CalendarDemoD.exe!CXTPCalendarThemePart::RefreshMetrics(int bRefreshChildren=1)  Zeile 603 + 0xf C++
  CalendarDemoD.exe!CXTPCalendarThemeOffice2007::RefreshMetrics(int bRefreshChildren=1)  Zeile 572 C++
  CalendarDemoD.exe!CXTPCalendarThemeOffice2007::CXTPCalendarThemeOffice2007()  Zeile 331 C++
  CalendarDemoD.exe!CCalendarDemoView::OnOfficeThemeChanged(int nTheme=6)  Zeile 1298 + 0x36 C++
  CalendarDemoD.exe!CCalendarDemoView::OnInitialUpdate()  Zeile 549 + 0x12 C++
  CalendarDemoD.exe!CWnd::OnWndMsg(unsigned int message=868, unsigned int wParam=0, long lParam=0, long * pResult=0x0012f9d4)  Zeile 2023 C++
  CalendarDemoD.exe!CWnd::WindowProc(unsigned int message=868, unsigned int wParam=0, long lParam=0)  Zeile 1745 + 0x1e C++
  CalendarDemoD.exe!AfxCallWndProc(CWnd * pWnd=0x012eaea8, HWND__ * hWnd=0x000b03d8, unsigned int nMsg=868, unsigned int wParam=0, long lParam=0)  Zeile 241 + 0x1a C++
  CalendarDemoD.exe!CWnd::SendMessageToDescendants(HWND__ * hWnd=0x000e03c8, unsigned int message=868, unsigned int wParam=0, long lParam=0, int bDeep=1, int bOnlyPerm=1)  Zeile 2771 C++
  CalendarDemoD.exe!CWnd::SendMessageToDescendants(unsigned int message=868, unsigned int wParam=0, long lParam=0, int bDeep=1, int bOnlyPerm=1)  Zeile 155 + 0x20 C++
  CalendarDemoD.exe!CFrameWnd::InitialUpdateFrame(CDocument * pDoc=0x012e5ad8, int bMakeVisible=1)  Zeile 752 C++
  CalendarDemoD.exe!CDocTemplate::InitialUpdateFrame(CFrameWnd * pFrame=0x012e5b70, CDocument * pDoc=0x012e5ad8, int bMakeVisible=1)  Zeile 328 C++
  CalendarDemoD.exe!CSingleDocTemplate::OpenDocumentFile(const char * lpszPathName=0x00000000, int bMakeVisible=1)  Zeile 203 C++
  CalendarDemoD.exe!CDocManager::OnFileNew()  Zeile 854 C++
  CalendarDemoD.exe!CWinApp::OnFileNew()  Zeile 25 C++
  CalendarDemoD.exe!_AfxDispatchCmdMsg(CCmdTarget * pTarget=0x00cf8180, unsigned int nID=57600, int nCode=0, void (void)* pfn=0x006babdc, void * pExtra=0x00000000, unsigned int nSig=53, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Zeile 89 C++
  CalendarDemoD.exe!CCmdTarget::OnCmdMsg(unsigned int nID=57600, int nCode=0, void * pExtra=0x00000000, AFX_CMDHANDLERINFO * pHandlerInfo=0x00000000)  Zeile 396 + 0x27 C++
  CalendarDemoD.exe!CWinApp::ProcessShellCommand(CCommandLineInfo & rCmdInfo={...})  Zeile 27 + 0x1e C++
  CalendarDemoD.exe!CCalendarDemoApp::InitInstance()  Zeile 170 + 0xc C++
  CalendarDemoD.exe!AfxWinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=1)  Zeile 39 + 0xb C++
  CalendarDemoD.exe!WinMain(HINSTANCE__ * hInstance=0x00400000, HINSTANCE__ * hPrevInstance=0x00000000, char * lpCmdLine=0x00151f10, int nCmdShow=1)  Zeile 25 C++
  CalendarDemoD.exe!WinMainCRTStartup()  Zeile 251 + 0x30 C
  kernel32.dll!7c816fd7()  
  ntdll.dll!7c9206eb()  
 
The exception is:

Unbehandelte Ausnahme bei 0x00938079 in CalendarDemoD.exe: 0xC0000005: Zugriffsverletzung-Leseposition 0x00000058.
 
I hope this will help you to locate the bug.
 
You're right, I should have posted it in the calendar control forum.
 
Kind Regards
Ingo
Back to Top
inforapid View Drop Down
Groupie
Groupie


Joined: 31 March 2006
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote inforapid Quote  Post ReplyReply Direct Link To This Post Posted: 19 April 2007 at 4:00pm
Hello Oleg,
 
Maybe the cause for the exception is how you're using the embedded class CTOHeader and how you cast it to CXTPCalendarThemePart. When the function m_arMembers.GetCount() is called, the instruction pointer doesn't jump into the function, it goes into the nirvana. I have seen a similar bug long time ago when a class, which has been derived from multiple other classes by multiple inheritance, wasn't casted correctly to the appropriate base class. An other possible cause may be a bug in the version 2003 of visual studio .net.
 
Kind Regards
Ingo
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


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: 20 April 2007 at 9:04am
Hello,
 
Thanks,  Ingo, I reproduced exactly same error :( Strange that all work with vc6 and vc 2005, I will ask our Calendar developer to find reason ASAP.
 
Thanks.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2007 at 1:12pm
Guys,

The easiest way to fix this problem is to install Visual Studio .NET 2003 Service Pack 1. Look at http://www.microsoft.com/downloads/details.aspx?familyid=69d2219f-ce82-46a5-8aec-072bd4bb955e


If you'd like to know what happened -- the problem is that TBase::RefreshMetrics was called with wrong 'this' pointer value.

When you change a code like below - it works fine:

TBase* pBase = this;
pBase->TBase::RefreshMetrics(bRefreshChildren);

 
For this case we can simply comment this call because it does nothing in the base class (and rebuild the toolkit):

void
CXTPCalendarTheme::CTOHeader::RefreshMetrics(BOOL bRefreshChildren)
{
    ...
   
    // TBase::RefreshMetrics(bRefreshChildren); // comment this line.
    ...



--
WBR,
Serge
Back to Top
inforapid View Drop Down
Groupie
Groupie


Joined: 31 March 2006
Status: Offline
Points: 38
Post Options Post Options   Thanks (0) Thanks(0)   Quote inforapid Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2007 at 1:32pm
Hello Serge,
 
Thank you very much for your fast reply, changing the code to
 
TBase* pBase = this;
pBase->TBase::RefreshMetrics(bRefreshChildren);
as you suggested fixed the bug for me. Will you include it in the next release?
 
You also suggested to install Service Pack 1. This doesn't have an effect, because I had already installed Service Pack 1 when the error occured.
 
One last question: Which Visual Studio version do you use at Codejock for development? Do you think it would be better for me to switch to Visual Studio 2005?
 
Kind Regards
Ingo
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 16 May 2007 at 5:15pm
Ingo,

Yes, the fix is already included in sources of next versions.

Regarding Visual Studio versions -- we do use different ones, but main targets are VS6 +SP6 (without .NET),  VS2003 + SP1 (.NET 1.x), and VS2005 (.NET 2.x). But we do like to install all latest Visual Studio updates

--
WBR,
Serge
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.156 seconds.