Print Page | Close Window

OnReportSelChanged doesn't seem to have valid row

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=4885
Printed Date: 21 November 2024 at 10:26pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: OnReportSelChanged doesn't seem to have valid row
Posted By: drisch
Subject: OnReportSelChanged doesn't seem to have valid row
Date Posted: 25 August 2006 at 11:34am

Hi,

I am using a message handler for XTP_NM_REPORT_SELCHANGED and interpreting the passed in value as a XTP_NM_REPORTRECORDITEM. Though the pItemNotify->pRow and pItemNotify->pColumn are not null, they also don't seem to be rows or columns as I get a crash any time I try to do something with these pointers such as calling GetIndex() as below:

ON_NOTIFY(XTP_NM_REPORT_SELCHANGED, IDC_REPORT_CTRL, OnReportSelChanged)

void CRefTableDlg::OnReportSelChanged(NMHDR* pNMHDR, LRESULT* pResult)

{

XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*)pNMHDR;

int index = pItemNotify->pColumn->GetIndex(); // causes crash

}

Is this a bug with the toolkit or am I doing something wrong? (I am using v9.81.)

Thanks,

Derek




Replies:
Posted By: sserge
Date Posted: 27 August 2006 at 4:23pm
Hi Derek,

It's actually a bug in the documentation. Actually on this notification you only receive pointer to a regular
NMHDR structure, not to XTP_NM_REPORTRECORDITEM. So far this type conversion is not allowed.

This is so because after changing a selection, it could be simply accessed via GetSelectedRows() method of the Report control.

--
WBR,
Serge



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