Print Page | Close Window

ReportControl

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=14715
Printed Date: 21 June 2025 at 10:59pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ReportControl
Posted By: securigy
Subject: ReportControl
Date 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*/)

{

CXTPReportRecord* pRecord = (CXTPReportRecord*)wParam;

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?



Replies:
Posted By: Oleg
Date Posted: 10 July 2009 at 5:56am

Hi,

Why do you send mssage and not call OnAddRecordEx directly ?


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: securigy
Date Posted: 10 July 2009 at 3:01pm
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...


Posted By: securigy
Date Posted: 16 July 2009 at 3:16pm
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?


Posted By: Oleg
Date Posted: 17 July 2009 at 1:13am
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



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