Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [Bug]ReportAddRecordEx bug (with repro steps)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[Bug]ReportAddRecordEx bug (with repro steps)

 Post Reply Post Reply
Author
Message
apautrot View Drop Down
Groupie
Groupie
Avatar

Joined: 16 April 2009
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote apautrot Quote  Post ReplyReply Direct Link To This Post Topic: [Bug]ReportAddRecordEx bug (with repro steps)
    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

Back to Top
apautrot View Drop Down
Groupie
Groupie
Avatar

Joined: 16 April 2009
Location: France
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote apautrot Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post 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

 

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.172 seconds.