App Icon MetaKit sample code - MyIO


This example demonstrates how to setup low-level datafile encryption with MetaKit.

What it does: MyIO creates a simple view on disk, and then loads it back in. The data on disk is stored in a simple encrypted format.

What it illustrates: This sample program shows how to customize MetaKit via its "Strategy" object.

Just to show it can be done, MyIO also disables all flush calls issued by MetaKit. This slightly reduces the fail-safe properties but improves performance with frequent commits on systems which implement caching using "lazy writes" (such as Windows).

The source code of this application can be compiled for 32-bit Windows (as console application) as well as for 16-bit DOS targets. MyIO has no practical use, but it contains a "CEncryptStrategy" class which you can adapt to suit your purposes.

How to use it: When you launch MYIO.EXE, it creates a datafile called "secret.dat", saves some string data to it, then reads that back and displays these strings.

Note that due to the encrypted storage format you can NOT use the MetaKit dump utility to examine the contents of the data file. You can of course build your own version of it, since all the necessary source code is included.

Known problems: None.

Files in EXAMPLES\MYIO:

MYIO.CPP - MyIO main program
MYIO.MAK, MYIO.MDP - MSVC 4.2 project makefiles for Win32
MYIO16.MAK - MSVC 1.52 project makefile


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