I am managing the lifetime of objects that inherit from CMGRPTReportList where the object is defined like:
Code: Select all
define_com class(#CMGRPTReportList) name(#ReportList) reference(*DYNAMIC)
When I create a new object and kill the current object I am doing this: (STD_TEXT contains the identifier of the object to be created)
Code: Select all
#STD_TEXT := #ReportListMap<#reportId>
if (#ReportList *IsNot *NULL)
#ReportList.uTerminate
set_ref com(#ReportList) to(*NULL)
endif
set_ref com(#ReportList) to(*CREATE_FROM #STD_TEXT)
if (#ReportList *IsNot *NULL)
#ListLayoutItem.Manage <= #ReportList
#ListLayoutItem.Sizing := FitBoth
#ReportList.Parent <= #ListPanel
#ReportList.uInitialize
endif