Print Page | Close Window

[solved] SetCaption Called too Early

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=23283
Printed Date: 06 July 2025 at 10:30pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: [solved] SetCaption Called too Early
Posted By: cpede
Subject: [solved] SetCaption Called too Early
Date Posted: 07 March 2017 at 5:02am
During creation of the columns in a report control you have code like this:

CXTPReportColumn *pCol = new CXTPReportColumn(0, _T("My Column"), 80);

It seems, that calling SetCaption right after pCol is created is not allowed, since m_pColumns is not defined yet in the CXTPReportColumn class.

You should test for m_pColumns == NULL in CXTPReportColumn, and allow for e.g. SetCaption.

-cpede


-------------
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)



Replies:
Posted By: olebed
Date Posted: 07 March 2017 at 10:35am
Hello cpede,

It is reasonable remark, I have added additional verification of m_pColumns in all methods for safety.
But you should remember that calling most of methods of 
CXTPReportColumn don't have any effect when column isn't linked to ReportControl. Thank you. 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