Print Page | Close Window

Crash in Report Control in 10.4

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6031
Printed Date: 12 November 2025 at 3:25am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Crash in Report Control in 10.4
Posted By: danpetitt
Subject: Crash in Report Control in 10.4
Date Posted: 08 January 2007 at 7:29am
This worked fine in 10.31, now it crashes in 10.4
 
Click on a bit of column text in the ReportSample .. all works.
 
Now, click on the preview text in the report and it crashes.
 
It is because of (new) changes to OnClick:
void CXTPReportRow::OnClick(CPoint ptClicked)
{
 XTP_REPORTRECORDITEM_CLICKARGS clickArgs;
 clickArgs.pControl = m_pControl;
 clickArgs.pRow = this;
 clickArgs.ptClient = ptClicked;
 clickArgs.pColumn = NULL;
 // find clicked item
 clickArgs.pItem = HitTest(ptClicked, &clickArgs.rcItem, &clickArgs.pColumn);
 if (HasChildren() && m_rcCollapse.PtInRect(ptClicked)
  && clickArgs.pColumn && clickArgs.pColumn->IsTreeColumn())
 {
  SetExpanded(!IsExpanded());
  return;
 }
 // notify item if found
 if (!clickArgs.pItem)
  return;
 clickArgs.pItem->OnClick(&clickArgs);
}
 
Because on a preview item, HitTest produces a NULL for the pColumn:
 clickArgs.pItem = HitTest(ptClicked, &clickArgs.rcItem, &clickArgs.pColumn);
 
Therefore:

void CXTPReportRecordItem::OnClick(XTP_REPORTRECORDITEM_CLICKARGS* pClickArgs)
{
 pClickArgs->pRow->InternalAddRef();
 pClickArgs->pColumn->InternalAddRef();
 InternalAddRef();
 
Causes an access violation.



Replies:
Posted By: danpetitt
Date Posted: 08 January 2007 at 7:30am
I cant think of a way to work around this ... any ideas??


Posted By: danpetitt
Date Posted: 08 January 2007 at 8:45am
In the end I have overridden OnClick and OnDblClick in my overriden CXTPReportRecordItemPreview class and commented out the line:
pClickArgs->pColumn->InternalAddRef();
 
So now it works okay without a crash, but I think it would be good to get this fixed in the next release please.
 
Thanks.


Posted By: sserge
Date Posted: 08 January 2007 at 4:04pm
Hi,

This is a known bug. Will be fixed for the nearest release.

--
WBR,
Serge


Posted By: danpetitt
Date Posted: 09 January 2007 at 6:33am
Sorry i hadnt spotted the report, thanks.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net