EnhCab.NewCabinet

[This is preliminary documentation and subject to change.]

The NewCabinet method creates a new cabinet file.

Syntax

object.NewCabinet( sCab, lMediaSize, lFolderSize, iSetID )
 

Parts

object
Object expression that resolves to an EnhCab object.
sCab
String that contains the path and filename for the new cabinet file.
lMediaSize
Long that indicates the size, in bytes, available for the cabinet file on this media.
lFolderSize
Long that specifies the threshold size, in bytes, for creating a new folder. Files stored within a cabinet file are organized into folders. Each folder contains one or more files and is a compression unit. When a folder reaches lFolderSize, the EnhCab object compresses the files stored in that folder and creates a new folder within the cabinet.
iSetID
Integer that contains the cabinet set identifier.

Remarks

Once your application has created a new cabinet file, it can use the EnhCab.AddFile method to store files in the cabinet file.

QuickInfo

  Windows NT: Unsupported.
  Windows: Requires Windows 98.
  Windows CE: Unsupported.
  Header: Declared in ipenhsnd.idl.
  Import Library: Included as a resource in ipenhsnd.dll.
  Unicode: Yes.

See Also

EnhCab.AddFile, EnhCab.CloseCabinet

Examples

The following example creates a new cabinet file, Cab1.cab, and stores two files in it.

'Create an instance of an EnhCab object
'and store it in the ecab variable
Dim ecab As EnhCab
Set ecab = New EnhCab
 
'Create the cabinet file
ecab.NewCabinet "Cab1.cab", 2000000, 2000000, 1 
 
'Add files to the cabinet file
ecab.AddFile "C:\File1.htm", "File1.htm"
ecab.AddFile "C:\File2.htm", "File2.htm"
 
'Close the cabinet and write it to disk
ecab.CloseCabinet