XTP_NM_REPORT_SORTORDERCHANGED crash |
Post Reply |
Author | |
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
Posted: 02 November 2009 at 10:39am |
Using 12.0.1. Same code for 13.2...
From source comments:
This is what the DOCUMENTATION SAYS:
// BEGIN_MESSAGE_MAP(CReportSampleView, CXTPReportView)
// ON_NOTIFY(XTP_NM_REPORT_SORTORDERCHANGED, XTP_ID_REPORT_CONTROL, OnReportSortOrderChanged) // END_MESSAGE_MAP() // // void CReportSampleView::OnReportSortOrderChanged(NMHDR* pNotifyStruct, LRESULT* /*result*/) // { // XTP_NM_REPORTRECORDITEM* pItemNotify = (XTP_NM_REPORTRECORDITEM*) pNotifyStruct; // ASSERT(pItemNotify != NULL); // // // TODO: Handle command. // } From source:
This is what the CODE DOES:
m_pControl->SendNotifyMessage(XTP_NM_REPORT_PRESORTORDERCHANGED); // Second parameter is NULL!
LRESULT CXTPReportControl::SendNotifyMessage(UINT nMessage, NMHDR* pNMHDR) const <------ NULL!
{ if (!IsWindow(m_hWnd)) return 0; NMHDR nmhdr;
if (pNMHDR == NULL) pNMHDR = &nmhdr; <---------- assignment! pNMHDR->hwndFrom = GetSafeHwnd();
pNMHDR->idFrom = GetDlgCtrlID(); pNMHDR->code = nMessage; CWnd *pOwner = GetOwner();
if (pOwner && IsWindow(pOwner->m_hWnd)) return pOwner->SendMessage(WM_NOTIFY, pNMHDR->idFrom, (LPARAM)pNMHDR); <--- NOT the struct we expect! else return 0; } WM_NOTIFY does NOT send a XTP_NM_REPORTRECORDITEM struct for XTP_NM_REPORT_PRESORTORDERCHANGED message! So you will get a CRASH!
It's a bug. Period. End of discussion. Please fix it.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
piece of XTPRecordHeader.cpp file ver 12.1:
m_pControl->SendNotifyMessage(XTP_NM_REPORT_PRESORTORDERCHANGED);
if (bGroupOrderChanged)
m_pControl->Populate(); elsem_pControl->ReSortRows(); m_pControl->SendNotifyMessage(XTP_NM_REPORT_SORTORDERCHANGED); |
|
znakeeye
Senior Member Joined: 26 July 2006 Status: Offline Points: 1672 |
Post Options
Thanks(0)
|
FACT: My post shows a bug OR erroneous documentation.
You obviously did not read it.
|
|
PokerMemento - http://www.pokermemento.com/
|
|
mdoubson
Senior Member Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
|
No, I do. You can use derived classes with extra details used
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |