Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - OnReportSelChanged doesn't seem to have valid row
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

OnReportSelChanged doesn't seem to have valid row

 Post Reply Post Reply
Author
Message
drisch View Drop Down
Groupie
Groupie


Joined: 06 July 2006
Status: Offline
Points: 16
Post Options Post Options   Thanks (0) Thanks(0)   Quote drisch Quote  Post ReplyReply Direct Link To This Post Topic: OnReportSelChanged doesn't seem to have valid row
    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

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post 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
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.125 seconds.