How to Use LZCOPYFILE Function to Decompress or Copy FilesID: Q88257
|
Included with Windows versions 3.0 and 3.1 is a dynamic-link library (DLL)
named LZEXPAND.DLL that contains routines to manipulate compressed files.
The functions in LZEXPAND.DLL manipulate files that are compressed by the
COMPRESS.EXE utility supplied with the Windows Software Development Kit
(SDK) versions 3.0 and 3.1. These functions allow you to expand
(decompress) a compressed file.
The following example demonstrates how to use the LZCOPYFILE function
included in LZEXPAND.DLL. This function is used to expand a compressed
file or to copy a file.
The following is a small program that will copy or decompress a file
in Visual Basic for Windows:
Declare Function LZCOPY Lib "LZEXPAND.DLL" (ByVal SOURCEHANDLE As
Integer, ByVal DESTHANDLE As Integer) As Long
Open "Source" For Input As #1 ' Insert the name and path of the
' file to be decompressed, or copied.
Open "Dest" For Output As #2 ' Insert the name and path of the
' destination file here.
SOURCEHANDLE% = Fileattr(1,2)
DESTHANDLE% = Fileattr(2,2)
RETURNCODE& = Lzcopy(Sourcehandle%, Desthandle%)
Close
-1 invalid input handle
-2 invalid output handle
-3 corrupt compressed file format
-4 out of space for output file
-5 insufficient memory for LZFile struct
-6 bad global handle
-7 input parameter out of range
-8 compression algorithm not recognized
Additional query words: 2.00 3.00
Keywords :
Version :
Platform :
Issue type :
Last Reviewed: June 21, 1999