MS有这样的SDK,但是好像不提供cab格式的内存块压缩(还是我没看懂?),我不想麻烦硬盘做中介,并且不想发布dll,我想知道有没有办法直接把一块内存数据压缩成擦cab格式。
如果有谁能够给我讲一下cab的具体格式那么最好不过了!退而求其次,如果有这样的函数或者类提供给我也将非常感谢,但是我希望得到的是能够免费用于商业用途的合法资源。
谢谢!

解决方案 »

  1.   

    另外,zlib单元提供的压缩函数很慢,并且用它压缩的文件比用winzip等软件压缩出来的大,我怀疑他是不是zip压缩算法??
      

  2.   

    http://www.mischel.com/pubs/grab_a_cab.htmListing 1 - Event handlers for the simple CAB list program
    function TCabForm.CabDecompressor1CopyFile(AFilename: PChar;
      Size: Integer; date, time, attribs, iFolder: Word;
      pUserData: Pointer): Integer;
    begin
      ListBox1.Items.Add (AFilename);
      Result := 0;
    end;procedure TCabForm.btnUpdateClick(Sender: TObject);
    begin
      ListBox1.Clear;
      CabDecompressor1.Extract (edFilename.Text, nil);
    end;
      

  3.   

    http://www.torry.net/vcl/compress/std/cabd.zip
    也可用控件實現
    This toolkit consists of two native VCL components TSTCabReader and TSTCabWriter. Using these components, you can easily create CAB archives and then extract files from archives. The components are just wrappers over Microsoft Cabinet.dll. They simplify your work with archives and add useful capabilities. 
      

  4.   

    那你找下
    TurboPower Abbrevia
    開源的!!
      

  5.   

    另外,zlib单元提供的压缩函数很慢,并且用它压缩的文件比用winzip等软件压缩出来的大,我怀疑他是不是zip压缩算法??
      

  6.   

    另外,zlib单元提供的压缩函数很慢,并且用它压缩的文件比用winzip等软件压缩出来的大,我怀疑他是不是zip压缩算法?? ?
    ?
    ?