Print Page | Close Window

Migrating old code to visual studios 2012

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=23375
Printed Date: 25 April 2024 at 2:10pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Migrating old code to visual studios 2012
Posted By: grantguglielmo
Subject: Migrating old code to visual studios 2012
Date Posted: 28 June 2017 at 2:14pm
I am trying to migrate an old application(~2008) to compile in visual studios 2012, but it seems like the newest version of toolkit pro doesn't support some of the old reportcontrol code. Specifically i get errors like:

1>c:\products_complete\app\dumpview.cpp(210): error C2661: 'CXTPReportRow::InitRow' : no overloaded function takes 2 arguments
1>c:\products_complete\app\dumpview.cpp(334): error C2065: 'm_nPopulatedRecordsCount' : undeclared identifier
1>c:\products_complete\app\dumpview.cpp(362): error C2065: 'm_pRecords' : undeclared identifier
1>c:\products_complete\app\dumpview.cpp(689): error C2065: 'm_arrScreenRows' : undeclared identifier

Here is line 362 for the m_pRecords error:
((CVirtualRecords *)m_pRecords)->SetVirtualMode(pVirtualRecord, nCount);

Is there any sort of documentation that list changes that broke support for older versions? If not, does anyone know how to fix errors like these?



Replies:
Posted By: olebed
Date Posted: 30 June 2017 at 7:54am
Hello,

CXTPReportRow::InitRow(CXTPReportControl* pControl, CXTPReportRecord* pRecord)  replaced with 
InitRow(CXTPReportControl *pControl, CXTPReportSection *pSection, CXTPReportRecord  *pRecord)

m_nPopulatedRecordsCount  allocated in CXTPReportSection  (Source\ReportControl\XTPReportSection.h)
Geter is CXTPReportSection::GetPopulatedRecordsCount()

for SetVirtualMode  use  CXTPReportControl::SetVirtualMode(CXTPReportRecord* pVirtualRecord, int nCount, int nFields)

m_arrScreenRows  moved to CTXPReportRows
CXTPReportScreenRows *pScreenRows = pControl->GetRows()->GetScreenRows();
or
pRow = pSection->GetRows()->GetScreenRows()->HitTest(pt);


Regards,
 Oleksandr Lebed


Posted By: grantguglielmo
Date Posted: 08 August 2017 at 11:45am
Thanks, for the help. I had another question about the Draw function in CTXPReportRow, it looks like a lot of new arguments were added. What were the changes to the new Draw?


Posted By: olebed
Date Posted: 08 August 2017 at 12:08pm
Hello,

Only CRect rcClip  was added to Draw method from 2008 year.

CXTPReportRow::Draw(CDC *pDC, CRect rcRow, CRect rcClip, int nLeftOffset, CXTPReportRecordMergeItems &mergeItems)

Instead of 
CRect rcClipBox = m_pControl->GetReportRectangle(); in code below.

It is for properly support of drawing fixed (frozen) rows.

Regards,
 Oleksandr Lebed



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