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