![]() |
ReportControl |
Post Reply ![]() |
Author | |
securigy ![]() Groupie ![]() Joined: 23 November 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() Posted: 09 July 2009 at 9:54pm |
I add records to report control like this:
CMessageRecord* pMsg = new CMessageRecord( nIconId,dwMinorClassId, csItem[0], csItem[1], csItem[2], csItem[3], nConnIconId, nRemIconId, nAuthIconId, csItem[7], csItem[8], pDevInfo, tDEVICE); if(pMsg)this->SendMessage(WM_ADD_RECORD_EX, (WPARAM)pMsg, 0); while the message handler in report control is quite generic:
LRESULT CReportControl::OnAddRecordEx(WPARAM wParam, LPARAM /*lParam*/){ if(!pRecord) return -1; AddRecord(pRecord); Populate(); RedrawControl(); return 0;} The records are displayed in the control. However, when I try right away to update a record and in CREportControl::OnUpdateRecord handler call:CXTPReportRecords* pRecords = GetRecords(); int iCount = pRecords->GetCount();the iCount is 0 !!!
Anybody can shed a light what I am nissing here?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi, Why do you send mssage and not call OnAddRecordEx directly ?
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
securigy ![]() Groupie ![]() Joined: 23 November 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() |
I guess there is no real reason for that in this particular situation, but I also do it from other threads via PostMessage...Why do you think it make a difference? I can try to call it directly and let you know if it changed anything...
|
|
![]() |
|
securigy ![]() Groupie ![]() Joined: 23 November 2007 Status: Offline Points: 41 |
![]() ![]() ![]() ![]() ![]() |
I tried to call OnAddRecord directly instead of posting the message - it did not change a thing... I still get '0' when I call pRecords->GetCount();
Is it a bug?
|
|
![]() |
|
Oleg ![]() Admin Group ![]() Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
![]() ![]() ![]() ![]() ![]() |
Hi,
GetCount return always number of records inside its array. if it returns 0, you do something wrong in your code. Send sample application and I help you find this problem.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
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 |