HIDDEN PROCEDURE Init WITH This ** When the first instance of the DLL inits, this variable ** array will be created. ALl other instances should be able ** to 'see' this variable IF TYPE("aReports") = "U" PUBLIC aReports[1] aReports = NULL ENDIF ENDWITH ENDPROCThen I have a method called AddReport. Inside the viewer, each time a report is displayed,
PROCEDURE AddReport(sAppTitle, sReportTitle, sReportFile, aTables) AS Integer LOCAL iElement, iTemp iElement = 0 WITH This oReportObj = CREATEOBJECT("ReportInfo") oReportObj.sReportId = SYS(2015) oReportObj.sAppTitle = sAppTitle oReportObj.sReportTitle = sReportTitle oReportObj.sReportFile = sReportFile =ACOPY(aTables, oReportObj.aTables) FOR iTemp = 1 TO ALEN(aReports, 1) IF VARTYPE(aReports[iTemp ]) # "O" iElement = iTemp ENDIF ENDFOR IF iElement = 0 iElement = ALEN(aReports, 1) + 1 DIMENSION aReports[iElement] ENDIF aReports[iElement] = oReportObj RETURN iElement ENDWITH ENDPROCThen, any application can instantiate it's own copy of the DLL and call GetReportInfo
DIMENSION aReports[1] nTotReports = oDll.GetReportInfo(@aReports)This allows the calling application to see information about reports currently
PROCEDURE GetReportInfo(aArray) AS Variant LOCAL iRetVal iRetVal = ALEN(aReports) ** aReports is public, and should be available to any application ** which instantiates this DLL =ACOPY(aReports, aArray) RETURN iRetVal ENDPROCAnd my ReportObj is:
DEFINE CLASS ReportInfo AS Session OLEPUBLIC sReportId = "" && Unique report Id sAppTitle = "" && Caption to appear on the window the report is in sReportTitle = "" && Caption to appear on the tab sReportFile = "" && Full path and name of the report file DIMENSION aTables[1] && Array of table information ENDDEFINEOk now the problem. When I call the GetReportInfo function, the array I pass