![]() |
Bug in CXTOutBarCtrl::GetItemSize |
Post Reply
|
| Author | |
KirillMueller
Newbie
Joined: 01 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Topic: Bug in CXTOutBarCtrl::GetItemSizePosted: 01 October 2007 at 3:53pm |
|
The code at lines 1833-1834 of XTOutBarCtrl.cpp (function CSize CXTOutBarCtrl::GetItemSize(const int iFolder, const int iIndex, const RectItem iType)) reads:
if (iIndex < 0 && iIndex >= pBarFolder->GetItemCount()) return CSize(0, 0); Looks like a logic problem, should be || instead of &&... This sometimes crashes my application, however, the sample works fine despite this bug. |
|
![]() |
|
KirillMueller
Newbie
Joined: 01 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 October 2007 at 4:24pm |
|
In fact, my application even crashes when I fix this bug.
For some reason, m_nFirstItem becomes less than zero, and the code is not safe-guarded against this. In PaintItems, there is a loop for (int i = m_nFirstItem; i < nItemCount; i++) that accessess items with index i, and this fails if nFirstItem < 0. |
|
![]() |
|
KirillMueller
Newbie
Joined: 01 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 01 October 2007 at 4:50pm |
|
My code set the currently selected item of a folder using SetSelItem while processing an OBN_XT_FOLDERCHANGE notification. This produced the apparently invalid state of m_nFirstItem < 0. Consider adding an ASSERT.
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 October 2007 at 12:59am |
|
Hi,
Thanks.
Actually CXTOutBarCtrl is very obsolete class, I recommend you use CXTPTaskPanel instead. See Samples\TaskPanel\* samples.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
KirillMueller
Newbie
Joined: 01 October 2007 Status: Offline Points: 7 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 October 2007 at 3:21am |
|
Where do I find the TaskPanel samples? They're not under my
Xtreme Controls v11.2.0\Samples\Controls folder. |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 02 October 2007 at 5:49am |
|
HI,
Sorry, it is part of Xtreme TaskPanel or Xtreme ToolkitPro only.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |