The contract does not specify what would happen if you passed an existing ReportListener reference as the second parameter and the output type did not already exist in the collection. In practice, the RTM Report Output Application ignored this reference.
Beginning in SP1, you can pass a type value and a ReportListener reference and have that reference added to the ReportOutput reference cache, with an appropriate key.
This feature provides a way to take advantage of the _oReportOutput reference collection for caching and configuring ReportListener for various custom output types, without requiring any registry mechanism. In the RTM version, you would have to manipulate the reference collection directly to do the same thing.
The following code shows how you can add a reference to a new output type that you have defined. Note that you need to include the application's optional third, “reload”, parameter if you want to replace an already-existing reference in the collection.
#DEFINE RTF_TYPE 76 #DEFINE OUTPUTAPP_LOADTYPE_RELOAD 2 ox = NEWOBJECT("MyRTFListener","MyLib") DO (_REPORTOUTPUT) WITH RTF_TYPE, ox *_oReportOutput[TRANSFORM(RTF_TYPE)] is now your listener REPORT FORM ? OBJECT TYPE RTF_TYPE && gives you your reference * to replace this cache item with another listener, use reload param: oy = NEWOBJECT("MyOtherRTFListener","MyLib") DO (_REPORTOUTPUT) WITH RTF_TYPE, oy, OUTPUTAPP_LOADTYPE_RELOAD