Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - ReportControl
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ReportControl

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


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post Topic: ReportControl
    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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 10 July 2009 at 5:56am

Hi,

Why do you send mssage and not call OnAddRecordEx directly ?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
securigy View Drop Down
Groupie
Groupie


Joined: 23 November 2007
Status: Offline
Points: 41
Post Options Post Options   Thanks (0) Thanks(0)   Quote securigy Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
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.063 seconds.