
=======================================================================
			MICROSOFT FOUNDATION CLASSES 2.5 - SOURCE CODE
=======================================================================

This directory contains the source code to the MFC library.

These files have been included for reference purposes, in
conjunction with the Class Library reference manual and tutorial.

These files are compiled to form the Microsoft Foundation Classes 2.5
(MFC 2.5).  The library may be built in a number of configurations,
depending upon operating system, memory usage or model, and whether
or not debugging and diagnostic aids are to be included in
applications which link with the library.


===========================================
 1.  BUILDING A STATIC LINK LIBRARY VARIANT
===========================================

The makefile provided can be used to build the static link library
variants of MFC 2.5.  See section 2 for instructions on building
the shared DLL variant.  The makefile can be used from either the
MS-DOS command line (in a Windows 3.1 DOS "box") or as an External
Project file in the Visual WorkBench.

To build a library in a particular configuration, use the NMAKE tool
and the Makefile which is in this directory.  The following arguments
can be given to NMAKE to successfully build a specific library variant.

  NMAKE {MODEL=[S|M|C|L]} {TARGET=[W|R]} {DEBUG=[0|1]} {DLL=[0|1]} \
		{CODEVIEW=[0|1|2]} {OBJ=path} \
		{OPT=<CL command line switches>}

To set these options from the Visual WorkBench use the Project Options
menu command and set them in the Debug/Retail sections.  For example to
build large model with browser information in the debug build use the
following settings:

		Debug Build:  NMAKE DEBUG=1 TARGET=W MODEL=L OPT="/FR" CODEVIEW=1
		Release Build: NMAKE DEBUG=0 TARGET=W MODEL=L

Note: On some systems there may not be enough real mode DOS memory to
complete the build of the static link library.  Due to the overhead
of the Visual WorkBench, an additional 40K of DOS real mode memory
is required in order to build as an External Project.  If you experience
an "out of memory" message in the LIB phase of the build, then you
should first try building from a DOS box.  If that does not succeed
then you will need to remove any real mode memory clients from
your CONFIG.SYS.  Approximately 500K DOS memory is required.
The MEM command can tell you the amount to memory available for a
running application.


MODEL=[S|M|C|L]
  The "MODEL" argument specifies the ambient memory model, which can be
  one of S, M, C, or L (for Small, Medium, Compact or Large, respectively).

TARGET=[W|R]
  The "TARGET" argument specifies the operating-system on which your
  compiled programs will run.  This may be one of W or R (for
  Windows or Real-mode DOS, respectively).  R should be used only
  for MS-DOS only targets (i.e. command line tools).

DLL=[0|1]
  The "DLL" argument specifies whether or not to compile the library
  so that it may subsequently be used for developing a dynamic link
  library (DLL).  The default is DLL=0 (do not include DLL support).
  If DLL=1, MODEL must be L (large).

  Note: Use the MFCDLL.MAK file for building the shared DLL (_AFXDLL).
  The DLL=1 variant is for building your own DLL that contains MFC
  classes and exports a C interface.  This is described in technical note
  TN011 and is known as _USRDLL.

DEBUG=[0|1]
  The "DEBUG" argument specifies whether or not to include diagnostic
  support code for the library.  This may be 0 (for no diagnostics)
  or 1 (for full diagnostics).

  Note: The Small and Compact models do not support
  DEBUG=1, they are for retail build variants only.

CODEVIEW=[0|1|2]
  The "CODEVIEW" argument specifies whether to compile the library with
  CodeView information or not.  You need to compile the library with
  CodeView information if you want to trace into MFC code using CodeView.
  You should also compile your application files with the /Zi option,
  and link your executable with the /CODEVIEW option.

  Setting CODEVIEW does not affect the DEBUG argument, although the
  value of the DEBUG argument does affect the default value of CODEVIEW
  (discussed below).  A value of 0 indicates that no CodeView
  information is to be compiled into the library.  A value of 1 says
  to compile in full CodeView information for all modules of the library.
  A value of 2 compiles CodeView information only into a select set of
  the most commonly referenced modules (WinMain, diagnostic memory
  allocator, message map, main message loop, and the application class.)

  The default value is CODEVIEW=1, for maximum CodeView information.

OBJ=[path]
  We recommend storing .OBJ files in a separate directory so that you
  may compile different versions of the MFC library concurrently.
  The "OBJ" argument allows you to specify where these files are stored
  during the build process.  The directory specified is created and
  removed automatically as required.  This defaults to a combination
  of the target, model, and debug status, preceded by a '$' (i.e. $MWD).

OPT=[switches]
  If your library needs to be built with custom compiler switches, then
  these may be included in the "OPT" argument.  Note that switches need
  to be separated by spaces, so when including more than one extra
  compiler switch, enclose the whole OPT= argument in double-quotes.
  This is an advanced feature; read the Makefile and the details on each
  of the switches concerned in the Microsoft C/C++ Compiler User Manual
  before using this option.

Defaults
  The default is:
	  nmake MODEL=M TARGET=W DEBUG=1 CODEVIEW=2 OBJ=$MWD

Note:  If you wish to use only the non-Windows classes then build
an 'R' (real-mode) library variant. There are three MFC sample applications
that do not require Microsoft Windows, and use the real-mode libraries.
See the WinHelp file MFCSAMP.HLP for details about each sample and
which variant of the library each requires.

Note:  MFC 2.5 requires an additional static link library that is installed
in the SRC directory.  This .LIB file contains some of the VBX control
implementation.  You cannot regenerate this file yourself.  Should you
accidentally delete it, you will need to retrieve the file from the
Microsoft Visual C++ installation diskettes.  Small and Compact memory
models do not support VBX controls.


============================
 2.  BUILDING THE SHARED DLL
============================

Building the shared DLL is very similar to the static link
variants.  You must, however, use the MFCDLL.MAK file which is
also an External Project file.

To build the shared DLL components that contain the implementation
for OLE 2.0 and ODBC use MFCOLE.MAK and MFCDB.MAK respectively.
These additional DLLs are required only if your application utilizes
the database or OLE 2.0 classes.

Technical note TN033 explains in detail how to build the shared
DLL and how to build an application that uses the shared DLL.


===============================
 3. AFTER BUILDING THE LIBRARY
===============================

Once the library has been built successfully, you may want to delete
object files with:

  NMAKE CLEAN OBJ=[path]

Note that if you used the "OBJ" argument while building the library,
specify the same sub directory in the cleanup command.

This will remove all of the temporary .OBJ files created by building the
library, and remove the directory where they were stored.

Always perform a cleanup before building a new variant of the library,
or use different object paths for each variant.  Note that the OBJ files
are only necessary during the building process.


======================================
 4. SOURCE CODE FORMATTING CONVENTION
======================================

All MFC source code has been formatted such that leading whitespace
on a line is made up of physical tabs, while embedded whitespace is
physical spaces.  MFC source code assumes that your editor is set to
display a physical tab as four blanks.

For example:

int FormatExample()
{
/*
Statements below should start in column 5 if tabs are set correctly
Comment should start in column 20
12345678901234567890
*/
	int i;
	i = 5;         // whitespace between statement and comment is spaces

	return i;

}
