cancel
Showing results for 
Search instead for 
Did you mean: 

It hangs at the line: FreeLibrary(CRDEngine) in Delphi 7 VCL for CR XI R2

Former Member
0 Kudos

Post Author: d111

CA Forum: General

Does anyone know why I can't close the Delphi 7 VCL and it hangs forever when trying to unload the DLL?

If I call some Export functions it will do this.

I did have to put the crpe32.dll in my application path, as it was the only way I could get my applicaiton to compile.

I also have Visual Studio 2005.NET on my machine that is working fine with CR. But with Delphi 7 I am having issues.

Example:

// Setup and clear report data // -


Crpe1.CloseJob; // equivalent to setting ReportName to '' to force a clear - in case previous report had same name Crpe1.ReportName := reportName; // if same reportname as previous, it will not clear out some report data Crpe1.DiscardSavedData; // If "DiscardSavedData" is called - the DLL will not unload but hang on close. but so will an export...

thanks!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Post Author: d111

CA Forum: General

Crpe1 := nil actually does not help.

Since that code also calls FreeLibrary(CRDEngine) and thus still hangs there ...

I am having the same problem in Delphi 7 and CR XIR2.

I have a form with the Crpe component on it only. (not rdc)

I call code to export a pdf report (Access DB using parameters)

When I close Delphi it keeps running.

So then I inserted some code after the export to try to Free that library.

I tried everthing I can think of but the VCL always say "running". I always have to hit "F2" and reset my project.

finally // See Crystal Reports help: "Contents" Title: "Crystal Reports Print Engine Basics" Crpe1.DiscardSavedData; Crpe1.CloseJob; // Erorr: DLL does not unload. Fails in unit: "CRDynamic" in function: "TCrpeEngine.PEUnloadCrpeDll" on line "Result := FreeLibrary(CRDEngine);" Crpe1.CloseEngine; // this works // Crpe1.UnloadEngine; // hangs on line: "FCrpeEngine.PEUnloadCrpeDLL;" // Crpe1:= nil; // also hangs on line: FreeLibrary(CRDEngine) // FreeAndNil(Crpe1); // same issue with: FreeLibrary(CRDEngine) end;

Former Member
0 Kudos

Post Author: lowellcds

CA Forum: General

Try this Crpe1:= nil

CRPE is an ActiveX component. This should let the components close itself down.