SAMPLE: Use ZAP.EXE to Find Duplicate DLLs and VBXs in VB 3.0

Last reviewed: September 17, 1997
Article ID: Q120074
2.00 3.00 WINDOWS kbenv kbprg kbfile kbhowto

The information in this article applies to:

- Standard and Professional Editions of Microsoft Visual Basic for

  Windows, versions 2.0 and 3.0

SUMMARY

It is not uncommon for Windows programs to ship with libraries of routines known as dynamic link libraries (DLLs). As more and more applications ship these types of files, duplicates of files tend to accumulate.

The ZAP.EXE sample program is useful for finding duplicated DLLs and VBXs in a system, which could potentially cause problems. It can search the same places searched by Windows when a VBX or DLL is loaded. The sample code demonstrates several API functions, both in the interface and in the primary algorithms.

MORE INFORMATION

Visual Basic support engineers regularly encounter problems caused by users with more than one copy of a particular DLL or VBX. The ZAP.EXE utility makes what used to be a tedious and time-consuming problem a great deal easier and quicker to solve. The main features of ZAP.EXE are as follows:

  • It can search any combination of the MS-DOS search path, the Windows search path (that is, \WINDOWS and \WINDOWS\SYSTEM), and a recursive search path through the hard disk starting at any directory.
  • It can find DLLs, VBXs, and/or any other file specification.
  • The size, date and time of creation, and (where possible) version number of each file is returned, making analysis simple.
  • You can delete files from within the ZAP.EXE utility by selecting the file in the list box display and pressing the DELETE key or by dragging and dropping the file from the list box into the trash can icon.
  • You can copy or move files by dragging and dropping the file into the diskette icon and then selecting a destination for the file.

The included source code is fully commented. The special features of the code are as follows:
  • Tabbed list box and tabbed text box that use a font other than the system font
  • List box with bound horizontal scroll bar
  • Data structure designed to make sorting of data much quicker
  • Drag-and-drop feature
  • Feature that checks to see whether a DLL or VBX is in use before deleting it.
  • Increased-speed method of getting a directory listing
  • Use of the Windows API to get file version numbers

The following file is available for download from the Microsoft Software Library:

 ~ Zap10.exe (size: 44668 bytes) 

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from
               Online Services

After downloading Zap10.exe, run it to extract the files it contains. They are as follows:

Filename Extension Description -------- --------- ---------------------------------------------

ZAP       EXE        The application itself
ZAP       MAK        The project file
MAIN      FRM        The main form
MAIN      FRX        Binary file associated with MAIN.FRM
ABOUT     FRM        The about box
WAIT      FRM        Form displayed during processing
COPYDEST  FRM        Form for selecting copy/move destination
ADT       BAS        Code module containing the main data structure
                     and the procedure to manipulate it
GLOBAL    BAS        Code module containing global variables, API
                     declarations, and type definitions.
USE       TXT        Instruction on how to use this tool
KB        TXT        This document


KBCategory: kbenv kbprg kbfile kbhowto
KBSubCategory: EnvtRun kbsample
Additional reference words: 2.00 3.00 drag-and-drop softlib
Keywords : kbenv kbfile kbhowto kbprg
Version : 2.00 3.00
Platform : WINDOWS


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: September 17, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.