Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Bug in CXTOutBarCtrl::GetItemSize
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Bug in CXTOutBarCtrl::GetItemSize

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


Joined: 01 October 2007
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote KirillMueller Quote  Post ReplyReply Direct Link To This Post Topic: Bug in CXTOutBarCtrl::GetItemSize
    Posted: 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.
Back to Top
KirillMueller View Drop Down
Newbie
Newbie


Joined: 01 October 2007
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote KirillMueller Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
KirillMueller View Drop Down
Newbie
Newbie


Joined: 01 October 2007
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote KirillMueller Quote  Post ReplyReply Direct Link To This Post 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.
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: 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
Back to Top
KirillMueller View Drop Down
Newbie
Newbie


Joined: 01 October 2007
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote KirillMueller Quote  Post ReplyReply Direct Link To This Post 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.
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: 02 October 2007 at 5:49am
HI,
Sorry, it is part of Xtreme TaskPanel or Xtreme ToolkitPro only.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.063 seconds.