|
|
1.1 root 1: =======================================================================
2: MICROSOFT FOUNDATION CLASSES - SOURCE CODE
3: =======================================================================
4:
5: This directory contains the source code to the MFC library.
6:
7: These files have been included for reference purposes, in
8: conjunction with the Class Library reference manual and tutorial.
9:
10: These files are compiled to form the Microsoft Foundation Class library.
11: The library may be built in a number of configurations, depending upon
12: operating system, memory usage or model, and whether or not debugging
13: and diagnostic aids are to be included in applications which link with
14: the library.
15:
16: ================================
17: 1. WINDOWS/NT BUILD NOTES
18: ================================
19: Please read this section carefully before reading the rest of this
20: file. This section describes important differences between the
21: Microsoft C/C++ 7.0 MFC 1.0 release and the Windows/NT BETA release.
22:
23: There are four MFC library variants under Windows/NT; these variants
24: are built using one of the following nmake invocations:
25:
26: nmake MODEL=N TARGET=W DEBUG=1 -- debug, GUI subsystem
27: nmake MODEL=N TARGET=R DEBUG=1 -- debug, console subsystem
28: nmake MODEL=N TARGET=W DEBUG=0 -- retail, GUI subsystem
29: nmake MODEL=N TARGET=R DEBUG=0 -- retail, console subsystem
30:
31:
32: Model should always be set to N for NT versions of MFC.
33:
34: ================================
35: 2. BUILDING A LIBRARY VARIANT
36: ================================
37:
38: To build a library in a particular configuration, use the NMAKE tool
39: and the Makefile which is in this directory. The following arguments
40: can be given to NMAKE to successfully build a specific library variant.
41:
42: NMAKE {MODEL=[S|M|C|L|N]} {TARGET=[W|R]} {DEBUG=[0|1]} {DLL=[0|1]} \
43: {CODEVIEW=[0|1|2]} {OBJ=path} {OPT=<CL command line switches>}
44:
45: MODEL=[S|M|C|L|N]
46: The "MODEL" argument specifies the ambient memory model, which can be
47: one of S, M, C, or L (for Small, Medium, Compact or Large, NT
1.1.1.3 ! root 48: respectively). N is for 32 bit Windows NT hosting and targeting.
1.1 root 49:
50: TARGET=[W|R]
51: The "TARGET" argument specifies the operating-system on which your
52: compiled programs will run. This may be one of W or R (for
53: Windows or Real-mode DOS, respectively). R may be used with TARGET=N
54: for character mode applications on Windows NT.
55:
56: DLL=[0|1]
57: The "DLL" argument specifies whether or not to compile the library
58: so that it may subsequently be used for developing a dynamic link
59: library (DLL). The default is DLL=0 (do not include DLL support).
60: If DLL=1, MODEL must be L (large).
61:
62: NOTE: The MFC library is not itself a DLL; it is always a statically
63: linked library. This option does not build MFC into a DLL; it builds
64: a static library that can be used to build your DLLs; it is similar
65: in spirit to the C runtime LDLLCEW.LIB library.
66:
67:
68: DEBUG=[0|1]
69: The "DEBUG" argument specifies whether or not to include diagnostic
70: support code for the library. This may be 0 (for no diagnostics)
71: or 1 (for full diagnostics).
72:
73: CODEVIEW=[0|1|2]
74: The "CODEVIEW" argument specifies whether to compile the library with
75: CodeView information or not. You need to compile the library with
76: CodeView information if you want to trace into MFC code using CodeView.
77: You should also compile your application files with the /Zi option,
78: and link your executable with the /CODEVIEW option.
79:
80: Setting CODEVIEW does not affect the DEBUG argument, although the
81: value of the DEBUG argument does affect the default value of CODEVIEW
82: (discussed below). A value of 0 indicates that no CodeView
83: information is to be compiled into the library. A value of 1 says
84: to compile in full CodeView information for all modules of the library.
85: A value of 2 compiles CodeView information only into a select set of
86: the most commonly referenced modules (WinMain, diagnostic memory
87: allocator, message map, main message loop, and the application class.)
88:
89: The default value depends on the setting of the DEBUG argument.
90: If DEBUG=1, CODEVIEW defaults to 2. If DEBUG=0, CODEVIEW also defaults
91: to 0.
92:
93: OBJ=[path]
94: We recommend storing .OBJ files in a separate directory so that you
95: may compile different versions of the MFC library concurrently.
96: The "OBJ" argument allows you to specify where these files are stored
97: during the build process. The directory specified is created and
98: removed automatically as required. This defaults to a combination
99: of the target, model, and debug status, preceded by a '$' (i.e. $MWD).
100:
101: OPT=[switches]
102: If your library needs to be built with custom compiler switches, then
103: these may be included in the "OPT" argument. Note that switches need
104: to be separated by spaces, so when including more than one extra
105: compiler switch, enclose the whole OPT= argument in double-quotes.
106: This is an advanced feature; read the Makefile and the details on each
107: of the switches concerned in the Microsoft C/C++ 7.0 Compiler User Manual
108: before using this option.
109:
110: Defaults
111: The default is:
112: nmake MODEL=M TARGET=W DEBUG=1 CODEVIEW=2 OBJ=$MWD
113:
114: Note. If you wish to use only the non-Windows classes then build
115: an 'R' (real-mode) library variant. There are three MFC sample applications
116: that do not require Microsoft Windows, and use the real-mode libraries.
117: See the file MFC\SAMPLES\README.TXT for details about each sample and
118: which variant of the library each requires.
119:
120:
121: ===============================
122: 3. AFTER BUILDING THE LIBRARY
123: ===============================
124:
125: Once the library has been built successfully, you may want to delete
126: object files with:
127:
128: NMAKE CLEAN OBJ=[path]
129:
130: Note that if you used the "OBJ" argument while building the library,
131: specify the same subdirectory in the cleanup command.
132:
133: This will remove all of the temporary .OBJ files created by building the
134: library, and remove the directory where they were stored.
135:
136: Always perform a cleanup before building a new variant of the library,
137: or use different object paths for each variant. Note that the OBJ files
138: are only necessary during the building process.
139:
140:
141: ======================================
142: 4. SOURCE CODE FORMATTING CONVENTION
143: ======================================
144:
145: All MFC source code has been formatted such that leading whitespace
146: on a line is made up of physical tabs, while embedded whitespace is
147: physical spaces. MFC source code assumes that your editor is set to
148: display a physical tab as four blanks.
149:
150: For example:
151:
152: int FormatExample()
153: {
154: /*
155: Statements below should start in column 5 if tabs are set correctly
156: Comment should start in column 20
157: 12345678901234567890
158: */
159: int i;
160: i = 5; // whitespace between statement and comment is spaces
161:
162: return i;
163:
164: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.