             
             MAKEAPP APPLICATION PROJECT GENERATOR
             =====================================

The MAKEAPP project generator is both a utility that will generate a 
template Microsoft(R) Windows(TM) application for you, and a sample 
application that illustrates the use of STRICT and WINDOWSX.H.

The MAKEWC utility generates a new window class source file that can
be integrated into an application generated with MAKEAPP.

Using MAKEAPP to generate Windows application projects
------------------------------------------------------

The MAKEAPP utility generates a template application project. It copies
the template application and renames the various files, functions, and 
constants throughout the make file and source files to names of your
choice.

To generate an application, CD to the directory that contains MAKEAPP
and type:

    makeapp destdir modulename ClassName

where:


    destdir     is the project directory you want files copied to,

    modulename  is the name of the application executable (excluding .EXE)

    ClassName   is the name you want to use in the source for the window
                class and other identifiers.

For example:

    makeapp c:\myapp myapp MyApplication

will copy the sources to build MYAPP.EXE into the directory C:\MYAPP.  
The application will create two window classes: MyApplication_Frame and
MyApplication_Client, which you can modify to add your own code.


Using MAKEWC to generate a window class source
----------------------------------------------

The MAKEWC utility generates source code for a template window class.  
Like MAKEAPP, it renames various aspects of the source code based on 
parameters you specify.

To generate a new window class, CD to the directory that contains
MAKEAPP and type:

    makewc destdir filename ClassName TYPENAME ptrtype AppPrefix_ appname

where:

    destdir     is the project directory you want files copied to

    filename    is the name of the window class source and include file
                (excluding the .C or .H)

    ClassName   is the class name used for function name prefixes
                (e.g., ClassName_OnCommand)

    TYPENAME    is the name of the instance data structure type
                (i.e., sizeof(TYPENAME));

    ptrtype     is the name to use for pointers to instance data
                (i.e., TYPENAME* ptrtype; )

    AppPrefix_  is the class name prefix to use for the registered
                classname.  The underscore must be included.
                (e.g., CreateWindow(..., "AppPrefix_ClassName", ...); )

    appname     is the name of the main application header file
                (e.g., #include "appname.h")

For example:

    makewc c:\myapp mywnd MyWnd MYWND pmwnd MyApp_ myapp

will create the files MYWND.C and MYWND.H in C:\MYAPP, that implement the
window class named MyApp_MyWnd.

To use this new window class source, you will need to update your makefile to
ensure the file is compiled and linked.  You will also need to update your
project's include file to ensure that the window class header file is included.


How they work
-------------

MAKEAPP and MAKEWC are fairly simple batch files that copy the template
files from the MAKEAPP directory to the directory you specify.  Some file
names, constants, and function names in the copied source file are renamed
according to the parameters you provide.

The program REP.EXE is used to perform the global search-and-replace
operations required, and is called by MAKEAPP2.BAT.


Template application architecture
---------------------------------

The template application is fully STRICT, and provides examples of the
features of WINDOWSX.H: macro APIs, control APIs, and message crackers.

The application is designed for easy modification. Its architecture is 
typical of a medium-sized Windows application: a top-level "frame" window 
manages the menus and contains a "client" child window that is sized to fit
inside the client area.  A sample dialog box is also shown.

You can use the Windows version 3.1 SDK Dialog Editor to edit the dialog 
box template resources.

The application is divided into four main modules:

        app

    Contains the Windows application entry point (WinMain), handles
    application initialization and termination, and implements the
    application main loop and idle function.

        frame

    Implements the main window of the application.  The "frame" window
    defines the menu and deals with other main-window responsibilities such
    as activation and application termination (with cooperation from the 
    client window).  It arranges its child "client" window to occupy its client
    area. The frame window handles a few commands, but those it does not
    process are passed on to the client window.

        client

    The client window is responsible for the "client area" of the main
    application window.  It handles window painting, commands passed to it
    from the frame, focus, mouse input, and keyboard input, and the like.
    Handles the Sample/Dialog command, which brings up the sample dialog box.

        dlg

    Implements a sample dialog box, using message crackers and the control
    APIs.

    MAKEAPP.H simply #includes all the include files required by this
    application.

    DLGDEFS.H includes all of the definitions used in dialog boxes.  These
    are split into a separate .H file so it can be conveniently used with
    the 3.1 SDK Dialog Editor.

    MAKEAPP.DLG includes all of the dialog templates.  These are created
    and edited using the 3.1 SDK Dialog Editor.


Making changes to MAKEAPP template application
----------------------------------------------

You can make changes to the template application to suit your preferences:
change the indentation style, modify the makefile to use a different compiler
or different compiler switches, add or remove features, or whatever.  Then,
each time you run the MAKEAPP batch file, the new application project will
reflect your changes.

As template files are copied, certain keywords in the source files are
replaced with parameters specified on the command line.  So if you're writing
code that you want renamed in some way, you must use these keywords.

    makeapp     - Changed to the modulename parameter.
    MakeApp     - Changed to the ClassName parameter

You'll need to modify MAKEAPP.BAT if you add (or remove) source files to the
project.

You can build the template application in the makeapp directory by typing
"nmake", assuming you have installed the SDK and the Microsoft C version
6.0 compiler.  This will produce the Windows application executable 
MAKEAPP.EXE.  If this file exists and you try to run MAKEAPP.BAT, you'll 
get the "this application requires Windows" message: to run the batch file 
you must delete MAKEAPP.EXE.


Making changes to MAKEWC template window class
----------------------------------------------

The template window class is contained in the files MAKEWC.C and MAKEWC.H. 
To compile and test the template window class, you can create a project
using MAKEAPP that includes the MakeWc window class.

Replaced keywords are:

    MakeWc      - Class name
    MAKEWC      - Class instance data type name
    pmwc        - Class instance data pointer variable name
    MakeApp_    - Application name classname prefix
    makeapp     - Application file name
