Invalid Window Handle error
Delphi 7
ReportBuilder 10.03
We have developed a multi threaded report generator and have found
recently that if we include a report that contains a TppRichText
component, we get an Invalid Window Handle.... error from the
TCustomRichText.Destroy method from the FRichEdit.Free line when we
free the runtime generated. If the TppRichText component is removed
then the reports all work fine.
Is there any suggested workarounds to this?
Thanks.
ReportBuilder 10.03
We have developed a multi threaded report generator and have found
recently that if we include a report that contains a TppRichText
component, we get an Invalid Window Handle.... error from the
TCustomRichText.Destroy method from the FRichEdit.Free line when we
free the runtime generated. If the TppRichText component is removed
then the reports all work fine.
Is there any suggested workarounds to this?
Thanks.
This discussion has been closed.
Comments
RichText is a wrapper around Delphi's TRichEdit which is a windowed control
and is itself a wrapper around the MS RichEd control. As such, it was not
designed to be used in a multi-threaded context.
That being said, we were able to get it to work in ReportBuilder Server -
which is a multi-threaded report generator. And the ReportBuilder background
thread feature can generate reports that contain RichText components as
well.
Try testing the background print feature included with RB. To do this.
- create a test report on a form
- set Report.BackgroundPrintSettings.Enabled to true and Active to True
- set Report.AllowPrintToFile to True
- add a button to the form and call Report.Print
- now run the test form and press the button. Press the print button from
the preview and the print dialog will display with the Print In Backgroun
check box checked. Specify a PDF file or print to the printer, etc. Press
ok.
Best regards,
Nard Moseley
Digital Metaphors
www.digital-metaphors.com