Delphi Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Delphi Examples

Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
RSA Encryption
S/MIME
Socket
Spider
String
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Byte Array
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
Bzip2
LZW
Bz2
Icon

Type Conversion

 

Article: Understanding COM References in Delphi

Unzip with Progress Monitoring

Download Chilkat Zip ActiveX

Delphi example program to open a .zip file and unzip, with percent-done progress monitoring callbacks.

// Unzip with progress monitoring.
procedure TForm1.Button2Click(Sender: TObject);
var
  saveExtraPath: Integer;
  success: Integer;
begin
  ChilkatZip21.UnlockComponent('anything for 30-day trial');

  // Open an existing .zip file.
  success := ChilkatZip21.OpenZip('test.zip');
  if (success = 0) then
    begin
      ChilkatZip21.SaveLastError('zipErrorLog.txt');
      ShowMessage(ChilkatZip21.LastErrorText);
    end
  else
    begin
      // Unzip to a sub-directory relative to the current working
      // directory of the calling process.  The "abc123" directory
      // is created if it does not already exist, and all files
      // are unzipped within it.  If the zip contains a directory tree,
      // the directory tree will be re-created on disk during the unzipping.
      ChilkatZip21.Unzip('abc123');

    end;

end;

// Called each time the percent-done value changes.
procedure TForm1.ChilkatZip21UnzipPercentDone(ASender: TObject;
  percentDone: Integer; out abort: Integer);
begin
  // percentDone holds a value from 1 to 100.
  ProgressBar1.Position := percentDone;

  // To abort the unzip, set the abort argument equal to 1 and return.
  // The commented-out code aborts after the unzip is 50% complete.
  //if (percentDone >= 50) then
    //abort := 1;

end;

 

 

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2007 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · XML Parser