Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [SOLVED] v15.1.3.0908 SetFocusedRow(NULL)
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[SOLVED] v15.1.3.0908 SetFocusedRow(NULL)

 Post Reply Post Reply
Author
Message
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 443
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Topic: [SOLVED] v15.1.3.0908 SetFocusedRow(NULL)
    Posted: 09 September 2011 at 8:24am
In the new v15.1.3.0908 release of the XTP report control, I get an immediate crash if I invoke:

GetReportCtrl().SetFocusedRow(NULL);

Support for using NULL in this context was added to 15.1.1 to allow us to clear the currently focused row. The crash occurs because the method signature above calls EnsureVisbile(), which in turn doesn't always check to see if the row is NULL.

This problem can be worked around by instead calling:

GetReportCtrl().SetFocusedRow(FALSE, NULL, FALSE, FALSE);

... which bypasses the attempt to ensure row visibility (and thus avoids the crash).

For long term solution, recommend that CodeJock change CXTPReportControl::EnsureVisible(CXTPReportRow *pRow) method so that it *always* checks for NULL row pointer.
Back to Top
ABuenger View Drop Down
Newbie
Newbie
Avatar

Joined: 02 February 2006
Status: Offline
Points: 1075
Post Options Post Options   Thanks (0) Thanks(0)   Quote ABuenger Quote  Post ReplyReply Direct Link To This Post Posted: 09 September 2011 at 11:20am
Thanks, fixed.

Codejock support
Back to Top
adrien View Drop Down
Senior Member
Senior Member


Joined: 30 April 2007
Location: New Zealand
Status: Offline
Points: 449
Post Options Post Options   Thanks (0) Thanks(0)   Quote adrien Quote  Post ReplyReply Direct Link To This Post Posted: 21 September 2011 at 5:18am
I found this too, but it occured when I removed all records from a report.  So it's necessary to be able to call  CXTPReportSections::EnsureVisible(CDC *pDC, CXTPReportRow *pRow) with pRow = NULL.

e.g. XTPReportSections.cpp line 86


BOOL CXTPReportSections::EnsureVisible(CDC *pDC, CXTPReportRow *pRow)
{
BOOL bResult = FALSE;
if(!pRow)
return bResult;


solves the problem for me

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