Skip to Content
avatar image
Former Member

VB6 Crystal Reports XI GDI Objects Not Releasing

I have been tracking memory activity with our VB6 application and have noticed when opening a form with a CrystalActiveXReportViewer control on, running the report and closing the form the GDI Object count does not return to the original figure

If the form is opened and closed without the report being run the GDI Objects return to the original figure

When using the .ViewReport command the GDI Object count jumps. When closing the form the count does not return to the original figure

The following code sets the Path of the Report and create the Objects

stRep = App.Path & IIf(Right(App.Path, 1) = "\", "", "\") & "Reports\SomeReport.rpt"
Set m_oCrystalApp = New CRAXDRT.Application
Set m_oReport = m_oCrystalApp.OpenReport(stRep)

The following lines are run when closing the form but do not reduce the GDI Object count to the figure before the form was opened

Set m_oCrystalApp = Nothing
Set m_oReport = Nothing

I believe the CrystalActiveXReportViewer Control is causing the issue but I have been unable to find any functions to release the GDI Objects that are being held even after the form has been closed

I have searched and searched and cannot find anything that has resolved the issue

I realise these are both legacy products but any help would be much appreciated

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jun 22 at 09:19 PM

    The RDC has been out of support for 10 years now, time to upgrade to CR .NET, no patches and no fixes for it any more

    https://wiki.scn.sap.com/wiki/display/BOBJ/Crystal+Reports%2C+Developer+for+Visual+Studio+Downloads

    All I can suggest is close your app often to release the memory.

    Add comment
    10|10000 characters needed characters exceeded