Jump to content
Ian Branch

Strange one with zLib..

Recommended Posts

Hi Team,

D11.3.1.

I have this compression routine.

procedure CompressStream(SourceStream: TMemoryStream; DestStream: TMemoryStream);
var
  ZStream           : TCompressionStream;
begin
  ZStream := TCompressionStream.Create(clDefault, DestStream);
  try
    ZStream.CopyFrom(SourceStream, SourceStream.Size);
  finally
    ZStream.Free;
  end;
end;

If I have this procedure in my main form it is happy.

If I move it to my Function library, I get this..

image.thumb.png.3fc1547c071d42ad820ad427757014dd.png

 

Why should it be happy in the main form an not in the library?

Yes, I have System.ZLib in the uses in both cases

Thoughts/suggestions?

 

Regards & TIA,

Ian

 

Share this post


Link to post

Most probably one of other units define the TCompressionStream class. You can try to rearange your uses statement or prefix the classname with the unitname.

Share this post


Link to post

Hi Lajos,

Great call.  I found that if I had the System.Zlib after the VCL.Graphics, all is fine.  Before and I get the issue.

Tks for the assist.

 

Regards,

Ian

 

Edit:  I didn't need VCL.Graphics in the library anyway. 😉

Edited by Ian Branch

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×