home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / sdk / com / inole2 / build.txt < prev    next >
Text File  |  1995-05-03  |  7KB  |  222 lines

  1. ===========================================================
  2.            INSIDE OLE BY KRAIG BROCKSCHMIDT
  3.                     COMPANION DISC
  4.        COPYRIGHT (C) 1995 BY KRAIG BROCKSCHMIDT
  5. ===========================================================
  6.  
  7. The MAKEALL.BAT file in the installation directory will
  8. build all of the programs in the sample tree, copying
  9. the necessary header files to the INC directory, the necessay
  10. import libraries to the LIB directory, and the build binaries
  11. (DLLs, EXE, type libraries) to the BUILD directory.
  12.  
  13. The root MAKEALL.BAT file simply spawns the MAKEALL.BAT files
  14. found in each directory.  The latter build file will then
  15. run NMAKE in each subdirectory for that chapter and will copy
  16. the resulting files as necessary.  The MAKEALL.BAT files
  17. redirect all compiler output to a file called ERR.  Each sample
  18. directory will have its own ERR file, and after the build
  19. process is complete, BUILD\ERR will contain all the error
  20. output from all the samples.
  21.  
  22. The MAKEFILE for each sample program sets a number of options,
  23. defines dependencies, and pulls in the files INOLE-A.MAK
  24. and INOLE-B.MAK.  These two files are found in the root
  25. directory of the sample code installation.
  26.  
  27. INOLE-A.MAK is the one central location that defines symbols,
  28. compiler and linker flags, and any other common build variables.
  29. INOLE-B.MAK, on the other hand, defines the link scripts.
  30.  
  31. If you type "nmake CLEAN" in any sample directory, the makefile
  32. will remove all built files from that directory.  To clean an
  33. entire directory, you can set the CLEAN environment variable
  34. by typing
  35.  
  36.     set CLEAN=1
  37.  
  38. at the command prompt, then running a MAKEALL.BAT file.  If you
  39. do this in the installation directory of the samples, the makefile
  40. system will remove all built files, freeing a tremendous amount
  41. of disk space.
  42.  
  43. To reinstate the normal build process, type
  44.  
  45.     set CLEAN=
  46.  
  47. at the command prompt.
  48.  
  49.  
  50. NOTE: The make files on this disc are intended to be run from the
  51. command line with Visual C++.  If you are using another compiler
  52. then you will need to change the compiler and linker options
  53. in INOLE-A.MAK and INOLE-B.MAK, and double-check the MAKEFILE
  54. in each sample directory.
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                     BUILD OPTIONS
  64.  
  65. With this build structure you are able to build the samples
  66. with or without debug, targeted for Win6 or Win32, and targeted
  67. for Unicode or ANSI character sets when compiling for Win32.
  68. In additions, some of the samples can compile to both
  69. Multiple-Document Interface (MDI) and Single-Document Interface
  70. (SDI) versions.
  71.  
  72. The default settings will compile Win32 MDI ANSI-character samples
  73. with debug information.  A full build with these options will
  74. consume approximately 165MB of disk space; a no-debug build
  75. will consume about 112MB.  In both cases at least 5MB of extra
  76. space is necessary for temporary files.  Depending on your
  77. machine, a build can take up to several hours.
  78.  
  79.  
  80.  
  81. To create builds without debug information, set the NODEBUG
  82. environment variable by typing
  83.  
  84.     SET NODEBUG=1
  85.  
  86. at the command prompt. To go back to a debug build, type
  87.  
  88.     SET NODEBUG=
  89.  
  90. to remove the NODEBUG variable from the environment.
  91.  
  92.  
  93. To create builds that use SDI instead of MDI, set the SDI
  94. environment variable by typing
  95.  
  96.     SET SDI=1
  97.  
  98. at the command prompt. To go back to MDI programs, type
  99.  
  100.     SET SDI=
  101.  
  102. to remove the SDI variable from the environment.  Note that
  103. you must rebuild the code in the CLASSLIB directory after
  104. changing this variable and before building any of the COSMO
  105. or PATRON samples in any other chapter.  The CLASSLIB\MAKEALL.BAT
  106. file will build a clean version of the CLASSLIB code and copy
  107. the necessary files into other directories.
  108.  
  109.  
  110. To create builds for Windows NT that use the Unicode character
  111. set, set the UNICODE environment variable by typing
  112.  
  113.     SET UNICODE=1
  114.  
  115. at the command prompt. To go back to ANSI programs, type
  116.  
  117.     SET UNICODE=
  118.  
  119. to remove the UNICODE variable from the environment.  Note that
  120. you must rebuild the code in both the CLASSLIB and INOLE
  121. directories after changing this variable, as many other samples
  122. depend on these core libraries.  So after changing the UNICODE
  123. variable be sure to run MAKEALL.BAT in both INOLE and CLASSLIB
  124. directories before attempting to build any other sample again.
  125.  
  126.  
  127. Finally, if you are running on a 16-bit operating system such
  128. as Windows 3.1x, set the WIN16 environment variable by typing
  129.  
  130.     set WIN16=1
  131.  
  132. at the comment prompt.  Because you'll normally not change this
  133. variable, it is helpful to include the line in you AUTOEXEC.BAT.
  134.  
  135.  
  136. For more detailed information about the effects of each of
  137. these variables, see INOLE-A.MAK.
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.     HANDLING THE 32-BIT OLE UI LIBRARY
  146.  
  147. Depending on the versions of Visual C++ and whether or not
  148. you have a Win32 SDK installed in your system, you may encounter
  149. compilation errors concerning the files OLEDLG.H and OLEDLG.LIB.
  150.  
  151. These files are the header and import library for the OLE UI
  152. Library.  Prior to Windows 95 and Windows NT 3.51, which include
  153. this library as part of the system itself, the OLE UI Library was
  154. provided by Visual C++ itself.
  155.  
  156. If you have the Win32 SDK for Windows 95 and Windows NT 3.51, then
  157. you should already have the necessary files on your machine.
  158.  
  159. If you only have Visual C++ 2.0 or 2.1 and do not have the full
  160. Win32 SDK, then you will not have these files.  In that case you
  161. need to modify INOLE-A.MAK and INC\INOLE.H to reference the
  162. Visual C++ versions of these files.
  163.  
  164. Inside INOLE-A.MAK you'll find this block of statements:
  165.  
  166.  
  167.     !ifdef UNICODE
  168.     DEFUNICODE = -DUNICODE -D_UNICODE
  169.     TLBDEFU    = -DUNICODE
  170.     UILIB32    = oledlg.lib
  171.     #UILIB32    = mfcuiw32.lib
  172.     !else
  173.     DEFUNICODE = -DWIN32ANSI
  174.     TLBDEFU    =
  175.     UILIB32    = oledlg.lib
  176.     #UILIB32    = mfcuia32.lib
  177.     !endif
  178.  
  179.  
  180. Add a "#" comment to the lines containing oledlg.lib and
  181. remove the "#" comment from the lines containing mfcuiw32.lib
  182. and mfcuia32.lib.
  183.  
  184.  
  185. Inside INC\INOLE.H you'll find this block of code:
  186.  
  187.     #ifdef INC_OLEUI
  188.     #ifdef WIN32
  189.     #include <oledlg.h>
  190.     //#include <ole2ui.h>
  191.     #else
  192.     #include <ole2ui.h>
  193.     #endif
  194.     #endif
  195.  
  196.  
  197. Comment out the #include <oledlg.h> and remove the comment
  198. from #include <ole2ui.h>.
  199.  
  200. Note that these changes are not encouraged as Windows NT 3.51 is
  201. a required upgrade for development purposes, and the Win32 SDK
  202. is necessary to compile this book's samples in their fully
  203. tested forms.
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.         THE MIDL COMPILER FROM THE WIN32 SDK
  212.  
  213. Besides the official system version of the OLE UI Library, the
  214. Win32 SDK for Windows 95 and Windows NT 3.51 is the only source
  215. at the time of writing for the Microsoft IDL compiler, known
  216. as MIDL.  This compiler, as well as various header files and
  217. import libraries from the Win32 RPC SDK, are only included
  218. with the full Win32 SDK itself.  Without the SDK you will not
  219. be able to compile and run several samples from Chapter 6
  220. and those from Chapter 9.  These samples require MIDL to generate
  221. custom OLE interfaces upon which these few samples depend.
  222.