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

  1. ========================================================================
  2.                     CUSTOM APPWIZARD: HIERWIZ
  3. ========================================================================
  4. This AppWizard is an example of how to write a custom AppWizard that is
  5. based solely on your custom steps.  The techniques that this
  6. custom AppWizard is designed to demonstrate are:
  7.  
  8.     1. converting an existing project into a Custom AppWizard
  9.     2. adding custom pages to a wizard which started out with no pages
  10.     3. validating the user entries before going from one page to the next
  11.     4. changing the state of the Next button depending on user options
  12.     5. conditional manipulation of project templates
  13.        - adding a second view to an otherwise single view MDI application
  14.        - adding code to open a default document on startup
  15.  
  16. This file also contains a summary of what you will find in each of the
  17. files that make up your HIERWIZ DLL.
  18.  
  19. /////////////////////////////////////////////////////////////////////////////
  20. CONVERTING AN EXISTING PROJECT INTO A CUSTOM APPWIZARD
  21.  
  22. You can take any existing Appwizard generated project and convert it into
  23. a Custom Appwizard by running Appwizard and selecting Custom Appwizard
  24. from the project type. On the first page choose to base your Custom AppWizard
  25. on an existing project.
  26.  
  27.  
  28. /////////////////////////////////////////////////////////////////////////////
  29. ADDING CUSTOM PAGES TO AN APPWIZARD WHICH DIDN'T HAVE ANY TO BEGIN WITH
  30.  
  31. A Custom Appwizard generated using the above options will not have any custom
  32. pages. You will have to perform the following tasks to add custom pages to it.
  33.  
  34. i) Add a CDialogChooser derived class to your project.
  35.     The easiest way of doing this is by creating a Custom Appwizard project
  36.     based on your Custom steps, and copy the generated chooser.* files to your
  37.     project. You can now modify these files to fit your Custom Appwizard.
  38.     (For a complete description of the the different function and macros in the
  39.     CDialogChooser class, please refer to the user documentation.)
  40.  
  41. /////////////////////////////////////////////////////////////////////////////
  42. VALIDATING USER INPUT BEFORE CHANGING PAGES
  43.  
  44.     The CEdtDlg::OnDismiss() function in file "EDTDLG.CPP" performs data validation
  45.     before the user moves on to the next/previous page.
  46.  
  47. /////////////////////////////////////////////////////////////////////////////
  48. CHANGING THE STATE OF NEXT BUTTON DEPENDING ON USER OPTIONS.
  49.  
  50.     It may be necessary to disable or enable the "Next" button of your Custom Appwizard
  51.     depending on the user choices on a given page.  Take a look at the CCustom1Dlg::OnNodata()
  52.     function in file "CSTM1DLG.CPP" for an example.
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. CONDITIONAL CHANGES TO THE CODE TEMPLATES
  56.  
  57.     Several changes were made to the HIERSVR sample to support multi-views of the same document.
  58.     Additionally, code is conditionally generated depending on where the user's sample text comes from.
  59.     The following template files were modified to accomplish this. Search for the dictionary symbols
  60.     WANTS_TEXTVIEW, USER_INPUT_DATA, and OPEN_FILE in these files for the implementation.
  61.  
  62. - confirm.inf   provide text in the AppWizard confirmation dialog about both
  63.                 the text view and the sample input text.
  64.  
  65. - newproj.inf   to add the text view implementation files.
  66.  
  67. - root.cpp      code to register the new view, and open the default document.
  68.  
  69. - svrdoc.cpp    support for providing the text needed for the text view.
  70.  
  71. - svritem.cpp   support for exposing an item text.
  72.  
  73. - resource.h    define the IDs needed for handling all aspects of the new view commands.
  74.  
  75. - root.cpp      added ClassWizard information for the text view class
  76.  
  77. - root.rc       added a Text view to the main menu and popup menu.
  78.  
  79. - textview.*    declaration and implementation of the text view
  80.  
  81.  
  82. - root.MAK      added the textview.cpp file.
  83.  
  84. ========================================================================
  85.                             PROJECT FILES
  86. ========================================================================
  87.  
  88. HIERWIZ.MAK
  89.     This project file is compatible with the Visual C++ development
  90.     environment.  It is also compatible with the NMAKE program provided with
  91.     Visual C++.
  92.  
  93.     To build a debug version of the program from the MS-DOS prompt, type
  94.     nmake /f HIERWIZ.MAK CFG="Win32 Debug".
  95.  
  96.     To build a release version of the program, type
  97.     nmake /f HIERWIZ.MAK CFG="Win32 Release".
  98.  
  99. HIERWIZ.CPP
  100.     This file is the main DLL source file that contains the definition of
  101.     DllMain().  It also exports the function GetCustomAppWizClass(), which
  102.     returns a pointer to the one instance of this custom AppWizard's
  103.     CCustomAppWiz-derived class.
  104.  
  105. HIERWIZ.H
  106.     This file is the main header file for the DLL.  It includes your
  107.     RESOURCE.H file.
  108.  
  109. HIERWIZ.RC
  110.     This file is a listing of all of the Microsoft Windows resources that the
  111.     program uses.  It includes all of your custom AppWizard's templates as
  112.     custom resources of type "TEMPLATE".  These resources are pointers to the
  113.     files in your project's TEMPLATE directory.  This file can be directly
  114.     edited in the Visual C++ development environment.  However, you will
  115.     probably want to edit your templates by opening the template files directly
  116.     in the source editor rather than by editing the "TEMPLATE" resources from
  117.     the Visual C++ resource editor.
  118.  
  119. HIERWIZ.CLW
  120.     This file contains information used by ClassWizard to edit existing
  121.     classes or add new classes.  ClassWizard also uses this file to store
  122.     information needed to create and edit message maps and dialog data
  123.     maps and to create prototype member functions.
  124.  
  125. /////////////////////////////////////////////////////////////////////////////
  126. Custom AppWizard Interface:
  127.  
  128. HIERWAW.H, HIERWAW.CPP - the CCustomAppWiz class
  129.     These files contain your CCustomAppWiz-derived class,
  130.     CHierwizAppWiz.  This class contains virtual member functions which
  131.     MFCAPWZ.DLL calls to initialize your custom AppWizard and to query which
  132.     step to pop up at a given time.  This class also contains m_Dictionary,
  133.     a CMapStringToString member variable, which maps template macro names
  134.     to their values.
  135.  
  136. /////////////////////////////////////////////////////////////////////////////
  137. Dialogs:
  138.  
  139. CHOOSER.H, CHOOSER.CPP - the dialog chooser
  140.     These files contain your CDialogChooser class.  The class maintains
  141.     pointers to each of your steps, keeps track of which step is currently
  142.     up, and handles calls to your custom AppWizard class's member functions
  143.     Next(...) and Back(...).
  144.  
  145. CSTM*DLG.H, CSTM*DLG.CPP - the dialog classes
  146.     These files contain the dialog classes for all of your custom AppWizard's
  147.     new steps.  They derive from CAppWizStepDlg and override
  148.     CAppWizStepDlg::OnDismiss.
  149.  
  150. /////////////////////////////////////////////////////////////////////////////
  151. Help Support:
  152.  
  153. MAKEHELP.BAT
  154.     Use this batch file to create your custom AppWizard's Help file,
  155.     LOGOWIZ.HLP.
  156.  
  157. LOGOWIZ.HPJ
  158.     This file is the Help Project file used by the Help compiler to create
  159.     your custom AppWizard's Help file.
  160.  
  161. HLP\LOGOWIZ.RTF
  162.     This file contains an empty topic for each new step you generated.
  163.     You may fill out the topics using any rich-text-format
  164.     editor such as Microsoft Word.
  165.  
  166. /////////////////////////////////////////////////////////////////////////////
  167. Template Files:
  168.  
  169. TEMPLATE\
  170.     Put your template files in this directory.  Template files are stored
  171.     in your custom AppWizard as custom resources of type "TEMPLATE", and are
  172.     used by your custom AppWizard to determine the contents of the files it
  173.     generates. When you add a new template file to this directory, you must
  174.     import that file as a "TEMPLATE" custom resource into logowiz.rc.  Be
  175.     sure to select the "External File" checkbox on the custom resource's
  176.     property page.
  177.  
  178. TEMPLATE\CONFIRM.INF
  179.     In this template you should put a description of the project your
  180.     custom AppWizard generates.  The file uses template macros to customize the
  181.     text to reflect which options were selected by the custom AppWizard user.
  182.     When the custom AppWizard user clicks the "Finish" button, MFCAPWZ.DLL
  183.     parses this template and sends the output to the New Project Information
  184.     dialog.
  185.  
  186. TEMPLATE\NEWPROJ.INF
  187.     This template lists all of the templates other than CONFIRM.INF and
  188.     NEWPROJ.INF which your custom AppWizard will use to generate a project.
  189.     After MFCAPWZ.DLL parses this template, the output lists the other
  190.     templates to be parsed and what the output files should be called.  See
  191.     the documentation on custom AppWizards for a more complete description
  192.     of this template and the project generation process in general.
  193.  
  194. You have also been provided with copies of the templates used by AppWizard
  195. to generate an executable.  You are free to modify any of these templates
  196. to customize them any way you like.  For example, you may wish to change
  197. the source code tabbing style, or to include your company's copyright
  198. message at the top of each source code file.  If you delete any of these
  199. templates, AppWizard's copy of the template will automatically be used
  200. when your custom AppWizard generates projects.
  201.  
  202. /////////////////////////////////////////////////////////////////////////////
  203. Other Standard Files:
  204.  
  205. STDAFX.H, STDAFX.CPP
  206.     These files are used to build a precompiled header (PCH) file
  207.     named LOGOWIZ.PCH and a precompiled types file named STDAFX.OBJ.
  208.  
  209. RESOURCE.H
  210.     This is the standard header file, which defines new resource IDs.
  211.     Visual C++ reads and updates this file.
  212.  
  213. /////////////////////////////////////////////////////////////////////////////
  214. Other Notes:
  215.  
  216. You will need to copy your custom AppWizard DLLs into the bin\appwiz subdirectory
  217. under your Visual C++ installation (default: \msvc30\bin\appwiz) in order for them
  218. to be available.  If you like, you can do this once in your project settings for
  219. each custom AppWizard.  This is not done by default.
  220.  
  221. /////////////////////////////////////////////////////////////////////////////
  222.