SAMPLE: Using the LZFILE Functions

Last reviewed: February 15, 1996
Article ID: Q86267
The information in this article applies to:
  • Microsoft Windows Software Development Kit (SDK) for Windows versions 3.1 and 3.0

SUMMARY

LZFILE is a file in the Microsoft Software Library that demonstrates using the functions provided by the LZEXPAND dynamic-link library (DLL). LZEXPAND.DLL contains functions to decompress files compressed with the COMPRESS.EXE application, which is an MS-DOS application that implements the Lempel-Ziv data compression algorithm.

The LZFILE application demonstrates the following functions: CopyLZFile, GetExpandedName, LZClose, LZCopy, LZDone, LZOpenFile, LZRead, LZSeek, and LZStart. Each of the LZEXPAND functions work with both compressed and uncompressed files under Microsoft Windows versions 3.0 and 3.1.

Download LZFILE.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services:

  • Microsoft Download Service (MSDL)

          Dial (206) 936-6735 to connect to MSDL
          Download LZFILE.EXE (size: 23812 bytes) 
    
  • Internet (anonymous FTP)

          ftp ftp.microsoft.com
          Change to the \SOFTLIB\MSLFILES directory
          Get LZFILE.EXE (size: 23812 bytes) 
    

MORE INFORMATION

LZFILE has three menu options to access files: Open, Copy 1, and Copy Multiple. LZFILE uses the Open and Save As dialog boxes from the common dialog box library to retrieve the filenames. If the user chooses Open from the File menu, LZFILE calls LZOpenFile to open the file and reads the contents with LZRead. If the file is compressed, LZRead decompresses the file. LZFILE displays the file's contents in a read-only edit control that fills the application's client area. The LZClose function closes the file.

If the user selects Copy 1 from the File menu, LZFILE calls LZOpenFile to open the source and destination files, calls LZCopy to copy the source file into the destination file (which decompresses the source if necessary), and calls LZClose to close both files.

If the user selects Copy Multiple from the File menu, LZFILE calls LZStart to allocate memory for multiple file copies, LZOpenFile to open the source and destination files, CopyLZFile to copy the files (and decompress them if necessary), LZClose to close the files, and LZDone to free the memory allocated by LZStart.


Additional reference words: 3.00 3.10 softlib LZFILE.EXE
KBCategory: kbprg kbfile
KBSubcategory: UsrExt


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 15, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.