Print Page | Close Window

[Bug]ReportAddRecordEx bug (with repro steps)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14135
Printed Date: 29 September 2024 at 5:25pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [Bug]ReportAddRecordEx bug (with repro steps)
Posted By: apautrot
Subject: [Bug]ReportAddRecordEx bug (with repro steps)
Date Posted: 24 April 2009 at 10:44am
Launch the ReportAddRecordEx sample, click on "Add records" button. Wait for all the items to be added.

Select the first row which display text "Column 1: Row - 1, Col - 1"). This row is now displayed in the header rows section.

Click any cell of this header row, then click on another one.

This produce a NULL pointer access in the method CReportControl::OnFocusChanging, its first parameter pNewRow being NULL.

-------------


Win 7 x64
VS 2008
CJ 15.13




Replies:
Posted By: apautrot
Date Posted: 02 July 2009 at 4:02am
This bug is still in the version 13.1.

At least, you should reply to people trying to help you finding bugs. Are you only interested in the money I spent buying your products ?

-------------


Win 7 x64
VS 2008
CJ 15.13



Posted By: mdoubson
Date Posted: 03 July 2009 at 8:56pm
This is not 13.1 Core error - this is Sample error - not checked pointer. Coming from old time. Thanks for post.

BOOL CReportControl::OnFocusChanging(CXTPReportRow* pNewRow, CXTPReportColumn* pNewCol) {

 //it was no checking for pNewRow = NULL !!!
 
CXTPReportControl::OnFocusChanging(pNewRow, pNewCol);

// apply changes

CXTPReportRow* pFocusedRow = GetFocusedRow();

if (pFocusedRow && pFocusedRow->GetType() == xtpRowTypeHeader &&
 
pNewRow && pNewRow != GetFocusedRow() && m_pFocusedRecord && pNewRow->GetType() != xtpRowTypeHeader)

*(CMessageRecord*)m_pFocusedRecord = *(CMessageRecord*)pFocusedRow->GetRecord();

UpdateRecord(m_pFocusedRecord, FALSE);

}

Now it works properly. Sample source in SVN updated

 



-------------
Mark Doubson, Ph.D.



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