Richsoft VBZip Version 1

VBZip is a ActiveX control designed to allow developers to add standard ZIP compression and decompression to their own application.

Installation
Data Types
Methods
Properties
Events
Legal Stuff


Installation

The following files are required when using the control

 
VBZip_Control.ocx - The actual ActiveX control
Zipit.dll  } Dll required to access InfoZip dlls (Working on how to by-pass this in later versions)
Zipdll.dll } Info-Zip dlls
Unzdll.dll }
 

Back to top


Data Types

ZipAction

Used to specify what action to take when zipping and unzipping

 
Public Enum ZipAction
    zipDefault = 1
    zipFreshen = 2
    zipUpdate = 3
End Enum
ZipLevel

Used to specify the compression level

 
Public Enum ZipLevel
    zipStore = 0
    zipLevel1 = 1
    zipSuperFast = 2
    zipFast = 3
    zipLevel4 = 4
    zipNormal = 5
    zipLevel6 = 6
    zipLevel7 = 7
    zipLevel8 = 8
    zipMax = 9
End Enum
ZipFileEntry

Contains the file information for archive entries

 
Public Version As Integer
Public Flag As Integer
Public CompressionMethod As Integer
Public FileDateTime As Date 'was String
Public CRC32 As Long
Public CompressedSize As Long
Public UncompressedSize As Long
Public FileNameLength As Integer
Public ExtraFieldLength As Integer
Public Filename As String
 

Back to top


Methods

 
Public Sub About()

Displays information about the control

 

 
Public Function ConvertBytesToString(Bytes As Long) As String

Returns a string representing the number of bytes, using 'x bytes', 'x KB' and 'x MB' as appropriate

 
 
Bytes -                number of bytes to be represented
 

 

 
Public Function Add(Files As Collection, ByVal Action As ZipAction, _ 
ByVal StorePathInfo As Boolean, ByVal RecurseSubFolders As Boolean, _
        ByVal UseDOS83 As Boolean, ByVal CompressionLevel As ZipLevel) As Long

Adds the specified files to the archive and returns the number of files successfully added

 
 
Files -                collection of strings containing the path and filename to add
Action -               ZipAction representing the action to be performed
StorePathInfo -        if TRUE stores path information in the archive
RecurseSubFolders -    NO EFFECT
UseDOS83 -             if TRUE files are stored in DOS 8.3 format
CompressionLevel -     ZipLevel representing the compression level required

 

 
Public Function Delete(Files As Collection) As Long

Deletes the specified files from the archive and returns the number of files successfully deleted

 
Files -                collection of strings containing the filenames of files to delete
 

 

 
Public Function Extract(Files As Collection, ByVal Action As ZipAction, _
ByVal UsePathInfo As Boolean, ByVal Overwrite As Boolean, ByVal Path As String) As Long

Extracts specified files from the archive, returning the number of files extracted

 
 
Files -               collection of strings containing the filenames of the files to extract
Action -              ZipAction representing the action to be performed
UsePathInfo -         if TRUE the path structure will be recreated when extracting files
Overwrite -           if TRUE files will be overwrited
Path -                the path files are extracted to (must exist at the moment)
 
 
 
Public Function GetEntry(ByVal Index As Long) As ZipFileEntry

Returns a ZipFileEntry representing the file Index containing its file information

 
 
Index -               index of file in the archive
 

 

 
Public Function GetEntryNum() As Long

Returns the number of files (and, in some archives, directory entries) contained within the archive

 

 
Public Function ParseFilename(ByVal Path As String) As String

Returns the filesname from a full file specification

 
 
Path -                full file specification to parse
 

 

 
Public Function ParsePath(Path As String) As String

Returns the path from a full file specification

 
 
Path -                full file specification to parse
 

 

 
Public Function Read() As Long

Re-reads the archive and returns the number of files (and, in some archives, directory entries) the archive contains
This method is called automatically when the
Filename property is changed

 

Back to top


Properties

Filename

Set and get the current archive, setting this property causes the Read method to be called

Back to top


Events

OnArchiveUpdate()

Raised when the archive is changed or a new archive is loaded

 

OnZipProgress(ByVal Percentage As Integer, ByVal Filename As String)

Raised before each file is zipped up during a zip operation

 

OnZipComplete(ByVal Successful As Long)

Raised after a zip operation completes

 

OnUnzipProgress(ByVal Percentage As Integer, ByVal Filename As String)

Raised before each file is unzipped during a unzip operation

 

OnUnzipComplete(ByVal Successful As Long)

Raised after the completion of a unzip operation

 

OnDeleteProgress(ByVal Percentage As Integer, ByVal Filename As String)

Raised before each file is deleted during a deletion operation

 

OnDeleteComplete(ByVal Successful As Long)

Raised after the completion of a deletion operation

 

Back to top


Legal Stuff

Info-Zip Dlls (Zipdll.dll & Unzdll.dll)
Copyright (c) 1990-1999 Info-ZIP. All rights reserved.
Please read licence.txt for more information

Although I am releasing this software as freeware, if you use any part of it please give credit.
A phrase such as 'Uses code from Richsoft Computing www.richsoftcomputing.btinternet.co.uk' is sufficient.

Good luck

Back to top


Richard Southey
Richsoft Computing (c)2001