Page 1 of 1

Improvement of Print Preview component

PostPosted: December 4th, 2015, 8:56 am
by fgr
Hi,

I am very delighted of your print preview component that I discovered last week. Great work, it's easy to use and works properly as well.

But since using it, my application compiles with several deprecated warnings and at the end there's a memory leak because of an open filehandle. I slightly patched my local copy like this:

1. The deprecated warnings
In Delphi XE7 the TStream.Seek method you use is deprecated. It can easily be replaced by the overloaded version that takes a parameter of TSeekOrigin enumeration.

2. The memory leak
In Delphi XE7 there's also a memory leak at the end. This occurs because in TTemporaryFileStream.Create a filehandle is created that would never be closed. Adding a overrode destructor that calls CloseHandle(fHandle) resolves that leak.

I really appreciate your work. Thank you very much for this component.
Maybe you'll consider adding those changes to your next version. :-)

Best regards

Florian Grummel

Re: Improvement of Print Preview component

PostPosted: January 3rd, 2016, 7:32 pm
by Kambiz
Hi Florian,

Thank you very much for bringing those problems in my attention.

The new version is up and ready.

Re: Improvement of Print Preview component

PostPosted: March 16th, 2016, 1:49 pm
by sh17