[SOLVED]Access viloation on CXTPControlGallery |
Post Reply |
Author | |
jhlee.8804
Newbie Joined: 01 December 2015 Status: Offline Points: 8 |
Post Options
Thanks(1)
Posted: 07 December 2015 at 10:34am |
Hi, I have found a some error when set true to CXTPControlGallery::SetScrollBarAuto. Here is sample code. (Used in "Codejock/Sample/Ribbon/RibbonControls/MainFrm.cpp") // Create Inline Gallery if (pTabGallery) { CXTPRibbonGroup* pGroup = pTabGallery->AddGroup(ID_GROUP_INLINE); pGroup->SetControlsCentering(TRUE); CXTPControlGallery* pControlGallery = new CXTPControlGallery(); pControlGallery->SetControlSize(CSize(192, 60)); pControlGallery->ShowLabels(FALSE); pControlGallery->ShowScrollBar(TRUE); pControlGallery->ShowBorders(TRUE); pControlGallery->SetItems(m_pItemsFontTextColor); pControlGallery->SetScrollBarAuto(TRUE); <<<<<<<<<< I just added one line code !!! pGroup->Add(pControlGallery, ID_GALLERY_STYLES); ... } // Now ScreenShot Just only one item displayed and occurred Access Violation error when mouse move on gallery control. // To-be ScreenShot // CallStack // Stange Codes I think below codes are strange... void CXTPControlGallery::RepositionCore(BOOL bCheckScroll) { CRect rcItems = GetItemsRect(); int x = rcItems.left; int y = rcItems.top; BOOL bFirstItem = TRUE; int nCount = GetItemCount(); // if item count is 10, m_arrRects will be set size too m_arrRects.SetSize(nCount); int nRowHeight = 0; for (int i = 0 ; i < nCount; i++) { CXTPControlGalleryItem* pItem = GetItem(i); m_arrRects.pItem = pItem; m_arrRects.bBeginRow = FALSE; if (pItem->IsLabel()) { ... } else { ... } // but breaked when i == 5 ... // m_arrRects[6] ~ m_arrRects[9] are will be null pointer!!! if (bCheckScroll && y + nRowHeight + rcItems.top > rcItems.Height()) { break; } } y += nRowHeight; m_nTotalHeight = y - rcItems.top; } Thanks.
|
|
agontarenko
Admin Group Joined: 25 March 2016 Status: Offline Points: 299 |
Post Options
Thanks(0)
|
Hello,
I'm glad to inform you that the issue has been fixed. The fix will be available in the next beta or final release. (svn revision 17840) Regards, Artem Gontarenko |
|
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 |