Skip to Content
author's profile photo Former Member
Former Member

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

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!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 04, 2008 at 02:31 PM

    Post Author: lowellcds

    CA Forum: General

    Try this Crpe1:= nil

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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 06, 2008 at 04:30 PM

    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;

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.