Jump to content
Registration disabled at the moment Read more... ×
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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×