Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Unable to replace item on the fly
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Unable to replace item on the fly

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1201
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: Unable to replace item on the fly
    Posted: 16 February 2023 at 11:27am
Hi;

I need to replace an CXTPReportRecordItem type on the fly (e.g from CXTPReportRecordItem to CXTPReportRecordItemNumber). For that I tried to write a ReplaceItem function within my CXTPReportRecord derived class:
CXTPReportRecordItem* CMyBrilliantRecord::ReplaceItem(UINT Index, CXTPReportRecordItem* NewItem) {

  if (Index<m_arrItems.GetSize()) {
    m_arrItems[Index]->InternalRelease();
    m_arrItems[Index]=NewItem;
    NewItem->m_pControl = m_pControl;
    NewItem->SetRecord(this);
    return NewItem;
  }
  return nullptr;
}

But it can't compile, because the m_pControl member of the CXTPReportRecordItem class is protected and I can't find a SetReportControl() member function - similar to SetRecord() member function.

Can you at CJ add this function in next release to enable the required feature?

TIA
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022
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.188 seconds.