1<html><head>
2	<title>Metakit sample code - Dump</title>
3</head><body bgcolor=white>
4
5<font face=Helvetica size=3>
6
7<!--begin-->
8<h2><img src="e4app.gif" alt="App Icon" border=0 align=left>
9Metakit sample code - Dump</h2><br clear=left>
10
11<p>This application is a generic utility for the Metakit library. </p>
12
13<p><b>What it does</b>: Dump is a utility program which displays the contents
14of a Metakit datafile on standard output. The output shows all the information
15which is stored in the datafile, which can be quite useful while developing
16and debugging applications based on Metakit. </p>
17
18<p><b>What it illustrates</b>: Dump is a so-called &quot;32-bit console
19application&quot;, this is the modern version of the classical MS-DOS command-line
20executables. It shows how you can extract structural information from a
21Metakit datafile without knowing anything about it. The basic trick is
22to simply open the file, and then to step through each of the properties
23(using the members NumProperties and NthProperty). The executable file
24is tiny, because both Metakit and MFC have been linked as DLLs. </p>
25
26<p><b>How to use it</b>: To dump a datafile, you can start DUMP.EXE from
27the MS-DOS prompt with the filename as argument (or drop a file on it in
28the Explorer). Since datafiles can store arbitrarily nested data structures,
29you may need to examine the output to understand how the information is
30presented on standard output. Dump adds quite a bit of detail to guide
31you (including all the property names). Basically, the data structure is
32traversed recursively, with indentation added to reflect the current nesting
33level. There are a number of command-line options to modify the default
34output style: </p>
35
36<ul>
37<dl>
38	<dt><b>-s</b> </dt> <dd>List all tables and subtable, but omit the actual data values. </dd>
39	<dt><b>-d</b> </dt> <dd>List all tables and subtables, including a low-level data dump. </dd>
40	<dt><b>-f </b></dt> <dd>Only list all the fields (properties) and their structure. </dd>
41	<dt><b>-w</b> </dt> <dd>Wait for the RETURN key just before exiting. </dd>
42</dl>
43</ul>
44
45<p>You can redirect the output to file, just like any other console application.
46</p>
47
48<p><b>Known problems</b>: None. Note that this is a 32-bit application
49which requires Windows 95 (or perhaps Windows NT or Win32s), and that the
50Metakit DLLs are used. </p>
51
52<p><b>Files in EXAMPLES\DUMP</b>: </p>
53
54<p>DUMP.CPP - Dump main program 
55<br>DUMP.MAK, DUMP.MDP - MSVC 4.2 project makefiles for Win32 </p>
56<!--end-->
57
58<center><p><hr size=1>
59||
60&nbsp; <a href="index.html" target="_top">Roadmap</a>
61&nbsp; <a href="classes.html">Class Index</a>
62&nbsp; <a href="samples.html">Sample Index</a>
63&nbsp; ||
64&nbsp; <a href="intro.html">Introduction</a>
65&nbsp; <a href="tips.html">Tips and Tricks</a>
66&nbsp; || 
67
68</center>
69</font>
70
71</body></html>
72