Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - [solved] SetCaption Called too Early
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

[solved] SetCaption Called too Early

 Post Reply Post Reply
Author
Message
cpede View Drop Down
Senior Member
Senior Member


Joined: 13 August 2004
Location: Denmark
Status: Offline
Points: 645
Post Options Post Options   Thanks (0) Thanks(0)   Quote cpede Quote  Post ReplyReply Direct Link To This Post Topic: [solved] SetCaption Called too Early
    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 (20.3.0)
Platform: Windows 10 (x64)
Language: Visual Studio 2017 (C++)
Back to Top
olebed View Drop Down
Admin Group
Admin Group


Joined: 01 July 2014
Location: Ukraine
Status: Offline
Points: 841
Post Options Post Options   Thanks (0) Thanks(0)   Quote olebed Quote  Post ReplyReply Direct Link To This Post 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
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.156 seconds.