#1 Re: Other components » SynZip - uncompress zip data contained in a string » 2012-05-09 10:01:54

Hi, ab,

Thank you for the quick and considered response. I was struggling to visualize how the data was being stored in the WideString variable; your comments have clarified the possibilities, especially the code example,  thank you.

I now know what question to ask the (external) software house about their webservice library - I'll let everyone know how I get on.

Many thanks
PhilW.

#2 Other components » SynZip - uncompress zip data contained in a string » 2012-05-08 15:35:26

PhilW
Replies: 2

Hello,

Firstly, I would like to thank everybody at Synopse for making such wonderful software opensource.

I have Delphi XE, and use the SynZip component for all my zip/unzip tasks in my programs; I have a requirement which I could do with some advice, please.

I am retrieving a zip archive via a webservice, the (external dll) function returning the data in a WideString variable.

Something like this, for instance:
---------------a bit of code-------------
var
   MyWoInterop: IWoWebServiceInterop;
   s: WideString;
begin
   MyWoInterop  := CreateComObject(CLASS_WoWebServiceInterop) as IWoWebServiceInterop;
   Screen.Cursor := crHourGlass;
   try try
      s := MyWoInterop.GetStockProducts(DEF_WEBSITE);
   except
      //...
   end;
   finally
      //...
   end;
---------------------------------------

My question is, how can I uncompress the zip data held in the Widestring variable.  SynZip has a "UncompressString" method, but the code says :
/// uncompress some data, with a proprietary format (including CRC)
// - return '' in case of a decompression failure
function UncompressString(const data: RawByteString) : RawByteString;

which looks as it will not handle zip data, even if the cast from WideString to RawByteString is valid.

What else could I try? Any advice please?
Thanks for your help
Kind regards
PhilW.

Board footer

Powered by FluxBB