home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / appwiz / logowiz / readme.txt < prev    next >
Text File  |  1998-03-05  |  11KB  |  256 lines

  1. ========================================================================
  2.                     CUSTOM APPWIZARD: LOGOWIZ
  3. ========================================================================
  4.  
  5.  
  6. This AppWizard is an example of how to write a custom AppWizard that is
  7. a variant on the standard MFC AppWizard.  The techniques that this
  8. custom AppWizard is designed to demonstrate are:
  9.  
  10.     1. removing a page from an otherwise standard AppWizard
  11.     2. modifying defaults on standard AppWizard pages
  12.     3. adding a custom page to an otherwise standard AppWizard
  13.     4. conditional manipulation of project templates
  14.        - adding controls to the main window of a dialog-based application
  15.        - adding files to the new project
  16.        - adding code to otherwise standard templates
  17.  
  18. This file also contains a summary of what you will find in each of the
  19. files that make up your LOGOWIZ DLL.
  20.  
  21. /////////////////////////////////////////////////////////////////////////////
  22. REMOVING STANDARD APPWIZARD PAGES
  23.  
  24. You can remove any AppWizard pages from the standard list that you like.
  25. While it is also possible to rearrange the sequence as well, that is not
  26. recommended. This is done in the constructor for CDialogChooser in
  27. chooser.cpp.
  28.  
  29. In this custom AppWizard, the ODBC page has been removed if this is an
  30. MDI/SDI based app. You can find further details about how this was done in
  31. comments near the code itself (see CDialogChooser::CDialogChooser() in
  32. chooser.cpp).  If you want, you can set the defaults as desired for a page
  33. that you remove.  This will have the effect of making the defaults mandatory
  34. rather than optional.
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. CHANGING DEFAULT SETTINGS
  38.  
  39. You can change default settings for standard AppWizard pages.  This is done
  40. in your main custom AppWizard class (in this case, CLogoWizAppWiz in
  41. logowaw.cpp) InitCustomAppWiz function. The list of settings you can change
  42. are found in the online help.
  43.  
  44. In this custom AppWizard, the application type has been defaulted to dialog-
  45. based and context sensitive help has been turned on.
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. ADDING CUSTOM PAGES
  49.  
  50. You can insert custom pages at any point in the standard AppWizard sequence
  51. that you like.  This is done in the same place that you would remove standard
  52. AppWizard pages from the sequence (CDialogChooser::CDialogChooser()).
  53.  
  54. In this custom AppWizard, the user is given two choices for a dialog-based
  55. application:
  56.  
  57.     1) where to put a company logo on the main window
  58.     2) whether to include a "Press me" button on the main window
  59.  
  60. The first option is very simple to implement and required minimal changes to
  61. the template files.  The second option involves adding several files to
  62. handle a new dialog (popped up by pressing the "Press me" button) and adding
  63. code to the main dialog class to handle pressing the button.
  64.  
  65. The following template files were modified to make that code work:
  66.  
  67. - confirm.inf   provide text in the AppWizard confirmation dialog about both
  68.                 the logo and the "Press me" dialog/button
  69.  
  70. - dialog.cpp,   handle the user clicking on the "Press me" button and pop up
  71.   dialog.h      the "Press me" dialog when needed
  72.  
  73. - dlgall.rc     include the bitmaps for the "Press me" dialog's owner-draw
  74.                 buttons in the resources for the new project
  75.  
  76. - dlgres.h      define the IDs needed for handling all aspects of the
  77.                 "Press me" dialog
  78.  
  79. - dlgloc.rc     localized (English) versions of the dialogs needed for this
  80.                 project.  This includes the main dialog for the new dialog-
  81.                 based application as well as the "Press me" dialog.  The
  82.                 main dialog has been conditionally modified to include both
  83.                 the company logo (as an icon) and the "Press me" button
  84.                 used to bring up the "Press me" dialog.  The main window was
  85.                 also unconditionally made about twice the normal default
  86.                 size.
  87.  
  88. - dlgroot.clw   added ClassWizard information for the "Press me" dialog.
  89.  
  90. - frownu.bmp,   bitmaps needed to handle the owner-draw characteristics of
  91.   frownd.bmp,   the Cancel button on the "Press me" dialog.
  92.   frownf.bmp
  93.  
  94. - newproj.inf   copy the "Press me" bitmaps and files into the new project
  95.  
  96. - pressdlg.cpp, implement the "Press me" dialog behavior
  97.   pressdlg.h
  98.  
  99. - readme.txt    tell the user about the addition of the logo and the
  100.                 "Press me" dialog in the standard 'readme'
  101.  
  102. - root.mak      added the "Press me" dialog classes and bitmaps to the
  103.                 appropriate dependency lists.
  104.  
  105. - smileu.bmp,   bitmaps needed to handle the owner-draw characteristics of
  106.   smiled.bmp,   the OK button in the "Press me" dialog.
  107.   smilef.bmp
  108.  
  109.  
  110. Search for LOGO_ and PRESS_ME_DIALOG in the text files in the template
  111. directory to see where these changes were made.  All but one of these changes
  112. was done conditionally.  The change in size of the dialog-based application's
  113. main window was the only unconditional change made.  In other words, if the user
  114. chose to have no company logo and no "Press me" dialog, there would be no real
  115. difference between a dialog-based application created using this custom
  116. AppWizard and one created using the standard MFC AppWizard (all else being
  117. equal).
  118.  
  119.  
  120. ========================================================================
  121.                             PROJECT FILES
  122. ========================================================================
  123.  
  124. LOGOWIZ.MAK
  125.     This project file is compatible with the Visual C++ development
  126.     environment.  It is also compatible with the NMAKE program provided with
  127.     Visual C++.
  128.  
  129.     To build a debug version of the program from the MS-DOS prompt, type
  130.     nmake /f LOGOWIZ.MAK CFG="Win32 Debug".
  131.  
  132.     To build a release version of the program, type
  133.     nmake /f LOGOWIZ.MAK CFG="Win32 Release".
  134.  
  135. LOGOWIZ.CPP
  136.     This file is the main DLL source file that contains the definition of
  137.     DllMain().  It also exports the function GetCustomAppWizClass(), which
  138.     returns a pointer to the one instance of this custom AppWizard's
  139.     CCustomAppWiz-derived class.
  140.  
  141. LOGOWIZ.H
  142.     This file is the main header file for the DLL.  It includes your
  143.     RESOURCE.H file.
  144.  
  145. LOGOWIZ.RC
  146.     This file is a listing of all of the Microsoft Windows resources that the
  147.     program uses.  It includes all of your custom AppWizard's templates as
  148.     custom resources of type "TEMPLATE".  These resources are pointers to the
  149.     files in your project's TEMPLATE directory.  This file can be directly
  150.     edited in the Visual C++ development environment.  However, you will
  151.     probably want to edit your templates by opening the template files directly
  152.     in the source editor rather than by editing the "TEMPLATE" resources from
  153.     the Visual C++ resource editor.
  154.  
  155. LOGOWIZ.CLW
  156.     This file contains information used by ClassWizard to edit existing
  157.     classes or add new classes.  ClassWizard also uses this file to store
  158.     information needed to create and edit message maps and dialog data
  159.     maps and to create prototype member functions.
  160.  
  161. /////////////////////////////////////////////////////////////////////////////
  162. Custom AppWizard Interface:
  163.  
  164. LOGOWAW.H, LOGOWAW.CPP - the CCustomAppWiz class
  165.     These files contain your CCustomAppWiz-derived class,
  166.     CLogowizAppWiz.  This class contains virtual member functions which
  167.     MFCAPWZ.DLL calls to initialize your custom AppWizard and to query which
  168.     step to pop up at a given time.  This class also contains m_Dictionary,
  169.     a CMapStringToString member variable, which maps template macro names
  170.     to their values.
  171.  
  172. /////////////////////////////////////////////////////////////////////////////
  173. Dialogs:
  174.  
  175. CHOOSER.H, CHOOSER.CPP - the dialog chooser
  176.     These files contain your CDialogChooser class.  The class maintains
  177.     pointers to each of your steps, keeps track of which step is currently
  178.     up, and handles calls to your custom AppWizard class's member functions
  179.     Next(...) and Back(...).
  180.  
  181. CSTM*DLG.H, CSTM*DLG.CPP - the dialog classes
  182.     These files contain the dialog classes for all of your custom AppWizard's
  183.     new steps.  They derive from CAppWizStepDlg and override
  184.     CAppWizStepDlg::OnDismiss.
  185.  
  186. /////////////////////////////////////////////////////////////////////////////
  187. Help Support:
  188.  
  189. MAKEHELP.BAT
  190.     Use this batch file to create your custom AppWizard's Help file,
  191.     LOGOWIZ.HLP.
  192.  
  193. LOGOWIZ.HPJ
  194.     This file is the Help Project file used by the Help compiler to create
  195.     your custom AppWizard's Help file.
  196.  
  197. HLP\LOGOWIZ.RTF
  198.     This file contains an empty topic for each new step you generated.
  199.     You may fill out the topics using any rich-text-format
  200.     editor such as Microsoft Word.
  201.  
  202. /////////////////////////////////////////////////////////////////////////////
  203. Template Files:
  204.  
  205. TEMPLATE\
  206.     Put your template files in this directory.  Template files are stored
  207.     in your custom AppWizard as custom resources of type "TEMPLATE", and are
  208.     used by your custom AppWizard to determine the contents of the files it
  209.     generates. When you add a new template file to this directory, you must
  210.     import that file as a "TEMPLATE" custom resource into logowiz.rc.  Be
  211.     sure to select the "External File" checkbox on the custom resource's
  212.     property page.
  213.  
  214. TEMPLATE\CONFIRM.INF
  215.     In this template you should put a description of the project your
  216.     custom AppWizard generates.  The file uses template macros to customize the
  217.     text to reflect which options were selected by the custom AppWizard user.
  218.     When the custom AppWizard user clicks the "Finish" button, MFCAPWZ.DLL
  219.     parses this template and sends the output to the New Project Information
  220.     dialog.
  221.  
  222. TEMPLATE\NEWPROJ.INF
  223.     This template lists all of the templates other than CONFIRM.INF and
  224.     NEWPROJ.INF which your custom AppWizard will use to generate a project.
  225.     After MFCAPWZ.DLL parses this template, the output lists the other
  226.     templates to be parsed and what the output files should be called.  See
  227.     the documentation on custom AppWizards for a more complete description
  228.     of this template and the project generation process in general.
  229.  
  230. You have also been provided with copies of the templates used by AppWizard
  231. to generate an executable.  You are free to modify any of these templates
  232. to customize them any way you like.  For example, you may wish to change
  233. the source code tabbing style, or to include your company's copyright
  234. message at the top of each source code file.  If you delete any of these
  235. templates, AppWizard's copy of the template will automatically be used
  236. when your custom AppWizard generates projects.
  237.  
  238. /////////////////////////////////////////////////////////////////////////////
  239. Other Standard Files:
  240.  
  241. STDAFX.H, STDAFX.CPP
  242.     These files are used to build a precompiled header (PCH) file
  243.     named LOGOWIZ.PCH and a precompiled types file named STDAFX.OBJ.
  244.  
  245. RESOURCE.H
  246.     This is the standard header file, which defines new resource IDs.
  247.     Visual C++ reads and updates this file.
  248.  
  249. /////////////////////////////////////////////////////////////////////////////
  250. Other Notes:
  251.  
  252. AppWizard uses "TODO:" to indicate parts of the source code you
  253. should add to or customize.
  254.  
  255. /////////////////////////////////////////////////////////////////////////////
  256.