## Metakit sample code - DisCat

This application is a good starting point to learn about Metakit.

What it does: DisCat is a very simple disk catalog application. It recursively scans a directory tree on your hard disk and creates a data file with information about all files and subdirectories it finds during that scan. The total number of directories scanned is reported on the screen.

What it illustrates: This sample program shows how to set up a simple MFC-based application which uses Metakit. The source code of this application can be compiled for 32-bit Windows as well as for 16-bit Windows targets. DisCat has no practical use, other than to generate a not-quite-trivial datafile using the Metakit library.

How to use it: When you launch DISCAT.EXE (or the 16-bit version, which is called DISCAT16.EXE), you will see a dialog box with an edit box where you can enter a path name. After pressing the "Scan" button, the selected directory and all of its subdirectories will be traversed. Then you are asked to choose a name for the datafile which is to be used for storing the results. Apart from seeing confirmation in the form of a directory count, this application is rather boring...

Known problems: None, but you need to make sure that your system meets the requirements of either DISCAT.EXE or DISCAT16.EXE.

The DISCAT.EXE application is a 32-bit application which requires Windows 95 (or Windows NT, or Win32s, but neither of those two has been tried). In addition, you need to have two of the DLLs which come with Microsoft Visual C++ version 4.2: MFC42.DLL and MSVCRT.DLL (these contain the MFC library, and the runtime library, respectively).

Alternately, you can use DISCAT16.EXE, which runs on either Windows 95 or Windows 3.1(1). This application requires the file MFC250.DLL in the system directory (usually C:\WINDOWS\SYSTEM) to start properly.

These DLL requirements are caused by the fact that the sample programs and the Metakit libraries are distributed in the smallest possible format, which happens to be as MFC extension DLLs. As a result, you need to supply the MFC libraries yourself. Considering the fact that Metakit is currently only useful in combination with MFC, this should not be a problem.

Files in EXAMPLES\DISCAT:

CATALOG.H, CATALOG.CPP - Creates a disk catalog object using Metakit
DISCAT.H, DISCAT.CPP - Main MFC application code
DISCAT.MAK, DISCAT.MDP - MSVC 4.2 project makefiles for Win32
DISCAT.DEF, DISCAT.RC - Linker definitions, Application resources
DISCAT16.MAK - MSVC 1.52 project makefile for Win16
RESOURCE.H - Resource symbol definitions
STDAFX.H, STDAFX.CPP - Used for precompiled headers
RES\*.* - Application resources

|| Roadmap Class Index Sample Index || Introduction Tips and Tricks ||