Skip to Content
0

VB6 Crystal Reports XI GDI Objects Not Releasing

Apr 05, 2017 at 09:57 AM

61

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Don Williams
Jun 22 at 09:19 PM
0

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.

Share
10 |10000 characters needed characters left characters exceeded