home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / books / wsptools.db < prev    next >
Encoding:
Text File  |  1991-03-01  |  851.9 KB  |  16,680 lines

  1. %@1@%%@AB@%Microsoft  Windows  Software Development Kit - Tools%@AE@%%@EH@%%@NL@%
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11.         %@AB@%Microsoft (R) Windows (tm) Software Development Kit - Tools%@AE@%%@NL@%
  12.  
  13.      %@AB@%development tools for building Microsoft (R) Windows applications
  14.                                 %@AB@%VERSION 3.0%@AE@%
  15. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16.  
  17.  
  18. for the MS-DOS (R) and PC-DOS Operating Systems%@NL@%
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26. Microsoft Corporation%@NL@%
  27.  
  28. Information in this document is subject to change without notice and does
  29. not represent a commitment on the part of Microsoft Corporation. The
  30. software described in this document is furnished under a license agreement
  31. or nondisclosure agreement. The software may be used or copied only in
  32. accordance with the terms of the agreement. It is against the law to copy
  33. the software on any medium except as specifically allowed in the license or
  34. nondisclosure agreement. No part of this manual may be reproduced or
  35. transmitted in any form or by any means, electronic or mechanical, including
  36. photocopying and recording, for any purpose without the express written
  37. permission of Microsoft.  
  38. U.S. Government Restricted Rights
  39.  
  40.  
  41. The SOFTWARE and documentation are provided with RESTRICTED RIGHTS. Use,
  42. duplication, or disclosure by the Government is subject to restrictions as
  43. set forth in subparagraph (c) (1) (ii) of the Rights in Technical Data and
  44. Computer Software clause at  DFARS 252.227-7013 or subparagraphs (c) (1) and
  45. (2) of the Commercial Computer Software 
  46. ─ Restricted Rights at 48 CFR 52.227-19, as applicable.
  47. Contractor/manufacturer is Microsoft Corporation/One Microsoft Way/Redmond,
  48. WA 98052-6399.%@NL@%
  49.  
  50.  
  51. (C) Copyright Microsoft Corporation, 1990. All rights reserved.
  52.  
  53. Simultaneously published in the U.S. and Canada.%@NL@%
  54.  
  55.  
  56. Printed and bound in the United States of America.%@NL@%
  57.  
  58.  
  59. Microsoft, MS, MS-DOS, GW-BASIC, QuickC, CodeView, and 
  60. XENIX are registered trademarks and Windows is a trademark of Microsoft 
  61. Corporation.%@NL@%
  62.  
  63. AT&T is a registered trademark of American Telephone 
  64. and Telegraph Company.%@NL@%
  65.  
  66. Aldus is a registered trademark of Aldus Corporation.%@NL@%
  67.  
  68. COMPAQ is a registered trademark of Compaq Computer Corporation.%@NL@%
  69.  
  70. IBM is a registered trademark of International Business 
  71. Machines Corporation.%@NL@%
  72.  
  73. Intel is a registered trademark of Intel Corporation.%@NL@%
  74.  
  75. Lotus and 1-2-3 are registered trademarks of Lotus Development 
  76. Corporation.%@NL@%
  77.  
  78. Mac and Macintosh are registered trademarks of Apple Computer, 
  79. Inc.%@NL@%
  80.  
  81. Olivetti is a registered trademark of Ing. C. Olivetti.%@NL@%
  82.  
  83. Paintbrush is a registered trademark of Zsoft Corporation.%@NL@%
  84.  
  85. The Symbol fonts provided with Windows 3.0 are based on the CG Times font,
  86. a product of AGFA Compugraphic Division of Agfa Corporation.%@NL@%
  87.  
  88. Tandy is a registered trademark of Tandy Corporation.%@NL@%
  89.  
  90. Document No. SY0314b-300-R00-1089%@NL@%
  91.  
  92. %@NL@%
  93.  
  94.  
  95.  
  96.  
  97. %@1@%%@AB@%Table of Contents%@AE@%%@EH@%%@NL@%
  98. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  99.  
  100.  
  101.  
  102. %@AB@%Introduction%@AE@%%@BO:        77a0@%
  103.      Organization of This Manual%@BO:        7af8@%
  104.      Building a Windows Application%@BO:        8c03@%
  105.      Document Conventions%@BO:        9832@%
  106.      Summary%@BO:        b7ea@%
  107.  
  108.  
  109. %@AB@%PART I%@AE@%%@BO:        b940@%  %@AB@%Compilers and Linkers%@AE@%
  110. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  111.  
  112.  
  113. %@AB@%Chapter 1%@AE@%%@BO:        bb10@%  %@AB@%Compiling Applications: The C Compiler%@AE@%
  114.  
  115.      1.1%@BO:        be7f@%   Compiling C-Language Windows Applications
  116.      1.2%@BO:        d751@%   Compiler Options
  117.             1.2.1%@BO:        da21@%    Memory-Model Options
  118.             1.2.2%@BO:        e215@%    Application Development Options
  119.             1.2.3%@BO:        eb33@%    Dynamic-Link Library Options
  120.      1.3%@BO:        f5a6@%   Summary
  121.  
  122. %@AB@%Chapter 2%@AE@%%@BO:        f687@%  %@AB@%Linking Applications: The Linker%@AE@%
  123.  
  124.      2.1%@BO:        fe3b@%   Creating Module-Definition Files
  125.             2.1.1%@BO:       11377@%    Creating Module Definitions for Applications
  126.             2.1.2%@BO:       1203f@%    Creating Module Definitions for Libraries
  127.      2.2%@BO:       12c0d@%   Importing Dynamic-Link Libraries
  128.      2.3%@BO:       13651@%   Linking an Application
  129.             2.3.1%@BO:       1388e@%    Using the LINK Command
  130.             2.3.2%@BO:       142e3@%    Specifying LINK Command Options
  131.             2.3.3%@BO:       164be@%    Specifying Libraries on the LINK Command Line
  132.      2.4%@BO:       1727f@%   Examining Executable File Headers
  133.      2.5%@BO:       176b0@%   Summary
  134.  
  135. %@AB@%Chapter 3%@AE@%%@BO:       179b3@%  %@AB@%Compiling Resources: The Resource Compiler%@AE@%
  136.  
  137.      3.1%@BO:       17d69@%   Including Resources in an Application
  138.      3.2%@BO:       182a7@%   Creating a Resource Script File
  139.      3.3%@BO:       1a5ac@%   Using the Resource Compiler
  140.             3.3.1%@BO:       1cf59@%    Compiling Resources Separately
  141.             3.3.2%@BO:       1d3a9@%    Defining Names for the Preprocessor
  142.             3.3.3%@BO:       1d891@%    Renaming the Compiled Resource File
  143.             3.3.4%@BO:       1dc8a@%    Controlling the Directories that RC Searches
  144.             3.3.5%@BO:       1e58d@%    Displaying Progress Messages
  145.      3.4%@BO:       1e7ca@%   Summary
  146.  
  147.  
  148. %@AB@%PART II%@AE@%%@BO:       1ee02@%  %@AB@%Resource Editors%@AE@%
  149. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  150.  
  151.  
  152. %@AB@%Chapter 4%@AE@%%@BO:       1f053@%  %@AB@%Designing Images: SDKPaint%@AE@%
  153.  
  154.      4.1%@BO:       1f513@%   How SDKPaint Works with Files
  155.             4.1.1%@BO:       1f815@%    File Types
  156.             4.1.2%@BO:       1fbb6@%    Icon and Cursor Data: The SDKPAINT.DAT File
  157.      4.2%@BO:       206c5@%   The SDKPaint Window
  158.      4.3%@BO:       2162d@%   Opening Files and Images
  159.             4.3.1%@BO:       2172c@%    Converting Files to 3.0 Format
  160.             4.3.2%@BO:       21833@%    Opening Bitmaps
  161.             4.3.3%@BO:       21dfe@%    Opening Icons and Cursors
  162.      4.4%@BO:       22b9c@%   Drawing with SDKPaint Tools
  163.      4.5%@BO:       238c2@%   Using the SDKPaint Palette
  164.             4.5.1%@BO:       241b9@%    Working with Opaque, Screen, and Inverse Colors
  165.      4.6%@BO:       251d5@%   Customizing the Palette
  166.             4.6.1%@BO:       253be@%    Editing Colors
  167.             4.6.2%@BO:       25727@%    Saving a Palette
  168.             4.6.3%@BO:       258bf@%    Loading a Customized Palette
  169.      4.7%@BO:       25acf@%   Defining the Cursor Hotspot
  170.      4.8%@BO:       25e38@%   Using the Clipboard
  171.      4.9%@BO:       2678f@%   Using ZoomIn to Examine Images
  172.      4.10%@BO:       26c43@%  Summary
  173.  
  174. %@AB@%Chapter 5%@AE@%%@BO:       27084@%  %@AB@%Designing Dialog Boxes: The Dialog Editor%@AE@%
  175.  
  176.      5.1%@BO:       27697@%   How the Dialog Editor Works with Files
  177.             5.1.1%@BO:       27c93@%    The Dialog Script
  178.             5.1.2%@BO:       28574@%    The Resource File
  179.             5.1.3%@BO:       28b9a@%    The Include File
  180.      5.2%@BO:       29600@%   Installing and Removing Custom Controls
  181.             5.2.1%@BO:       29adc@%    Installing a Custom Control
  182.             5.2.2%@BO:       29d97@%    Removing a Custom Control
  183.      5.3%@BO:       29eca@%   Viewing a Dialog Box: The Dialog Editor Window
  184.             5.3.1%@BO:       2afad@%    The Mode Display
  185.             5.3.2%@BO:       2b33f@%    The Toolbox
  186.             5.3.3%@BO:       2b4fd@%    The Selected Item Status Window
  187.      5.4%@BO:       2bdd7@%   Opening Files and Dialog Boxes
  188.             5.4.1%@BO:       2bf8d@%    Opening a Resource File
  189.             5.4.2%@BO:       2c0e6@%    Opening an Include File
  190.             5.4.3%@BO:       2c30c@%    Opening a Dialog Box
  191.      5.5%@BO:       2c6ba@%   Editing Dialog Box Controls
  192.             5.5.1%@BO:       2de79@%    Adding Controls
  193.             5.5.2%@BO:       2e690@%    Working with Individual Controls
  194.      5.6%@BO:       2fb32@%   Working with Groups of Controls
  195.             5.6.1%@BO:       2fc38@%    Moving Groups of Controls
  196.             5.6.2%@BO:       30088@%    Defining Input Focus Sequence
  197.      5.7%@BO:       30dc5@%   Working with a Dialog Box
  198.             5.7.1%@BO:       30f44@%    Resizing a Dialog Box
  199.             5.7.2%@BO:       31164@%    Renaming a Dialog Box
  200.             5.7.3%@BO:       31271@%    Defining Styles
  201.             5.7.4%@BO:       313cb@%    Setting Memory Flags
  202.             5.7.5%@BO:       31744@%    Canceling Edits
  203.      5.8%@BO:       318cf@%   Moving a Dialog Box Between Resources
  204.      5.9%@BO:       31cdb@%   Working with Include Files
  205.             5.9.1%@BO:       32539@%    Creating New Include Files
  206.             5.9.2%@BO:       329d4@%    Loading Existing Include Files
  207.             5.9.3%@BO:       32ddd@%    Editing Include Files
  208.             5.9.4%@BO:       335c3@%    Saving Include Files
  209.      5.10%@BO:       33757@%  Summary
  210.  
  211. %@AB@%Chapter 6%@AE@%%@BO:       33cf8@%  %@AB@%Designing Fonts: The Font Editor%@AE@%
  212.  
  213.      6.1%@BO:       342ca@%   Opening a Font
  214.      6.2%@BO:       34ca3@%   Editing Characters
  215.             6.2.1%@BO:       35091@%    Turning Pixels On or Off
  216.             6.2.2%@BO:       35220@%    Changing Rows and Columns of Pixels
  217.             6.2.3%@BO:       35c37@%    Modifying Blocks of Pixels
  218.             6.2.4%@BO:       365e5@%    Changing Character Width
  219.             6.2.5%@BO:       36d22@%    Storing Changes to a Character
  220.             6.2.6%@BO:       36f9e@%    Canceling Changes to a Character
  221.      6.3%@BO:       37419@%   Editing a Font
  222.      6.4%@BO:       3818c@%   Changing Font File Header Information
  223.      6.5%@BO:       39c7a@%   Summary
  224.  
  225.  
  226. %@AB@%PART III%@AE@%%@BO:       39d91@%  %@AB@%Debugging and Optimization Tools%@AE@%
  227. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  228.  
  229.  
  230. %@AB@%Chapter 7%@AE@%%@BO:       3a335@%  %@AB@%Debugging in Protected Mode: CodeView for Windows%@AE@%
  231.  
  232.      7.1%@BO:       3acad@%   Requirements for Use
  233.      7.2%@BO:       3b253@%   Comparing %@AB@%CVW%@AE@% with Other Microsoft Debuggers
  234.             7.2.1%@BO:       3b461@%    Differences between CVW and SYMDEB
  235.             7.2.2%@BO:       3bc05@%    Differences between CVW and CodeView for DOS
  236.      7.3%@BO:       3c7e7@%   Preparing to Run CVW
  237.             7.3.1%@BO:       3ca33@%    Setting Up a Secondary Monitor
  238.             7.3.2%@BO:       3d1c0@%    Setting Up the Debugging Version of Windows
  239.             7.3.3%@BO:       3dc1d@%    Preparing Windows Applications for Debugging
  240.      7.4%@BO:       3e208@%   Starting a Debugging Session
  241.             7.4.1%@BO:       3e5aa@%    Starting a Debugging Session for a Single Application
  242.             7.4.2%@BO:       3ed39@%    Starting a Debugging Session for Multiple Instances 
  243.                         of an Application
  244.             7.4.3%@BO:       3f295@%    Starting a Debugging Session for Multiple Applications
  245.             7.4.4%@BO:       3f9ce@%    Starting a Debugging Session for DLLs
  246.             7.4.5%@BO:       40849@%    Using CVW File Run Options
  247.      7.5%@BO:       41ef7@%   Saving Session Information
  248.      7.6%@BO:       42570@%   Working with the CVW Screen
  249.             7.6.1%@BO:       42713@%    Using CVW Display Windows
  250.             7.6.2%@BO:       43d21@%    Using the CVW Menu Bar
  251.      7.7%@BO:       45c88@%   Getting On-line Help in %@AB@%CVW%@AE@%
  252.      7.8%@BO:       45e67@%   Displaying Program Data
  253.             7.8.1%@BO:       46119@%    Displaying Variables
  254.             7.8.2%@BO:       46d22@%    Displaying Expressions
  255.             7.8.3%@BO:       4716f@%    Displaying Arrays and Structures
  256.             7.8.4%@BO:       485b5@%    Using the Quick Watch Command
  257.             7.8.5%@BO:       48afc@%    Tracing Windows Messages
  258.             7.8.6%@BO:       491e4@%    Displaying Memory
  259.             7.8.7%@BO:       4b845@%    Displaying the Contents of Registers
  260.             7.8.8%@BO:       4bd76@%    Displaying Windows Modules
  261.      7.9%@BO:       4bed4@%   Modifying Program Data
  262.      7.10%@BO:       4c716@%  Controlling Program Execution
  263.             7.10.1%@BO:       4cbf5@%   Continuous Execution
  264.             7.10.2%@BO:       4f4a1@%   Single-Step Execution
  265.             7.10.3%@BO:       4fc5f@%   Jumping to a Particular Location
  266.             7.10.4%@BO:       502fa@%   Interrupting Your Program
  267.      7.11%@BO:       51117@%  Handling Abnormal Termination of the Application
  268.             7.11.1%@BO:       5145f@%   Handling a Fatal Exit
  269.             7.11.2%@BO:       5220f@%   Handling a GP Fault
  270.      7.12%@BO:       52587@%  Ending a CVW Session
  271.      7.13%@BO:       5267d@%  Restarting a %@AB@%CVW%@AE@% Debugging Session
  272.      7.14%@BO:       52a52@%  Advanced %@AB@%CVW%@AE@% Techniques
  273.             7.14.1%@BO:       52c37@%   Using Multiple Source Windows
  274.             7.14.2%@BO:       52e37@%   Calling Functions
  275.             7.14.3%@BO:       53286@%   Checking for Undefined Pointers
  276.             7.14.4%@BO:       53804@%   Handling Register Variables
  277.             7.14.5%@BO:       53c7d@%   Redirecting %@AB@%CVW%@AE@% Input and Output
  278.      7.15%@BO:       54118@%  Customizing CVW with the TOOLS.INI File
  279.      7.16%@BO:       5446a@%  A Sample Session in %@AB@%CVW%@AE@%
  280.      7.17%@BO:       56924@%  Summary
  281.  
  282. %@AB@%Chapter 8%@AE@%%@BO:       56cd9@%  %@AB@%Debugging in Real Mode: Symbolic Debugger%@AE@%
  283.  
  284.      8.1%@BO:       575ef@%   Preparing Symbol Files
  285.             8.1.1%@BO:       57827@%    MAPSYM Program
  286.             8.1.2%@BO:       58494@%    The Incremental Linker
  287.             8.1.3%@BO:       5868a@%    Symbols with C-Language Applications
  288.             8.1.4%@BO:       58b5c@%    Symbols with Assembly-Language Applications
  289.      8.2%@BO:       59092@%   Setting Up the Debugging Terminal
  290.             8.2.1%@BO:       59247@%    Setting Up a Remote Terminal
  291.             8.2.2%@BO:       59702@%    Setting Up a Secondary Monitor
  292.      8.3%@BO:       59bfb@%   Starting SYMDEB with Windows
  293.             8.3.1%@BO:       5a251@%    Specifying SYMDEB Options
  294.             8.3.2%@BO:       5c64c@%    Specifying Symbol Files
  295.             8.3.3%@BO:       5cd9b@%    Passing the Application to Windows
  296.             8.3.4%@BO:       5d09c@%    Using SYMDEB Keys
  297.      8.4%@BO:       5d7aa@%   Working with Symbol Maps
  298.             8.4.1%@BO:       5dc42@%    Listing the Symbol Maps
  299.             8.4.2%@BO:       5e4ee@%    Opening a Symbol Map
  300.             8.4.3%@BO:       5e71d@%    Displaying Symbols
  301.      8.5%@BO:       5ecd4@%   Starting the Application
  302.      8.6%@BO:       5ef91@%   Displaying Allocation Messages
  303.             8.6.1%@BO:       5f80a@%    Setting Breakpoints with Symbols
  304.             8.6.2%@BO:       5fdd4@%    Displaying Variables
  305.             8.6.3%@BO:       603d4@%    Displaying Application Source Statements
  306.      8.7%@BO:       60938@%   Quitting SYMDEB
  307.      8.8%@BO:       60dad@%   SYMDEB Command Overview and Tables
  308.             8.8.1%@BO:       62bfa@%    Command Arguments
  309.             8.8.2%@BO:       65499@%    Address Arguments
  310.             8.8.3%@BO:       66503@%    Expressions
  311.      8.9%@BO:       66e66@%   SYMDEB Commands
  312.             a ─ Assemble%@BO:       670b1@%
  313.             ba ─ Breakpoint Address%@BO:       6783c@%
  314.             bc ─ Breakpoint Clear%@BO:       68271@%
  315.             bd ─ Breakpoint Disable%@BO:       684c3@%
  316.             be ─ Breakpoint Enable%@BO:       68713@%
  317.             bl ─ Breakpoint List%@BO:       68987@%
  318.             bp ─ Breakpoint Set%@BO:       68c25@%
  319.             c ─ Compare%@BO:       691ac@%
  320.             d ─ Dump%@BO:       6943b@%
  321.             da ─ Dump ASCII%@BO:       69704@%
  322.             db ─ Dump Bytes%@BO:       69961@%
  323.             dd ─ Dump Doublewords%@BO:       69c49@%
  324.             df ─ Display Global Free List%@BO:       69e58@%
  325.             dg ─ Display Global Heap%@BO:       6a132@%
  326.             dh ─ Display Local Heap%@BO:       6ac49@%
  327.             dl ─ Dump Long Reals%@BO:       6b07e@%
  328.             dm ─ Display Global Module List%@BO:       6b2c7@%
  329.             dq ─ Dump Task Queue%@BO:       6b601@%
  330.             ds ─ Dump Short Reals%@BO:       6ba78@%
  331.             dt ─ Dump Ten-Byte Reals%@BO:       6bcbf@%
  332.             du ─ Display Global LRU List%@BO:       6bef1@%
  333.             dw ─ Dump Words%@BO:       6c793@%
  334.             e ─ Enter%@BO:       6c976@%
  335.             ea ─ Enter Address%@BO:       6ccc9@%
  336.             eb ─ Enter Bytes%@BO:       6cf2c@%
  337.             ed ─ Enter Doublewords%@BO:       6d222@%
  338.             el ─ Enter Long Reals%@BO:       6d4ef@%
  339.             es ─ Enter Short Reals%@BO:       6d765@%
  340.             et ─ Enter Ten-Byte Reals%@BO:       6d9e0@%
  341.             ew ─ Enter Words%@BO:       6dc55@%
  342.             f ─ Fill%@BO:       6de8f@%
  343.             g ─ Go%@BO:       6e0ec@%
  344.             h ─ Hex%@BO:       6e471@%
  345.             i ─ Input%@BO:       6e5df@%
  346.             k ─ Backtrace Stack%@BO:       6e788@%
  347.             kt ─ Backtrace Task Stack%@BO:       6eadf@%
  348.             kv ─ Verbose Backtrace Stack%@BO:       6ee2a@%
  349.             l ─ Load%@BO:       6efe0@%
  350.             m ─ Move%@BO:       6f5e1@%
  351.             m%@AI@%id%@AE@%%@AB@%%@AE@%─ Macro%@BO:       6f7a2@%
  352.             n ─ Name%@BO:       6fb3f@%
  353.             o ─ Output%@BO:       6ff21@%
  354.             p ─ Program Step%@BO:       700c1@%
  355.             q ─ Quit%@BO:       7043c@%
  356.             r ─ Register%@BO:       705a1@%
  357.             s ─ Search%@BO:       708e5@%
  358.             Set Source Mode%@BO:       70a89@%
  359.             t ─ Trace%@BO:       70efd@%
  360.             u ─ Unassemble%@BO:       71280@%
  361.             v ─ View%@BO:       71532@%
  362.             w ─ Write%@BO:       716a0@%
  363.             x ─ Examine Symbol Map%@BO:       71b29@%
  364.             xo ─ Open Symbol Map%@BO:       722ba@%
  365.             z ─ Set Symbol Value%@BO:       72566@%
  366.             ? ─ Display Help%@BO:       726a5@%
  367.             ? ─ Display Expression%@BO:       727e7@%
  368.             . ─ Source-Line Display%@BO:       72a6f@%
  369.             Redirect Input%@BO:       72b9a@%
  370.             Redirect Output%@BO:       72d9b@%
  371.             Redirect Input and Output%@BO:       72f78@%
  372.             ! ─ Shell Escape%@BO:       73188@%
  373.             * ─ Comment%@BO:       7342a@%
  374.  
  375. %@AB@%Chapter 9%@AE@%%@BO:       73575@%  %@AB@%Advanced Debugging in Protected Mode: 80386 Debugger%@AE@%
  376.  
  377.      9.1%@BO:       73af4@%   Preparing Symbol Files for the 80386 Debugger
  378.      9.2%@BO:       73dd5@%   Starting the Debugger
  379.      9.3%@BO:       74653@%   When an Application Fails
  380.      9.4%@BO:       74ce9@%   Debugger Command Format
  381.             9.4.1%@BO:       74ebc@%    Command Keys
  382.             9.4.2%@BO:       750c9@%    Command Parameters
  383.             9.4.3%@BO:       76c60@%    Binary and Unary Operators
  384.      9.5%@BO:       7763a@%   Common Command Directory
  385.             ? ─ Display Expression%@BO:       782f8@%
  386.             ? ─ Display Help Menu%@BO:       79359@%
  387.             .? ─ Display External Commands%@BO:       7949d@%
  388.             .b ─ Set COM Port Baud Rate%@BO:       7963e@%
  389.             .df ─ Display Global Free List%@BO:       79c60@%
  390.             .dg ─ Display Global Heap%@BO:       7a0c0@%
  391.             .dh ─ Display Local Heap%@BO:       7aea7@%
  392.             .dm ─ Display Global Module List%@BO:       7b2f8@%
  393.             .dq ─ Dump Task Queue%@BO:       7b643@%
  394.             .du ─ Display Global LRU List%@BO:       7bacb@%
  395.             .reboot ─ Reboot Target System%@BO:       7c430@%
  396.             bc ─ Clear Breakpoints%@BO:       7c56a@%
  397.             bd ─ Disable Breakpoints%@BO:       7c975@%
  398.             be ─ Enable Breakpoints%@BO:       7ce01@%
  399.             bl ─ List Breakpoints%@BO:       7d268@%
  400.             bp ─ Set Breakpoints%@BO:       7d81f@%
  401.             c ─ Compare Memory%@BO:       7e3ab@%
  402.             d ─ Display Memory%@BO:       7ea53@%
  403.             db ─ Display Bytes%@BO:       7f13f@%
  404.             dd ─ Display Doublewords%@BO:       7f799@%
  405.             dg ─ Display GDT%@BO:       7ff2f@%
  406.             di ─ Display IDT%@BO:       806b2@%
  407.             dl ─ Display LDT%@BO:       80ed0@%
  408.             dt ─ Display TSS%@BO:       8190e@%
  409.             dw ─ Display Words%@BO:       81e26@%
  410.             e ─ Enter Byte%@BO:       8252a@%
  411.             f ─ Fill Memory%@BO:       8301d@%
  412.             g ─ Go%@BO:       83742@%
  413.             h ─ Hexadecimal Arithmetic%@BO:       842e4@%
  414.             i ─ Input Byte%@BO:       8472d@%
  415.             j ─ Conditional Execute%@BO:       849d4@%
  416.             k ─ Backtrace Stack%@BO:       85209@%
  417.             ka ─ Set Backtrace Arguments%@BO:       856b6@%
  418.             kt ─ Backtrace Task Stack%@BO:       859f3@%
  419.             kv ─ Verbose Backtrace Stack%@BO:       85ffa@%
  420.             la ─ List Absolute Symbols%@BO:       861b7@%
  421.             lg ─ List Groups%@BO:       862f7@%
  422.             lm ─ List Map%@BO:       86662@%
  423.             ln ─ List Near%@BO:       868dd@%
  424.             ls ─ List Symbols%@BO:       86d08@%
  425.             m ─ Move Memory%@BO:       873c5@%
  426.             o ─ Output to Port%@BO:       87b9e@%
  427.             p ─ Program Trace%@BO:       87e9f@%
  428.             r ─ Display Registers%@BO:       889a5@%
  429.             s ─ Search Bytes%@BO:       89d82@%
  430.             t ─ Trace Instructions%@BO:       8a3ff@%
  431.             u ─ Unassemble Bytes%@BO:       8ada1@%
  432.             v ─ Set Interrupt Vector Trapping%@BO:       8b5ed@%
  433.             vl ─ Display Interrupt Trapping Information%@BO:       8bcf1@%
  434.             w ─ Change Map%@BO:       8bf38@%
  435.             y ─ Debugger Option Command%@BO:       8c621@%
  436.             z ─ Zap Embedded INT 1 and INT 3 Instructions%@BO:       8ce3e@%
  437.             zd ─ Execute Default Command String%@BO:       8d048@%
  438.             zl ─ Display Default Command String%@BO:       8d356@%
  439.             zs ─ Change Default Command String%@BO:       8d50c@%
  440.      9.6 386 Enhanced Windows Environment Commands%@BO:       8dbb2@%
  441.      9.7 Summary%@BO:       904b0@%
  442.  
  443. %@AB@%Chapter 10%@AE@%%@BO:       9079e@%  %@AB@%Monitoring Messages: Spy%@AE@%
  444.  
  445.      10.1%@BO:       90bc5@%  Displaying Messages
  446.      10.2%@BO:       90f08@%  Choosing Options
  447.             10.2.1%@BO:       910cb@%    Choosing Messages
  448.             10.2.2%@BO:       917e0@%    Choosing the Output Device
  449.             10.2.3%@BO:       91bb1@%    Choosing Frequency of Output
  450.      10.3%@BO:       91e50@%  Choosing a Window: The Window Menu
  451.      10.4%@BO:       92730@%  Turning Spy On and Off: The Spy Menu
  452.      10.5%@BO:       92a4a@%  Summary
  453.  
  454. %@AB@%Chapter 11%@AE@%%@BO:       92cf7@%  %@AB@%Viewing the Heap: Heap Walker%@AE@%
  455.  
  456.      11.1%@BO:       92fec@%  How Heap Walker Views Memory
  457.             11.1.1%@BO:       93107@%    Viewing the Heap in Protected Mode
  458.             11.1.2%@BO:       932ad@%    Viewing the Heap in Real Mode
  459.      11.2%@BO:       93561@%  The Heap Walker Window
  460.      11.3%@BO:       93a55@%  Using Heap Walker Commands
  461.             11.3.1%@BO:       93c03@%    Performing File Operations: The File Menu
  462.             11.3.2%@BO:       9427e@%    Walking the Heap: The Walk and EmsWalk Menus
  463.             11.3.3%@BO:       95063@%    Sorting Memory Objects: The Sort Menu
  464.             11.3.4%@BO:       95400@%    Displaying Memory Objects: The Object Menu
  465.             11.3.5%@BO:       962ec@%    Allocating Memory: The Alloc Menu
  466.             11.3.6%@BO:       96c22@%    Determining Memory Size: The Add! Menu
  467.      11.4%@BO:       96dc5@%  Suggestions for Using Heap Walker
  468.      11.5%@BO:       977d9@%  Summary
  469.  
  470. %@AB@%Chapter 12%@AE@%%@BO:       97904@%  %@AB@%Moving Memory: Shaker%@AE@%
  471.  
  472.      12.1%@BO:       97bb6@%  Using Shaker
  473.      12.2%@BO:       98622@%  Summary
  474.  
  475. %@AB@%Chapter 13%@AE@%%@BO:       98768@%  %@AB@%Analyzing CPU Time: Profiler%@AE@%
  476.  
  477.      13.1%@BO:       98bc7@%  Overview of Profiler
  478.      13.2%@BO:       9936c@%  Preparing to Run Profiler
  479.      13.3%@BO:       998e1@%  Using Profiler Functions
  480.             13.3.1%@BO:       99d26@%    Starting and Stopping Sampling: The ProfStart and 
  481.                          ProfStop Functions
  482.             13.3.2%@BO:       9a38f@%    Checking if Profiler Is Installed: The ProfInsChk 
  483.                          Function
  484.             13.3.3%@BO:       9a621@%    Setting the Sampling Rate: The ProfSampRate Function
  485.             13.3.4%@BO:       9af87@%    Managing Output: The ProfClear, ProfFlush,
  486.                          and ProfSetup Functions
  487.             13.3.5%@BO:       9bbd2@%    Stopping Profiler: The ProfFinish Function
  488.      13.4%@BO:       9be9e@%  Sampling Code
  489.             13.4.1%@BO:       9c496@%    Sampling Applications in Windows Real Mode
  490.             13.4.2%@BO:       9cf81@%    Sampling Applications in Windows 386 Enhanced Mode
  491.      13.5%@BO:       9d309@%  Displaying Samples: SHOWHITS.EXE
  492.      13.6%@BO:       9ebf9@%  Summary
  493.  
  494. %@AB@%Chapter 14%@AE@%%@BO:       9ed31@%  %@AB@%Analyzing Swaps: Swap%@AE@%
  495.  
  496.      14.1%@BO:       9f0b2@%  Preparing to Run Swap
  497.             14.1.1%@BO:       9f1bd@%    Files You Need to Run Swap
  498.             14.1.2%@BO:       9f5c1@%    Using the SwapRecording Function
  499.      14.2%@BO:       9f9d0@%  Running Swap
  500.             14.2.1%@BO:       a0052@%    Specifying a Symbol-File Path
  501.             14.2.2%@BO:       a0259@%    Specifying a Pathname for the Data Collection File
  502.             14.2.3%@BO:       a0440@%    Specifying a Module and Segment
  503.      14.3%@BO:       a0768@%  Displaying Output
  504.      14.4%@BO:       a15fb@%  Summary
  505.  
  506.  
  507. %@AB@%PART IV%@AE@%%@BO:       a1750@%  %@AB@%Help Tools%@AE@%
  508. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  509.  
  510.  
  511. %@AB@%Chapter 15%@AE@%%@BO:       a1a76@%  %@AB@%Providing Help: The Help System%@AE@%
  512.  
  513.      15.1%@BO:       a1efb@%  Creating a Help System: The Development Cycle
  514.      15.2%@BO:       a25a6@%  How Help Appears to the User
  515.      15.3%@BO:       a2a32@%  How Help Appears to the Help Writer
  516.      15.4%@BO:       a2e0e@%  How Help Appears to the Help Programmer
  517.      15.5%@BO:       a3015@%  Summary
  518.  
  519. %@AB@%Chapter 16%@AE@%%@BO:       a3307@%  %@AB@%Planning the Help System%@AE@%
  520.  
  521.      16.1%@BO:       a3529@%  Developing a Plan
  522.             16.1.1%@BO:       a3847@%    Defining the Audience
  523.             16.1.2%@BO:       a3da2@%    Planning the Content of the Help System
  524.             16.1.3%@BO:       a42e0@%    Planning the Structure of Help Topics
  525.             16.1.4%@BO:       a4d6a@%    Displaying Context-Sensitive Help Topics
  526.      16.2%@BO:       a571a@%  Determining the Topic File Structure
  527.             16.2.1%@BO:       a5985@%    Choosing a File Structure for Your Application
  528.      16.3%@BO:       a5f48@%  Designing the Appearance of Help Topics
  529.             16.3.1%@BO:       a612e@%    Layout of the Help Text
  530.             16.3.2%@BO:       a76d9@%    Type Fonts and Sizes
  531.             16.3.3%@BO:       a7cb9@%    Graphic Images
  532.      16.4%@BO:       a8119@%  Summary
  533.  
  534. %@AB@%Chapter 17%@AE@%%@BO:       a8875@%  %@AB@%Creating the Help Topic Files%@AE@%
  535.  
  536.      17.1%@BO:       a8c68@%  Choosing an Authoring Tool
  537.      17.2%@BO:       a9015@%  Structuring Help Topic Files
  538.      17.3%@BO:       a9424@%  Coding Help Topic Files
  539.             17.3.1%@BO:       aa061@%    Assigning Build Tags
  540.             17.3.2%@BO:       aaca1@%    Assigning Context Strings
  541.             17.3.3%@BO:       ab556@%    Assigning Titles
  542.             17.3.4%@BO:       abd90@%    Assigning Key Words
  543.             17.3.5%@BO:       ad08c@%    Assigning Browse Sequence Numbers
  544.             17.3.6%@BO:       ae5d1@%    Creating Cross-References Between Topics
  545.             17.3.7%@BO:       aeb5f@%    Defining Terms
  546.      17.4%@BO:       af620@%  Inserting Graphic Images
  547.             17.4.1%@BO:       af8d0@%    Creating and Capturing Bitmaps
  548.             17.4.2%@BO:       aff35@%    Placing Bitmaps Using a Graphical Word Processor
  549.             17.4.3%@BO:       b019e@%    Placing Bitmaps by Reference
  550.      17.5%@BO:       b0c62@%  Managing Topic Files
  551.             17.5.1%@BO:       b0f4c@%    Keeping Track of Files and Topics
  552.             17.5.2%@BO:       b12dc@%    Creating a Help Tracker
  553.      17.6%@BO:       b1b0f@%  Summary
  554.  
  555. %@AB@%Chapter 18%@AE@%%@BO:       b1c01@%  %@AB@%Building the Help File%@AE@%
  556.  
  557.      18.1%@BO:       b201c@%  Creating the Help Project File
  558.      18.2%@BO:       b29aa@%  Specifying Topic Files: The Files Section
  559.      18.3%@BO:       b2fdf@%  Specifying Build Tags: The BuildTags Section
  560.      18.4%@BO:       b3425@%  Specifying Options: The Options Section
  561.             18.4.1%@BO:       b3b4f@%    Specifying Error Reporting: The Warning Option
  562.             18.4.2%@BO:       b426e@%    Specifying Build Topics: The Build Option
  563.             18.4.3%@BO:       b4d85@%    Specifying the Root Directory: The Root Option
  564.             18.4.4%@BO:       b5232@%    Specifying the Index: The Index Option
  565.             18.4.5%@BO:       b5760@%    Assigning a Title to the Help System: The Title 
  566.                          Option
  567.             18.4.6%@BO:       b5a93@%    Converting Fonts: The Forcefont Option
  568.             18.4.7%@BO:       b608e@%    Changing Font Sizes : The Mapfontsize Option
  569.             18.4.8%@BO:       b6889@%    Multiple Key-Word Tables: The Multikey Option
  570.             18.4.9%@BO:       b6e82@%    Compressing the File: The Compress Option
  571.      18.5%@BO:       b74ed@%  Specifying Alternate Context Strings: The Alias Section
  572.      18.6%@BO:       b7ed7@%  Mapping Context-Sensitive Topics: The Map Section
  573.      18.7%@BO:       b8ddd@%  Including Bitmaps by Reference: The Bitmaps Section
  574.      18.8%@BO:       b90e9@%  Compiling Help Files
  575.             18.8.1%@BO:       b9b13@%    Using the Help Compiler
  576.      18.9%@BO:       b9f8d@%  Programming the Application to Access Help
  577.             18.9.1%@BO:       ba1b0@%    Calling WinHelp from an Application
  578.             18.9.2%@BO:       bb31b@%    Getting Context-Sensitive Help
  579.             18.9.3%@BO:       bd387@%    Getting Help on an Item Listed on the Help Menu
  580.             18.9.4%@BO:       bd6c6@%    Accessing Additional Key-Word Tables
  581.             18.9.5%@BO:       bdf91@%    Canceling Help
  582.      18.10%@BO:       be805@% Summary
  583.  
  584. %@AB@%Chapter 19%@AE@%%@BO:       beaa9@%  %@AB@%Help Examples and Compiler Error Messages%@AE@%
  585.  
  586.      19.1%@BO:       bef59@%  Help Topic Examples
  587.      19.2%@BO:       bf6ba@%  Help Compiler Error Messages
  588.             19.2.1%@BO:       c01ca@%    Errors During Processing of Project File
  589.             19.2.2%@BO:       c3d6c@%    Errors During Processing of RTF Topic Files
  590.  
  591. %@AB@%Index%@AE@%%@BO:       c8c74@%
  592.  
  593.  
  594.  
  595.  
  596. %@CR:C6A-Intro   @%%@1@%%@AB@%Introduction%@AE@%%@EH@%%@NL@%
  597. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  598.  
  599. The %@AI@%Microsoft(R) Windows(tm) Software Development Kit Tools%@AE@% manual explains
  600. how to use the programming tools that come with the Microsoft Windows
  601. Software Development Kit (SDK). This manual also explains how to use some
  602. additional tools, such as the C Compiler and linker, that don't come with
  603. the SDK but which you will need in order to create Windows applications.%@NL@%
  604.  
  605. This introductory chapter describes the following topics:  %@NL@%
  606.  
  607.  
  608.   ■   The general organization of %@AI@%Tools%@AE@%%@NL@%
  609.  
  610.   ■   An overview of the steps involved in creating a Windows application%@NL@%
  611.  
  612.   ■   The notational conventions used throughout the manual%@NL@%
  613.  
  614.   ■   Related documentation
  615. %@NL@%
  616.  
  617.  
  618.  
  619. %@2@%%@CR:C6A00000001 @%%@AB@%Organization of This Manual%@AE@%%@EH@%%@NL@%
  620.  
  621. This manual is divided into four parts, each of which contains several
  622. chapters.  %@NL@%
  623.  
  624. Part 1, "Compilers and Linkers," explains how to compile and link your
  625. source files. Part 1 consists of the following chapters.%@CR:C6A00000002 @%%@CR:C6A00000003 @%%@CR:C6A00000004 @%%@CR:C6A00000005 @%%@CR:C6A00000006 @%%@NL@%
  626.  
  627.  
  628.   ■   Chapter 1, "Compiling Applications: The C Compiler," explains how to
  629.       use the C Compiler (%@AB@%CL%@AE@%) to compile C-language source files for Windows
  630.       applications.%@NL@%
  631.  
  632.   ■   Chapter 2, "Linking Applications: The Linker," explains how to use the
  633.       linker (%@AB@%LINK%@AE@%) to link compiled source files into an executable Windows
  634.       application.%@NL@%
  635.  
  636.   ■   Chapter 3, "Compiling Resources: The Resource Compiler," explains how
  637.       to use the Resource Compiler (%@AB@%RC%@AE@%) to compile application resources and
  638.       add them to an executable Windows application.%@NL@%
  639.  
  640.  
  641. Part 2, "Resource Editors," explains how to create and maintain Windows
  642. program resources, such as icons and bitmaps, using the tools that come with
  643. the SDK. Part 2 consists of the following chapters:  %@NL@%
  644.  
  645.  
  646.   ■   Chapter 4, "Designing Images: SDKPaint," explains how to use SDKPaint
  647.       (%@AB@%SDKPAINT%@AE@%) to create and edit icons, cursors, and bitmaps for Windows
  648.       applications. %@NL@%
  649.  
  650.   ■   Chapter 5, "Designing Dialog Boxes: The Dialog Editor," explains how
  651.       to use the Dialog Editor (%@AB@%DIALOG%@AE@%) to create and edit dialogs for
  652.       Windows applications.%@NL@%
  653.  
  654.   ■   Chapter 6, "Designing Fonts: The Font Editor," explains how to use the
  655.       Font Editor (%@AB@%FONTEDIT%@AE@%) to create and edit font files for Windows
  656.       applications.%@NL@%
  657.  
  658.  
  659. Part 3, "Debugging and Optimization Tools," explains how to use the
  660. debugging and testing tools that come with the SDK. Part 3 consists of the
  661. following chapters:%@AB@%  %@AE@%%@NL@%
  662.  
  663.  
  664.   ■   Chapter 7, "Debugging in Protected Mode: CodeView for Windows,"
  665.       explains how to use CodeView(R) for Windows (%@AB@%CVW%@AE@%) to debug Windows
  666.       applications that run in protected mode.%@NL@%
  667.  
  668.   ■   Chapter 8, "Debugging in Real Mode: Symbolic Debugger," explains how
  669.       to use the Symbolic Debugger (%@AB@%SYMDEB%@AE@%) to debug Windows applications
  670.       that run in real mode.%@NL@%
  671.  
  672.   ■   Chapter 9, "Advanced Debugging in Protected Mode: 80386 Debugger,"
  673.       explains how to use the 80386 Debugger (%@AB@%WDEB386%@AE@%) to debug Windows
  674.       applications that run in protected mode.%@NL@%
  675.  
  676.   ■   Chapter 10, "Monitoring Messages: Spy," explains how to use Spy (%@AB@%SPY%@AE@%)
  677.       to monitor a window receiving system messages. %@NL@%
  678.  
  679.   ■   Chapter 11, "Viewing the Heap: Heap Walker," explains how to use Heap
  680.       Walker (%@AB@%HEAPWALK%@AE@%) to open and examine the global heap.%@NL@%
  681.  
  682.   ■   Chapter 12, "Moving Memory: Shaker," explains how to use Shaker
  683.       (%@AB@%SHAKER%@AE@%) to see the effect of memory movement on applications.%@NL@%
  684.  
  685.   ■   Chapter 13, "Analyzing CPU Time: Profiler," explains how to use
  686.       Profiler (%@AB@%PROFILER%@AE@%) to analyze and optimize the performance of
  687.       moveable code.%@NL@%
  688.  
  689.   ■   Chapter 14, "Analyzing Swaps: Swap," explains how to use Swap (%@AB@%SWAP%@AE@%)
  690.       to analyze and optimize your application's swapping behavior.%@NL@%
  691.  
  692.  
  693. Part 4, "Help Tools," explains how to plan, write, and compile a Windows
  694. Help system. Part 4 consists of the following chapters:%@AB@%  %@AE@%%@NL@%
  695.  
  696.  
  697.   ■   Chapter 15, "Providing Help: The Help System," gives an overview of
  698.       the Help system from the point of view of the user, the Help writer,
  699.       and the Help programmer.%@NL@%
  700.  
  701.   ■   Chapter 16, "Planning the Help System," explains what considerations
  702.       the Help writer should keep in mind when planning a Help system.%@NL@%
  703.  
  704.   ■   Chapter 17, "Creating the Help Topic Files," explains how to write and
  705.       code Help text files.%@NL@%
  706.  
  707.   ■   Chapter 18, "Building the Help File," explains how to build a Help
  708.       resource file.%@NL@%
  709.  
  710.   ■   Chapter 19, "Help Examples and Compiler Error Messages," shows example
  711.       topic files in several word processors, together with their
  712.       corresponding Help display. The chapter also includes a listing of
  713.       Help compiler error messages.%@NL@%
  714.  
  715.  
  716.  
  717. %@2@%%@CR:C6A00000007 @%%@AB@%Building a Windows Application%@AE@%%@EH@%%@NL@%
  718.  
  719. You can build a Windows application using any ASCII text editor and the
  720. tools described in this manual. This section briefly explains the process
  721. involved in creating a Windows application, and highlights the role that the
  722. development tools play in this process.  %@NL@%
  723.  
  724. To build a Windows application, do the following:%@CR:C6A00000008 @%%@CR:C6A00000009 @%%@CR:C6A00000010 @%%@NL@%
  725.  
  726.  
  727.   1.  Using a text editor, create C-language or assembly-language source
  728.       files that contain the WinMain function, window functions, and other
  729.       application code.%@CR:C6A00000011 @%%@NL@%
  730.  
  731.   2.  Create any cursor, icon, bitmap, dialog, and font resources the
  732.       application will need with the resource editors (%@AB@%SDKPAINT%@AE@%, %@AB@%DIALOG%@AE@%, and
  733.       %@AB@%FONTEDIT%@AE@%).%@NL@%
  734.  
  735.   3.  Produce a resource script (.RC) file that defines all of the
  736.       application's resources. The script file, which you create with a text
  737.       editor, lists and names the resources you created in the preceding
  738.       step. It also defines menus, dialog boxes, and other resources, such
  739.       as string tables and application-defined resources.%@CR:C6A00000012 @%%@NL@%
  740.  
  741.   4.  Use the Resource Compiler with the %@AB@%-r%@AE@% switch to compile the resource
  742.       script (.RC) file into a binary resource (.RES) file. %@CR:C6A00000013 @%%@NL@%
  743.  
  744.   5.  Use a text editor to create the module-definition (.DEF) file. %@CR:C6A00000014 @%%@NL@%
  745.  
  746.   6.  Compile all C-language sources with the C Compiler. Use the Microsoft
  747.       Macro Assembler (%@AB@%MASM%@AE@%) to assemble all assembly-language sources.%@CR:C6A00000015 @%%@NL@%
  748.  
  749.   7.  Using %@AB@%LINK%@AE@%, link the compiled and/or assembled source files with your
  750.       Windows and C run-time libraries. This produces a file with the .EXE
  751.       extension; however, you cannot execute such a file, because it does
  752.       not yet include the compiled resources.%@NL@%
  753.  
  754.   8.  Use %@AB@%RC%@AE@% without the %@AB@%-r%@AE@% switch to add the binary resource (.RES) file to
  755.       the .EXE file. This produces an executable Windows application.%@NL@%
  756.  
  757.   9.  Track down program errors and other problems with the Windows
  758.       debuggers: CodeView for Windows and the Symbolic Debugger. The Spy
  759.       program is useful for monitoring the Windows messages your program
  760.       receives. The Shaker program lets you simulate memory movements that
  761.       occur in the Windows multitasking environment.%@NL@%
  762.  
  763.   10. Fine-tune your program with Windows optimization tools, Profiler and
  764.       Swap, so that it runs faster and uses memory more efficiently. %@NL@%
  765.  
  766.   11. Build your program's help system with the Windows Help tools. This
  767.       step can take place during, rather than after, the
  768.       application-development process.%@NL@%
  769.  
  770.  
  771. The following figure shows the steps required to build a Windows
  772. application.  %@NL@%
  773.  
  774. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  775.  
  776. The figure "Building a Windows Application" does not include the debugging,
  777. optimization, or Help tools.  %@NL@%
  778.  
  779.  
  780. %@2@%%@CR:C6A00000016 @%%@AB@%Document Conventions%@AE@%%@EH@%%@NL@%
  781.  
  782. Throughout this manual, the term "DOS" refers to both MS-DOS(R) and PC-DOS,
  783. except when noting features that are unique to one or the other.%@CR:C6A00000017 @%%@NL@%
  784.  
  785. The following document conventions are used throughout this manual:  %@NL@%
  786.  
  787. %@TH:  75  5380 02 34 42 @%
  788. Convention                        Description of Convention
  789. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  790. %@AB@%Bold text%@AE@%                         Bold text indicates a specific term or 
  791.                                   punctuation mark intended to be used 
  792.                                   literally: language key words or 
  793.                                   functions (such as %@AB@%EXETYPE%@AE@% or %@AB@%%@AE@%
  794.                                   %@AB@%CreateWindow%@AE@%), DOS commands, and 
  795.                                   command-line options (such as %@AB@%/Zi%@AE@%). You 
  796.                                   must type these terms and punctuation 
  797.                                   marks exactly as shown. However, the use
  798.                                   of uppercase or lowercase letters is not
  799.                                   always significant. For instance, you 
  800.                                   can invoke the linker by typing either %@AB@%%@AE@%
  801.                                   %@AB@%LINK%@AE@%, %@AB@%link%@AE@%, or %@AB@%Link%@AE@% at the DOS prompt. %@CR:C6A00000018 @% %@CR:C6A00000019 @%
  802.  
  803. ( )                               In syntax statements, parentheses 
  804.                                   enclose one or more parameters that you 
  805.                                   pass to a function. %@CR:C6A00000020 @% %@CR:C6A00000021 @% %@CR:C6A00000022 @% 
  806.  
  807. %@AI@%Italic text%@AE@%                       Italic text indicates a placeholder; you
  808.                                   are expected to provide the actual value.
  809.                                   For example, the following syntax for 
  810.                                   the %@AB@%Set-%@AE@%
  811.                                   %@AB@%CursorPos%@AE@% function indicates that you 
  812.                                   must substitute values for the %@AI@%X%@AE@% and %@AI@%Y%@AE@% 
  813.                                   coordinates, separated by a comma: %@AB@%%@AE@%
  814.                                   %@AB@%SetCursorPos(%@AE@%%@AI@%X, Y%@AE@%%@AB@%)%@AE@% %@CR:C6A00000023 @% %@CR:C6A00000024 @% 
  815.  
  816. %@AS@%Monospaced type%@AE@%                   Code examples are displayed in a 
  817.                                   nonproportional typeface. %@CR:C6A00000025 @% %@CR:C6A00000026 @% 
  818.  
  819. %@AS@%BEGIN%@RR@% .%@RR@% .%@RR@% .%@RR@%END%@AE@%                    A vertical ellipsis in a program example
  820.                                   indicates that a portion of the program 
  821.                                   is omitted. %@CR:C6A00000027 @% %@CR:C6A00000028 @%
  822.  
  823. . . .                             An ellipsis following an item indicates 
  824.                                   that more items having the same form may
  825.                                   appear. In the following example, the 
  826.                                   horizontal ellipsis indicates that you 
  827.                                   can specify more than one %@AI@%breakaddress%@AE@% 
  828.                                   value for the %@AB@%g%@AE@% command:
  829.                                   
  830.                                    %@AB@%g%@AE@% «=%@AI@%startaddress%@AE@%» «%@AI@%breakaddress%@AE@%»...%@CR:C6A00000029 @%%@CR:C6A00000030 @%%@CR:C6A00000031 @%
  831.  
  832. « »                               Double brackets enclose optional fields 
  833.                                   or parameters in command lines and 
  834.                                   syntax statements. In the following 
  835.                                   example, %@AI@%option%@AE@% and %@AI@%executable-file%@AE@% are 
  836.                                   optional parameters of the %@AB@%RC%@AE@% command: %@CR:C6A00000032 @% %@CR:C6A00000033 @%
  837.                                   %@CR:C6A00000034 @% %@CR:C6A00000035 @%
  838.  
  839.                                   %@AB@%RC%@AE@% «%@AI@%option%@AE@%» %@AI@%filename%@AE@% «%@AI@%executable-file%@AE@%»
  840.  
  841. |                                 A vertical bar indicates that you may 
  842.                                   enter one of the entries shown on either
  843.                                   side of the bar. The following 
  844.                                   command-line syntax illustrates the use 
  845.                                   of a vertical bar:
  846.                                    %@CR:C6A00000036 @% %@CR:C6A00000037 @% %@CR:C6A00000038 @%%@AB@%%@AE@%
  847.                                   %@AB@%DB%@AE@% «%@AI@%address%@AE@% | %@AI@%range%@AE@%»
  848.  
  849.                                   The bar indicates that following the %@AB@%%@AE@%
  850.                                   %@AB@%Dump Bytes%@AE@% command (%@AB@%DB%@AE@%), you can specify
  851.                                   either an %@AI@%address%@AE@% or a %@AI@%range%@AE@%. 
  852.  
  853. " "                               Quotation marks set off terms defined in
  854.                                   the text. %@CR:C6A00000039 @% %@CR:C6A00000040 @% %@CR:C6A00000041 @%
  855.  
  856. { }                               Curly braces indicate that you must 
  857.                                   specify one of the enclosed items.%@CR:C6A00000042 @% %@CR:C6A00000043 @% %@CR:C6A00000044 @% %@CR:C6A00000045 @%
  858.  
  859. SMALL CAPITAL LETTERS             Small capital letters indicate the names
  860.                                   of keys and key sequences, such as: ALT 
  861.                                   + SPACEBAR %@CR:C6A00000046 @% %@CR:C6A00000047 @% %@CR:C6A00000048 @% %@CR:C6A00000049 @%
  862.  
  863. %@TE:  75  5380 02 34 42 @%
  864.  
  865.  
  866. %@4@%%@AB@%Microsoft Windows Software Development Kit Documentation Set%@AE@%%@EH@%%@NL@%
  867.  
  868. Throughout this documentation set "SDK" refers specifically to the Microsoft
  869. Windows Software Development Kit and its contents. The SDK includes the
  870. following manuals:  %@NL@%
  871.  
  872. %@AB@%Title%@AE@%                             %@AB@%Contents%@AE@%
  873. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  874. %@AI@%Installation and%@AE@%                  Provides an orientation to the SDK, 
  875. %@AI@%Update Guide %@AE@%                     explains how to install the SDK software,
  876.                                   and highlights the changes for version 
  877.                                   3.0.%@AI@%%@AE@%
  878.  
  879. %@AI@%Guide to Programming%@AE@%              Explains how to write Windows 
  880.                                   applications, and provides sample 
  881.                                   applications that you can use as 
  882.                                   templates for writing your own programs.
  883.                                   The %@AI@%Guide to Programming%@AE@% also addresses 
  884.                                   some advanced Windows programming 
  885.                                   topics.
  886.  
  887. %@AI@%Tools%@AE@%                             Explains how to use the 
  888.                                   software-development tools you'll need 
  889.                                   to build Windows applications, such as 
  890.                                   debuggers and specialized SDK editors.
  891.  
  892. %@AI@%Reference%@AE@%                         Is a comprehensive guide to all the 
  893.                                   details of the Microsoft Windows 
  894.                                   application program interface (API). The
  895.                                   %@AI@%Reference%@AE@% lists in alphabetical order 
  896.                                   all the current functions, messages, and
  897.                                   data structures of the API, and provides
  898.                                   extensive overviews on how to use the 
  899.                                   API.
  900.  
  901. %@AI@%System Application Architecture,%@AE@%  Provides guidelines and recommendations 
  902. %@AI@%Common User Access: Advanced %@AE@%     for writing programs that appear and act
  903. %@AI@%Interface Design Guide%@AE@%            consistently like other Microsoft 
  904.                                   Windows applications. 
  905.  
  906.  
  907. %@2@%%@CR:C6A00000050 @%%@AB@%Summary%@AE@%%@EH@%%@NL@%
  908.  
  909. This introductory chapter explained the organization of %@AI@%Tools%@AE@%, and briefly
  910. described the tools and processes you use to build Windows applications.  %@NL@%
  911.  
  912. For more information about building Windows applications, see %@AI@%Guide to
  913. %@AI@%Programming%@AE@%.  %@NL@%
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920. %@CR:C6A-Part 01 @%%@1@%%@AB@%PART I  Compilers and Linkers%@AE@%%@EH@%%@NL@%
  921. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  922.  
  923. Part 1 describes how to use the C Compiler to compile your C-language source
  924. code modules, the linker to link your compiled or assembled source files
  925. with your Microsoft Windows and C run-time libraries, and the Resource
  926. Compiler to produce an executable Windows application.  %@NL@%
  927.  
  928.  
  929.  
  930.  
  931.  
  932.  
  933. %@CR:C6A00010001 @%%@1@%%@AB@%Chapter 1  Compiling Applications: The C Compiler%@AE@%%@EH@%%@NL@%
  934. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  935.  
  936. Many Microsoft Windows applications are written in the C programming
  937. language and are compiled using the Microsoft C Compiler (%@AB@%CL%@AE@%). This chapter
  938. describes the following topics:  %@NL@%
  939.  
  940.  
  941.   ■   A brief overview of how to write C-language Windows applications%@NL@%
  942.  
  943.   ■   How to use the Microsoft C Compiler to compile C-language Windows
  944.       applications%@NL@%
  945.  
  946.  
  947. This chapter deals only with the special compilation requirements of
  948. C-language Windows applications. For complete information on using the C
  949. Compiler, see the Microsoft C documentation. For information on writing
  950. Windows applications using the C language, see the %@AI@%Guide to Programming%@AE@%.  %@NL@%
  951.  
  952.  
  953. %@2@%%@CR:C6A00010002 @%%@AB@%1.1  Compiling C-Language Windows Applications%@AE@%%@EH@%%@NL@%
  954.  
  955. To compile a C-language Windows application, use the Microsoft C Compiler.
  956. The compiler comes with Microsoft C; it is not included in the Microsoft
  957. Windows Software Development Kit (SDK). Microsoft Windows requires version
  958. 5.1 or later of Microsoft C, or version 2.0 or later of Microsoft QuickC
  959. (R). To start the Microsoft C Compiler, use the %@AB@%CL%@AE@% command. Table 1.1, "C
  960. Compiler Options for Windows Applications," lists and describes the options
  961. commonly used for compiling Windows applications.%@CR:C6A00010003 @%%@CR:C6A00010004 @%%@CR:C6A00010005 @%%@CR:C6A00010006 @%%@CR:C6A00010007 @%%@NL@%
  962.  
  963. Table 1.1  C Compiler Options for Windows Applications
  964.  
  965. %@TH:  10   609 02 08 34 34 @%
  966. Option  What It Does                      When to Use It
  967. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  968. %@AB@%-AC%@AE@%     Compiles the application for the  Used when an application has one
  969.         compact memory model.             code segment but multiple data 
  970.                                           segments.
  971.  
  972. %@AB@%-AL%@AE@%     Compiles the application for the  Used when an application has 
  973.         large memory model.               multiple segments for both code 
  974.                                           and data.
  975.  
  976. %@TE:  10   609 02 08 34 34 @%
  977.  
  978. Table 1.1  C Compiler Options for Windows Applications (continued)
  979.  
  980. %@TH:  65  3904 02 08 34 34 @%
  981. Option  What It Does                      When to Use It
  982. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  983. %@AB@%-AM%@AE@%     Compiles the application for the  Used when an application has 
  984.         medium memory model.              multiple code segments but one 
  985.                                           data segment. Can also be used 
  986.                                           to create applications using the
  987.                                           mixed memory model. See %@AI@%Guide to%@AE@%
  988.                                           %@AI@%Programming%@AE@% for a description of
  989.                                           the mixed memory model.
  990.  
  991. %@AB@%-AS%@AE@%     Compiles the application for the  Used when an application has 
  992.         small memory model.               only one code and one data 
  993.                                           segment. Can also be used to 
  994.                                           create applications using the 
  995.                                           mixed memory model.
  996.  
  997. %@AB@%-Aw%@AE@%     Ensures that pointers receive     Used when compiling a 
  998.         their proper segment addresses    dynamic-link library (DLL).
  999.         when cast to 32-bit addresses.    
  1000.  
  1001. %@AB@%-c%@AE@%      Compiles only.                    Required if you have more than 
  1002.                                           one C source module and you want
  1003.                                           to separate linking from 
  1004.                                           compiling.
  1005.  
  1006. %@AB@%-Gs%@AE@%     Removes stack probes, thereby     Recommended for all Windows 
  1007.         improving performance.            applications after the 
  1008.                                           development process is complete.
  1009.  
  1010. %@AB@%-Gw%@AE@%     Adds the Windows prolog and       Required for all Windows source 
  1011.         epilog to all functions.          code modules. (May be used for 
  1012.                                           source code modules that do not 
  1013.                                           contain exported (callback) 
  1014.                                           functions; but -%@AB@%GW%@AE@% is 
  1015.                                           recommended in this case.)
  1016.  
  1017. %@AB@%-GW%@AE@%     Substitutes a reduced Windows     Recommended for Windows source 
  1018.         prolog and epilog to functions    code modules that do not contain
  1019.         that are far calls within the     exported or callback functions. 
  1020.         application. (Available only      
  1021.         with C version 6.0 and later.)    
  1022.  
  1023. %@AB@%-Os%@AE@%     Optimizes for code size instead   Recommended for all Windows 
  1024.         of speed.                         source code modules.
  1025.  
  1026. %@AB@%-Ow%@AE@%     Relaxes alias checking within     Recommended instead of 
  1027.         certain constraints imposed by    non-Windows %@AB@%-Oa%@AE@% relax-alias-
  1028.         the Windows environment.          checking option.
  1029.         (Available only with C version     
  1030.         6.0 and later.)                   
  1031.  
  1032. %@AB@%-Zd%@AE@%     Creates an object file for use    Required for debugging the 
  1033.         with the Symbolic Debugger (%@AB@%%@AE@%      source-code module using %@AB@%SYMDEB%@AE@% 
  1034.         %@AB@%SYMDEB%@AE@%) or the 80386 Debugger (%@AB@%%@AE@%   or %@AB@%WDEB386%@AE@%.
  1035.         %@AB@%WDEB386%@AE@%).                         
  1036.  
  1037. %@AB@%-Zi%@AE@%     Creates an object file for use    Required for debugging the 
  1038.         with CodeView for Windows (%@AB@%CVW%@AE@%).  source-code module using %@AB@%CVW%@AE@%.
  1039.  
  1040. %@AB@%-Zp%@AE@%     Packs structures on single-byte   Required for all Windows source 
  1041.         boundaries.                       code modules that use structures.
  1042.                                           %@CR:C6A00010008 @%%@CR:C6A00010009 @% %@CR:C6A00010010 @%%@AB@% %@AE@%
  1043.  
  1044. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1045.  
  1046. %@TE:  65  3904 02 08 34 34 @%
  1047.  
  1048. In addition to the options in Table 1.1, "C Compiler Options for Windows
  1049. Applications," which most Windows applications use, you can supply other
  1050. compiler options as necessary. Section 1.2, "Compiler Options," describes
  1051. more fully many of the options you may want to use.%@CR:C6A00010011 @%%@CR:C6A00010012 @%%@CR:C6A00010013 @%%@CR:C6A00010014 @%%@NL@%
  1052.  
  1053. In the following example, the source file TEST.C is compiled using the
  1054. recommended %@AB@%CL%@AE@% options for a small-model Windows application source file
  1055. during application development.  %@NL@%
  1056.  
  1057. %@AS@%  CL -c -Os -Gw -AS -Zdp TEST.C%@AE@%
  1058.  
  1059. With these options, the compiler suppresses linking (%@AB@%-c%@AE@%), optimizes for size
  1060. (%@AB@%-Os%@AE@%), adds the Windows prolog and epilog to exported functions (%@AB@%-Gw%@AE@%), uses
  1061. the small memory model (%@AB@%-AS%@AE@%), provides line-number information (%@AB@%-Zd%@AE@%), and
  1062. packs structures (%@AB@%-Zp%@AE@%).%@CR:C6A00010015 @%%@NL@%
  1063.  
  1064.  
  1065. %@2@%%@CR:C6A00010016 @%%@AB@%1.2  Compiler Options%@AE@%%@EH@%%@NL@%
  1066.  
  1067. This section describes some compiler options you may want to use when
  1068. compiling a Windows application. For a complete description of the C
  1069. Compiler options, see the %@AI@%Microsoft C Optimizing Compiler User's Guide.%@AE@%  %@NL@%
  1070.  
  1071. This section describes the following types of compiler options:%@CR:C6A00010017 @%%@CR:C6A00010018 @%%@NL@%
  1072.  
  1073.  
  1074.   ■   Memory-model options, which let you compile medium, compact, and
  1075.       large-model applications. (By default, the compiler uses the small
  1076.       memory model.)%@NL@%
  1077.  
  1078.   ■   Options you may want to set during application development.%@NL@%
  1079.  
  1080.   ■   Options for compiling dynamic-link libraries.
  1081. %@NL@%
  1082.  
  1083.  
  1084.  
  1085. %@3@%%@CR:C6A00010019 @%%@AB@%1.2.1  Memory-Model Options%@AE@%%@EH@%%@NL@%
  1086.  
  1087. Windows applications can use the small, medium, compact, or large memory
  1088. model. (Windows does not support the huge memory model.)%@CR:C6A00010020 @%%@CR:C6A00010021 @%%@NL@%
  1089.  
  1090. You specify a programming model by supplying the appropriate compiler option
  1091. on the %@AB@%CL%@AE@% command line when you compile the application source files. You
  1092. base your choice on the application's need for data and code. The
  1093. memory-model compiler options are:  %@NL@%
  1094.  
  1095. %@AB@%Memory Model%@AE@%                      %@AB@%Compiler Option%@AE@%
  1096. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1097. Small                             %@AB@%-AS%@AE@%
  1098.  
  1099. Medium                            %@AB@%-AM%@AE@%
  1100.  
  1101. Compact                           %@AB@%-AC%@AE@%
  1102.  
  1103. Large                             %@AB@%-AL%@AE@%
  1104.  
  1105. The compact and large memory models are not recommended for Windows
  1106. applications, unless you're creating a Windows application by porting an
  1107. existing compact or large-model application from the DOS environment. This
  1108. is because Windows requires that all data segments of compact and
  1109. large-model applications be fixed, and Windows can run only one instance of
  1110. an application with far data segments. The following statement must be in
  1111. the module-definition (.DEF) file of any compact or large-model application:
  1112. %@NL@%
  1113.  
  1114. %@AS@%  DATA FIXED%@AE@%
  1115.  
  1116. When compiling medium, compact, and large-model source files for Windows
  1117. applications, you can specify the names of the code and data segments to
  1118. which each source belongs. Use the %@AB@%-NT%@AE@% option to specify code segments; use
  1119. the %@AB@%-ND%@AE@% option for data segments. If you do not use these options, the C
  1120. Compiler assumes that the source belongs to the standard code and data
  1121. segments, _TEXT and _DATA.%@CR:C6A00010022 @%%@CR:C6A00010023 @%%@NL@%
  1122.  
  1123. For more information on memory models, see %@AI@%Guide to Programming%@AE@% and the
  1124. appropriate Microsoft C documentation.  %@NL@%
  1125.  
  1126.  
  1127. %@3@%%@CR:C6A00010024 @%%@AB@%1.2.2  Application Development Options%@AE@%%@EH@%%@NL@%
  1128.  
  1129. To make application development and debugging easier, the C Compiler
  1130. includes options for the following:%@CR:C6A00010025 @%%@NL@%
  1131.  
  1132.  
  1133.   ■   Provides line-number information so you can display program lines%@NL@%
  1134.  
  1135.   ■   Lets you turn off optimization to make debugging easier%@NL@%
  1136.  
  1137.   ■   Lets you disable stack probes 
  1138. %@NL@%
  1139.  
  1140.  
  1141.  
  1142. %@4@%%@AB@%Preparing for Debugging%@AE@%%@EH@%%@NL@%
  1143.  
  1144. Windows applications written in C are easier to debug if the compiler adds
  1145. debugging information to the object file. You can then use the Symbolic
  1146. Debugger (%@AB@%SYMDEB%@AE@%) utility or CodeView for Windows (%@AB@%CVW%@AE@%) to help you debug
  1147. your application.%@CR:C6A00010026 @%%@CR:C6A00010027 @%%@CR:C6A00010028 @%%@CR:C6A00010029 @%%@CR:C6A00010030 @%%@NL@%
  1148.  
  1149. To add debugging information used by %@AB@%SYMDEB%@AE@%, compile your application  with
  1150. the %@AB@%-Zd%@AE@% option. This option produces an object file containing line-number
  1151. records corresponding to the line numbers of the source file, as well as
  1152. global-symbol information which %@AB@%SYMDEB%@AE@% uses. For more information on %@AB@%SYMDEB%@AE@%,
  1153. see Chapter 8, "Debugging in Real Mode: Symbolic Debugger."  %@NL@%
  1154.  
  1155. To add debugging information used by %@AB@%CVW%@AE@%, use the %@AB@%-Zi%@AE@% option when you
  1156. compile. The resulting object file contains full symbolic-debugging
  1157. information, including local function-variable information, full
  1158. symbol-table information, and line numbers. For more information on %@AB@%CVW%@AE@%, see
  1159. Chapter 7, "Debugging in Protected Mode: CodeView for Windows."  %@NL@%
  1160.  
  1161.  
  1162. %@4@%%@AB@%Turning Off Optimization%@AE@%%@EH@%%@NL@%
  1163.  
  1164. While an application is in development, you may want to turn off optimizing
  1165. to make debugging easier. (By default, the C Compiler optimizes for speed.)
  1166. To turn off program optimization, use the %@AB@%-Od%@AE@% option.%@CR:C6A00010031 @%%@NL@%
  1167.  
  1168.  
  1169. %@4@%%@AB@%Using Stack Probes%@AE@%%@EH@%%@NL@%
  1170.  
  1171. By default, the compiler provides stack probes. Stack probes can be useful
  1172. during application development, but they can cause a slight performance
  1173. degradation. When the application-development process is complete, it's a
  1174. good idea to turn off the stack probes by using the %@AB@%-Gs%@AE@% option.%@CR:C6A00010032 @%%@CR:C6A00010033 @%%@NL@%
  1175.  
  1176.  
  1177. %@3@%%@CR:C6A00010034 @%%@AB@%1.2.3  Dynamic-Link Library Options%@AE@%%@EH@%%@NL@%
  1178.  
  1179. When compiling DLLs, you should specify the following compiler options:%@CR:C6A00010035 @%%@NL@%
  1180.  
  1181.  
  1182.   ■   The %@AB@%-Gw%@AE@% option, to ensure that exported functions receive the Windows
  1183.       prolog and epilog. (For modules that do not contain exported
  1184.       functions, you can use the %@AB@%-GW%@AE@% option instead to reduce the size of
  1185.       the prolog and epilog.)%@NL@%
  1186.  
  1187.   ■   The %@AB@%-Aw%@AE@% option, to ensure that pointers receive their proper segment
  1188.       addresses when cast to 32-bit addresses. The %@AB@%-Aw%@AE@% option must follow or
  1189.       be combined with the %@AB@%-AC%@AE@%, %@AB@%-AL%@AE@%, %@AB@%-AM%@AE@%, or %@AB@%-AS%@AE@% option, as appropriate.%@NL@%
  1190.  
  1191.  
  1192. Dynamic-link libraries written in C have slightly different requirements
  1193. than do Windows applications written in C. Unlike Windows applications,
  1194. dynamic-link libraries are not executable programs; although a library is
  1195. loaded, it does not execute directly. Instead, the code in a library is made
  1196. available to all applications that need to use it, and an application can
  1197. execute a portion of the library by calling one of the exported functions in
  1198. the library.%@CR:C6A00010036 @%%@CR:C6A00010037 @%%@NL@%
  1199.  
  1200. Like exported (callback) functions in Windows applications, exported
  1201. functions in libraries must have the Windows prolog and epilog. This means
  1202. that, for dynamic-link libraries, the %@AB@%-Gw%@AE@% option is required. Exported
  1203. functions should be listed in the library's module-definition file. See
  1204. Chapter 2, "Linking Applications: The Linker," for information about
  1205. module-definition files.%@CR:C6A00010038 @%%@CR:C6A00010039 @%%@CR:C6A00010040 @%%@CR:C6A00010041 @%%@CR:C6A00010042 @%%@CR:C6A00010043 @%%@CR:C6A00010044 @%%@CR:C6A00010045 @%%@CR:C6A00010046 @%%@CR:C6A00010047 @%%@NL@%
  1206.  
  1207. You should compile dynamic-link libraries with the %@AB@%-Aw%@AE@% option; this ensures
  1208. that pointers receive their proper segment addresses when cast to 32-bit
  1209. addresses. Libraries always use the stack of the calling application for
  1210. parameters and local variables. This means that the values of the DS and SS
  1211. registers are not equal when the library is executed. Because the C Compiler
  1212. generates code that assumes that the DS and SS registers are equal,
  1213. dynamic-link libraries may fail unless compiled with the %@AB@%-Aw%@AE@% option. This
  1214. option directs the compiler to generate code that does not assume that the
  1215. registers are equal.%@CR:C6A00010048 @%%@CR:C6A00010049 @%%@NL@%
  1216.  
  1217. The following example shows the recommended options for compiling libraries:
  1218. %@NL@%
  1219.  
  1220. %@AS@%  CL -c -AMw -Gsw -Os TESTLIB.C%@AE@%
  1221.  
  1222.  
  1223. %@2@%%@CR:C6A00010050 @%%@AB@%1.3  Summary%@AE@%%@EH@%%@NL@%
  1224.  
  1225. The Microsoft C Compiler compiles C-language Windows applications. For more
  1226. information about using the compiler, see the Microsoft C documentation.  %@NL@%
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233. %@CR:C6A00020001 @%%@1@%%@AB@%Chapter 2  Linking Applications: The Linker%@AE@%%@EH@%%@NL@%
  1234. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1235.  
  1236. You create executable Microsoft Windows applications and libraries by
  1237. linking your compiled source files using the linker (%@AB@%LINK%@AE@%). %@AB@%LINK%@AE@% takes your
  1238. compiled sources, a list of libraries, and a module-definition file, and
  1239. creates a file that you can load and run with Windows.%@CR:C6A00020002 @%%@CR:C6A00020003 @%%@CR:C6A00020004 @%%@CR:C6A00020005 @%%@CR:C6A00020006 @%%@NL@%
  1240.  
  1241. %@AB@%LINK%@AE@% comes with Microsoft C; it is not included in the Microsoft Windows
  1242. Software Development Kit (SDK). Windows requires version 5.1 or later of
  1243. Microsoft C, or version 2.0 or later of Microsoft QuickC.%@CR:C6A00020007 @%%@CR:C6A00020008 @%%@CR:C6A00020009 @%%@NL@%
  1244.  
  1245. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1246. IMPORTANT
  1247.  
  1248. %@AI@%Microsoft C version 5.1 and Microsoft QuickC versions 2.0 and later include
  1249. %@AI@%two linkers. If you are developing your application with one of these
  1250. %@AI@%versions, use the segmented-executable linker.%@AE@%
  1251. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1252.  
  1253. Microsoft C version 6.0 includes %@AB@%ILINK%@AE@%, the incremental linker. This linker
  1254. does not relink files that have already been linked and that have not
  1255. changed. %@AB@%ILINK%@AE@% also directly creates .SYM files for use by the Symbolic
  1256. Debugger (%@AB@%SYMDEB%@AE@%). %@AB@%ILINK%@AE@% also uses the .SYM files it creates to avoid
  1257. unnecessary relinking. For more information on %@AB@%ILINK%@AE@%, see the Microsoft C
  1258. 6.0 documentation.  %@NL@%
  1259.  
  1260. This chapter describes the following topics:  %@NL@%
  1261.  
  1262.  
  1263.   ■   Module-definition files%@NL@%
  1264.  
  1265.   ■   The difference between applications' and libraries' module-definition
  1266.       files%@NL@%
  1267.  
  1268.   ■   How to use %@AB@%LINK%@AE@% to link Windows applications%@NL@%
  1269.  
  1270.  
  1271.  
  1272. %@2@%%@CR:C6A00020010 @%%@AB@%2.1  Creating Module-Definition Files%@AE@%%@EH@%%@NL@%
  1273.  
  1274. Every Windows application and library must have a "module-definition file."
  1275. A module-definition file is an ordinary text file that defines the
  1276. application's contents and system requirements. When you link a Windows
  1277. application, the linker uses the information in the application's
  1278. module-definition file to determine how to set up the application (for
  1279. example, how large to make the application's default stack, or whether to
  1280. mark a particular code segment as moveable in memory).  %@NL@%
  1281.  
  1282. You create a module-definition file using an ordinary ASCII text editor. The
  1283. file can have any filename you want, but must have the filename extension
  1284. %@AI@%.%@AE@%DEF.  %@NL@%
  1285.  
  1286. Every module-definition (.DEF) file contains one or more statements. Each
  1287. statement defines a specific attribute of the application or library, such
  1288. as its module name, the number and type of program segments, or the number
  1289. and names of exported and imported functions.%@CR:C6A00020011 @%%@CR:C6A00020012 @%%@CR:C6A00020013 @%%@NL@%
  1290.  
  1291. Windows module-definition files can contain the following statements:%@CR:C6A00020014 @%%@CR:C6A00020015 @%%@CR:C6A00020016 @%%@NL@%
  1292.  
  1293. %@AB@%Statement%@AE@%                         %@AB@%Usage%@AE@%
  1294. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1295. %@AB@%CODE%@AE@%                              Defines code-segment attributes, such as
  1296.                                   whether or not a segment is moveable in 
  1297.                                   memory. %@CR:C6A00020017 @%%@CR:C6A00020018 @%
  1298.  
  1299. %@AB@%DATA%@AE@%                              Defines data-segment attributes, such as
  1300.                                   whether there are single or multiple 
  1301.                                   data segments, and whether a segment is 
  1302.                                   moveable in memory. %@CR:C6A00020019 @%%@CR:C6A00020020 @%
  1303.  
  1304. %@AB@%DESCRIPTION%@AE@%                       Briefly describes the module. %@CR:C6A00020021 @% %@CR:C6A00020022 @%
  1305.  
  1306. %@AB@%EXETYPE%@AE@%                           Tells %@AB@%LINK%@AE@% what type of .EXE header to 
  1307.                                   use (Windows or OS/2).%@CR:C6A00020023 @%%@CR:C6A00020024 @%
  1308.  
  1309. %@AB@%EXPORTS%@AE@%                           Lists functions in this module that will
  1310.                                   be called by Windows or other 
  1311.                                   applications. For example, an 
  1312.                                   application's .DEF file always lists the
  1313.                                   application's window functions, since 
  1314.                                   Windows must call these functions in 
  1315.                                   order for the application to work
  1316.                                   properly. %@CR:C6A00020025 @%%@CR:C6A00020026 @%
  1317.  
  1318. %@AB@%HEAPSIZE%@AE@%                          Specifies the default size of the local 
  1319.                                   heap in bytes. The recommended size is 
  1320.                                   5K.%@CR:C6A00020027 @%%@CR:C6A00020028 @%
  1321.  
  1322. %@AB@%IMPORTS%@AE@%                           Lists other applications' functions that
  1323.                                   this module calls. For example, if you 
  1324.                                   wrote a library of utility functions, an
  1325.                                   application would have to import those 
  1326.                                   functions before it could use them. (You
  1327.                                   can also import library functions using 
  1328.                                   the %@AB@%IMPLIB%@AE@% utility. See Section 2.2, 
  1329.                                   "Importing Dynamic-Link Libraries," for 
  1330.                                   more information.) %@CR:C6A00020029 @%%@CR:C6A00020030 @%
  1331.  
  1332. %@AB@%LIBRARY%@AE@%                           Specifies the module name of a 
  1333.                                   dynamic-link
  1334.                                   library. %@CR:C6A00020031 @%%@CR:C6A00020032 @%
  1335.  
  1336. %@AB@%NAME%@AE@%                              Specifies the module name of an 
  1337.                                   application. %@CR:C6A00020033 @% %@CR:C6A00020034 @%
  1338.  
  1339. %@AB@%SEGMENTS%@AE@%                          Specifies the attributes of additional 
  1340.                                   code or data segments. %@CR:C6A00020035 @% %@CR:C6A00020036 @%
  1341.  
  1342. %@AB@%STACKSIZE%@AE@%                         Determines the default size of the local
  1343.                                   stack in bytes. The recommended size is 
  1344.                                   5K.%@CR:C6A00020037 @%%@CR:C6A00020038 @%
  1345.  
  1346. %@AB@%Statement%@AE@%                         %@AB@%Usage%@AE@%
  1347. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1348. %@AB@%STUB%@AE@%                              Specifies the application's old-style 
  1349.                                   (DOS
  1350.                                   environment) executable file.%@CR:C6A00020039 @%%@CR:C6A00020040 @%
  1351.  
  1352. For details on the module-definition statements, see the %@AI@%Reference%@AE@%, %@AI@%Volume
  1353. %@AI@%2.%@AE@%  %@NL@%
  1354.  
  1355. Because Windows applications and libraries have different needs, the
  1356. statements you include in a .DEF file will differ slightly, depending on
  1357. whether you are creating the .DEF file for an application or for a library.
  1358. The rest of this section describes the specific module-definition needs of
  1359. applications and libraries.  %@NL@%
  1360.  
  1361.  
  1362. %@3@%%@CR:C6A00020041 @%%@AB@%2.1.1  Creating Module Definitions for Applications%@AE@%%@EH@%%@NL@%
  1363.  
  1364. A module-definition file for an application must include the following
  1365. statements:%@CR:C6A00020042 @%%@CR:C6A00020043 @%%@CR:C6A00020044 @%%@CR:C6A00020045 @%%@NL@%
  1366.  
  1367.  
  1368.   ■   A %@AB@%NAME%@AE@% statement that defines the application's module name. Windows
  1369.       uses the module name to identify the application. The module name must
  1370.       match the application's base filename. %@NL@%
  1371.  
  1372.   ■   An %@AB@%EXPORTS%@AE@% statement that lists functions in the module that Windows
  1373.       or other applications will call, such as window and callback
  1374.       functions.%@NL@%
  1375.  
  1376.   ■   An %@AB@%EXETYPE WINDOWS%@AE@% statement, which enables the application to run in
  1377.       the Windows environment. This statement tells %@AB@%LINK%@AE@% to use a Windows
  1378.       executable-file header instead of an OS/2 header (the default).%@CR:C6A00020046 @%%@CR:C6A00020047 @%%@CR:C6A00020048 @%%@CR:C6A00020049 @%%@CR:C6A00020050 @%%@NL@%
  1379.  
  1380.  
  1381. Although these are the only required statements in the .DEF file, most .DEF
  1382. files contain additional statements, such as the %@AB@%DATA%@AE@% and %@AB@%CODE%@AE@% statements,
  1383. to define other aspects of the application.%@CR:C6A00020051 @%%@CR:C6A00020052 @%%@CR:C6A00020053 @%%@CR:C6A00020054 @%%@CR:C6A00020055 @%%@CR:C6A00020056 @%%@CR:C6A00020057 @%%@CR:C6A00020058 @%%@CR:C6A00020059 @%%@NL@%
  1384.  
  1385. The following example shows a typical .DEF file for a Windows application:  %@NL@%
  1386.  
  1387. %@AS@%  ; Sample Module Definition File
  1388. %@AS@%   "NAME Sample
  1389. %@AS@%   DESCRIPTION 'Sample Window Application'
  1390. %@AS@%   
  1391. %@AS@%   EXETYPE WINDOWS 
  1392. %@AS@%   
  1393. %@AS@%   DATA MULTIPLE MOVEABLE
  1394. %@AS@%   CODE MOVEABLE DISCARDABLE
  1395. %@AS@%   
  1396. %@AS@%   HEAPSIZE 5120
  1397. %@AS@%   STACKSIZE 5120
  1398. %@AS@%   
  1399. %@AS@%   EXPORTS
  1400. %@AS@%    MainWndProc @1      SampleDlgProc @2%@AE@%
  1401.  
  1402. This is an example of a module-definition file for an application named
  1403. "Sample".  %@NL@%
  1404.  
  1405. "
  1406.  
  1407. The %@AB@%NAME%@AE@% statement defines the application's module name as "Sample". %@NL@%
  1408.  
  1409.  
  1410.  
  1411. The required statement %@AB@%EXETYPE WINDOWS%@AE@% ensures that %@AB@%LINK%@AE@% gives the
  1412. application a Windows-format header. %@NL@%
  1413.  
  1414.  
  1415.  
  1416. The %@AB@%DATA MULTIPLE%@AE@% statement tells %@AB@%LINK%@AE@% that this module has multiple data
  1417. segments (one for each instance of the application). For most Windows
  1418. applications, the data segment should be defined as %@AB@%MULTIPLE%@AE@%, since most
  1419. Windows applications can be invoked more than once. %@NL@%
  1420.  
  1421.  
  1422.  
  1423. The %@AB@%CODE MOVEABLE DISCARDABLE%@AE@% and previous %@AB@%DATA MULTIPLE MOVEABLE%@AE@% statements
  1424. tell %@AB@%LINK%@AE@% that both the data and code segments are moveable and that the
  1425. code segment is discardable. It's a good idea to use moveable and
  1426. discardable code segments and moveable data segments, since they allow
  1427. Windows to take best advantage of memory. %@NL@%
  1428.  
  1429.  
  1430.  
  1431. The heap and stack sizes are the recommended 5120 bytes. Heap space is
  1432. required if the application uses its local heap. It's a good idea for
  1433. applications to have at least 5120 bytes of stack space. %@NL@%
  1434.  
  1435.  
  1436.  
  1437. The %@AB@%EXPORTS%@AE@% statement lists the callback functions in the application: the
  1438. main window function, named "MainWndProc", and a dialog function,
  1439. "SampleDlgProc".%@CR:C6A00020060 @%%@NL@%
  1440.  
  1441.  
  1442. %@3@%%@CR:C6A00020061 @%%@AB@%2.1.2  Creating Module Definitions for Libraries%@AE@%%@EH@%%@NL@%
  1443.  
  1444. A module-definition file for a dynamic-link library must contain the
  1445. following statements:%@CR:C6A00020062 @%%@CR:C6A00020063 @%%@CR:C6A00020064 @%%@CR:C6A00020065 @%%@CR:C6A00020066 @%%@CR:C6A00020067 @%%@NL@%
  1446.  
  1447.  
  1448.   ■   A %@AB@%LIBRARY%@AE@% statement that defines the library's module name. Windows
  1449.       uses the module name to identify the library.%@CR:C6A00020068 @%%@CR:C6A00020069 @%%@NL@%
  1450.  
  1451.   ■   An %@AB@%EXPORTS%@AE@% statement that lists the functions to be exported by the
  1452.       library; the functions should be exported by ordinals rather than by
  1453.       name, since using ordinals conserves space. Functions in the library
  1454.       are accessible to other applications only if they are listed in the
  1455.       %@AB@%EXPORTS%@AE@% statement.%@CR:C6A00020070 @%%@CR:C6A00020071 @%%@NL@%
  1456.  
  1457.   ■   An %@AB@%EXETYPE WINDOWS%@AE@% statement, which enables the library to run in the
  1458.       Windows environment. This statement tells %@AB@%LINK%@AE@% to use a Windows
  1459.       executable-file header instead of an OS/2 header (the default).%@CR:C6A00020072 @%%@CR:C6A00020073 @%%@NL@%
  1460.  
  1461.  
  1462. In addition to these required statements, .DEF files for libraries can
  1463. include other statements.  %@NL@%
  1464.  
  1465. The following example shows a typical .DEF file for a library:%@CR:C6A00020074 @%%@CR:C6A00020075 @%%@NL@%
  1466.  
  1467. %@AS@%  ; Example Module Definition File
  1468. %@AS@%   "LIBRARY MyUtilities
  1469. %@AS@%   DESCRIPTION 'My Utility Functions'
  1470. %@AS@%   
  1471. %@AS@%   EXETYPE WINDOWS 
  1472. %@AS@%   
  1473. %@AS@%   DATA SINGLE MOVEABLE
  1474. %@AS@%   CODE MOVEABLE DISCARDABLE
  1475. %@AS@%   
  1476. %@AS@%   HEAPSIZE 4096
  1477. %@AS@%   
  1478. %@AS@%   EXPORTS
  1479. %@AS@%    UtilityInit @1
  1480. %@AS@%    UtilityStart @2
  1481. %@AS@%    UtilityEnd @3
  1482. %@AS@%    UtilityLoad @4
  1483. %@AS@%    UtilitySave @5%@AE@%
  1484.  
  1485. This is a sample module-definition file for a Windows dynamic-link library.%@CR:C6A00020076 @%%@NL@%
  1486.  
  1487. "
  1488.  
  1489. The %@AB@%LIBRARY%@AE@% statement defines the library's module name as MyUtilities. %@NL@%
  1490.  
  1491.  
  1492.  
  1493. The required statement %@AB@%EXETYPE WINDOWS%@AE@% ensures that %@AB@%LINK%@AE@% gives the library a
  1494. Windows-format header.%@NL@%
  1495.  
  1496.  
  1497.  
  1498. The statement %@AB@%DATA SINGLE MOVEABLE%@AE@% tells %@AB@%LINK%@AE@% that this library module has a
  1499. single data segment. Unlike an application, of which several copies can be
  1500. running at a time, Windows allows only one instance of a library at a time.%@NL@%
  1501.  
  1502.  
  1503.  
  1504. The heap size is 4096 bytes. Because libraries never have stacks, the
  1505. library's .DEF file contains no %@AB@%STACK%@AE@% statement; libraries use the stack of
  1506. the calling application. %@NL@%
  1507.  
  1508.  
  1509.  
  1510. The required statement %@AB@%EXPORTS%@AE@% lists the library's exported functions by
  1511. name and ordinal number. An application can then call these functions if the
  1512. functions' names or ordinals are listed in the %@AB@%IMPORTS%@AE@% statement of the
  1513. application's .DEF file.%@CR:C6A00020077 @%%@CR:C6A00020078 @%%@CR:C6A00020079 @% %@CR:C6A00020080 @%%@CR:C6A00020081 @%%@CR:C6A00020082 @%%@CR:C6A00020083 @%%@CR:C6A00020084 @%%@NL@%
  1514.  
  1515.  
  1516. %@2@%%@CR:C6A00020085 @%%@AB@%2.2  Importing Dynamic-Link Libraries%@AE@%%@EH@%%@NL@%
  1517.  
  1518. When you link an application that makes function calls to a dynamic-link
  1519. library (DLL), you must identify the imported functions using one of the
  1520. following methods:%@CR:C6A00020086 @%%@NL@%
  1521.  
  1522.  
  1523.   ■   Use the %@AB@%IMPORTS%@AE@% statement in the application's module-definition file.
  1524.       Section 2.1.2, "Creating Module Definitions for Libraries," describes
  1525.       this method.%@NL@%
  1526.  
  1527.   ■   Use the %@AB@%IMPLIB%@AE@% utility to create a library of imported functions and
  1528.       specify the library in the %@AB@%LINK%@AE@% command line, as described in this
  1529.       section.%@NL@%
  1530.  
  1531.  
  1532. You can create import libraries by using the %@AB@%IMPLIB%@AE@% utility. %@AB@%IMPLIB%@AE@% reads
  1533. the exports for a library, as listed in its definition file, and creates an
  1534. import library. You can link the library into an application.%@CR:C6A00020087 @%%@CR:C6A00020088 @%%@CR:C6A00020089 @%%@CR:C6A00020090 @%%@CR:C6A00020091 @%%@NL@%
  1535.  
  1536. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1537. NOTE
  1538.  
  1539. %@AI@%%@AB@%IMPLIB%@AE@%%@AI@% does not come on the SDK disks. It is shipped with the Microsoft C
  1540. %@AI@%Compiler. If you did not request %@AE@%%@AI@%%@AB@%IMPLIB%@AE@%%@AE@%%@AI@% to be copied when you installed the
  1541. %@AI@%C Compiler, you may want to copy it from the C Compiler disks.%@AE@%%@AE@%
  1542. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1543.  
  1544. You start %@AB@%IMPLIB%@AE@% by using the %@AB@%IMPLIB%@AE@% command.  %@NL@%
  1545.  
  1546.  
  1547. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1548.  
  1549. %@AS@%  IMPLIB imp-lib-name mod-def-file%@AE@%
  1550.  
  1551. The %@AI@%imp-lib-name%@AE@% parameter specifies the name you want the new import
  1552. library to have.  %@NL@%
  1553.  
  1554. The %@AI@%mod-def-file%@AE@% parameter specifies the name of the module-definition
  1555. (.DEF) file for the dynamic-link library. For %@AB@%IMPLIB%@AE@% version 1.1 and later,
  1556. distributed with Microsoft C version 6.0 and later, you can provide %@AB@%IMPLIB%@AE@%
  1557. the name of the DLL itself instead of the DLL's module-definition file.  %@NL@%
  1558.  
  1559. The following command creates the import library named MYLIB.LIB from the
  1560. module-definition file MYLIB.DEF:  %@NL@%
  1561.  
  1562. %@AS@%  IMPLIB MYLIB.LIB MYLIB.DEF%@AE@%
  1563.  
  1564. To link the library, specify it in the %@AB@%LINK%@AE@% command line, as in the
  1565. following example:  %@NL@%
  1566.  
  1567. %@AS@%  LINK SAMPLE, SAMPLE.EXE, , /NOD SLIBCEW LIBW MYLIB, SAMPLE.DEF%@AE@%
  1568.  
  1569. The example links the import library MYLIB.LIB.  %@NL@%
  1570.  
  1571. For more information on specifying libraries, see Section 2.3.3, "Specifying
  1572. Libraries on the LINK Command Line."%@CR:C6A00020092 @%%@NL@%
  1573.  
  1574.  
  1575. %@2@%%@CR:C6A00020093 @%%@AB@%2.3  Linking an Application%@AE@%%@EH@%%@NL@%
  1576.  
  1577. You can link object (.OBJ) files from compiled application source files,
  1578. libraries, and module-definition files into an executable file using the
  1579. linker. The %@AB@%LINK%@AE@% program comes with Microsoft C version 5.1; it is not
  1580. included in the SDK.  %@NL@%
  1581.  
  1582. %@AB@%LINK%@AE@% combines the code and data of all application files with the
  1583. appropriate code for any Windows functions that the application calls, and
  1584. creates a new executable file or DLL.%@CR:C6A00020094 @%%@CR:C6A00020095 @%%@NL@%
  1585.  
  1586.  
  1587. %@3@%%@CR:C6A00020096 @%%@AB@%2.3.1  Using the LINK Command%@CR:C6A00020097 @%%@AE@%%@EH@%%@NL@%
  1588.  
  1589. To start the linker, you use the %@AB@%LINK%@AE@% command. You can type this command on
  1590. the DOS command line, or you can enter it in a batch file or a make file.  %@NL@%
  1591.  
  1592.  
  1593. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1594.  
  1595. %@AS@%  LINK «options» object-files,«exe-file»,«map-file», «lib-files»,def-file%@AE@%
  1596.  
  1597. The %@AI@%options%@AE@% parameter specifies one or more key words (described in Section
  1598. 2.3.2, "Specifying LINK Command Options") that tell %@AB@%LINK%@AE@% to carry out
  1599. special operations.  %@NL@%
  1600.  
  1601. The %@AI@%object-files%@AE@% parameter specifies the filenames of one or more compiled
  1602. application source files. If your application has more than one compiled
  1603. source file, you must name all of them on the %@AB@%LINK%@AE@% command line. Separate
  1604. the filenames of object files by spaces or the plus sign (+).%@CR:C6A00020098 @%%@CR:C6A00020099 @%%@NL@%
  1605.  
  1606. The %@AI@%exe-file%@AE@% parameter specifies the name you want %@AB@%LINK%@AE@% to give to the
  1607. resulting executable file or dynamic-link library.  %@NL@%
  1608.  
  1609. The %@AI@%map-file%@AE@% parameter specifies the name you want the map file to have. (A
  1610. map file is used for symbolic debugging with %@AB@%SYMDEB%@AE@% or %@AB@%WDEB386%@AE@%.)%@CR:C6A00020100 @%%@NL@%
  1611.  
  1612. The %@AI@%lib-files%@AE@% parameter specifies the names of Windows or standard-language
  1613. libraries.  %@NL@%
  1614.  
  1615. The %@AI@%def-file%@AE@% parameter specifies the filename of the module-definition
  1616. (.DEF) file. Each application can have only one .DEF file.%@CR:C6A00020101 @%%@NL@%
  1617.  
  1618. Use commas to separate parameters in the command line.%@CR:C6A00020102 @%%@CR:C6A00020103 @%%@NL@%
  1619.  
  1620. The following example command line links the application object file
  1621. SAMPLE.OBJ with the standard Windows library LIBW.LIB:  %@NL@%
  1622.  
  1623. %@AS@%  LINK SAMPLE.OBJ/al:16, SAMPLE.EXE, SAMPLE.MAP/map/li, /NOD SLIBCEW.LIB
  1624. %@AS@%LIBW.LIB, SAMPLE.DEF%@AE@%
  1625.  
  1626. The command line creates the file SAMPLE.EXE, which has the module name,
  1627. segments, and exported functions defined by the module-definition file
  1628. SAMPLE.DEF. It also creates the map file SAMPLE.MAP, used for symbolic
  1629. debugging. The command searches the library file LIBW.LIB to resolve any
  1630. external function calls made in the application files. It also searches for
  1631. the Windows version of the small model emulated math C run-time library.  %@NL@%
  1632.  
  1633. The %@AB@%LINK %@AE@%program uses default filename extensions if you do not provide
  1634. extensions. For example, the preceding example would have the same results
  1635. if typed as follows:  %@NL@%
  1636.  
  1637. %@AS@%  LINK SAMPLE/al:16, SAMPLE, SAMPLE/map/li, /NOD SLIBCEW LIBW, SAMPLE%@AE@%
  1638.  
  1639.  
  1640. %@3@%%@CR:C6A00020104 @%%@AB@%2.3.2  Specifying LINK Command Options%@AE@%%@EH@%%@NL@%
  1641.  
  1642. You can use the %@AB@%LINK%@AE@% %@AI@%options%@AE@% parameter to tell the linker to perform special
  1643. operations. The %@AB@%LINK%@AE@% options are:%@CR:C6A00020105 @%%@CR:C6A00020106 @%%@NL@%
  1644.  
  1645. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1646. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1647. %@AB@%/alignment:%@AE@%%@AI@%size%@AE@%                   Tells the linker to align segment data 
  1648.                                   in the executable file along the 
  1649.                                   boundaries specified by %@AI@%size%@AE@%. 
  1650.  
  1651.                                   The %@AI@%size%@AE@% parameter specifies a boundary 
  1652.                                   size in bytes; for example, the 
  1653.                                   following indicates an alignment 
  1654.                                   boundary of 16 bytes:
  1655.  
  1656.                                   %@AS@%/alignment:16%@AE@%
  1657.  
  1658.                                   The %@AI@%size%@AE@% parameter must be a power of 2;
  1659.                                   therefore, 2, 4, 8, 16, and so on are 
  1660.                                   appropriate values. The default is 512 
  1661.                                   bytes. 
  1662.  
  1663.                                   It is strongly recommended that you link
  1664.                                   your application with the alignment set 
  1665.                                   to 16 or less (or 32 if the application 
  1666.                                   is larger than 1 megabyte). The default 
  1667.                                   512-byte alignment wastes a large amount
  1668.                                   of disk space, especially for larger 
  1669.                                   applications using many segments and 
  1670.                                   resources.
  1671.  
  1672.                                   The minimum abbreviation for this option
  1673.                                   is %@AB@%/al%@AE@%. 
  1674.  
  1675. %@AB@%/codeview%@AE@%                         Tells the linker to prepare for 
  1676.                                   debugging using CodeView for Windows (%@AB@%%@AE@%
  1677.                                   %@AB@%CVW%@AE@%).
  1678.  
  1679.                                   The minimum abbreviation for this option
  1680.                                   is %@AB@%/co%@AE@%.
  1681.  
  1682. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1683. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1684. %@AB@%/help%@AE@%                             Tells the linker to display a list of 
  1685.                                   available options. 
  1686.  
  1687.                                   The minimum abbreviation for this option
  1688.                                   is /%@AB@%h%@AE@%. 
  1689.  
  1690. %@AB@%/linenumbers%@AE@%                      Tells the linker to copy line-number 
  1691.                                   information from the object file to the 
  1692.                                   map file. Use this option to prepare for
  1693.                                   source line debugging with the Symbolic 
  1694.                                   Debugger (%@AB@%SYMDEB%@AE@%). 
  1695.  
  1696.                                   The minimum abbreviation for this option
  1697.                                   is %@AB@%/li%@AE@%. %@CR:C6A00020107 @% %@CR:C6A00020108 @%
  1698.  
  1699. %@AB@%/map%@AE@%                              Tells the linker to create a .MAP file, 
  1700.                                   which the %@AB@%MAPSYM%@AE@% utility uses to create 
  1701.                                   a .SYM file. The .SYM file is then used 
  1702.                                   by the Symbolic Debugger.
  1703.  
  1704. %@AB@%/nodefaultlibrarysearch%@AE@%           Prevents the linker from using the 
  1705.                                   default C run-time libraries. This 
  1706.                                   option is recommended if you use the %@AB@%%@AE@%
  1707.                                   %@AB@%?LIBC?W.LIB%@AE@% naming of the C runtime 
  1708.                                   libraries instead of %@AB@%?LIBC?.LIB%@AE@%.
  1709.  
  1710.                                   The minimum abbreviation for this option
  1711.                                   is %@AB@% /nod.%@AE@%
  1712.  
  1713. %@AB@%/noextendeddictionarysearch%@AE@%       Prevents the linker from searching a 
  1714.                                   library's extended dictionary, which is 
  1715.                                   a list of symbols stored in the library.
  1716.                                   The linker normally consults this list 
  1717.                                   to speed up library searches. Normally 
  1718.                                   this option is not needed. The linker 
  1719.                                   issues an error message if you need to 
  1720.                                   use this switch.
  1721.  
  1722.                                   The minimum abbreviation for this option
  1723.                                   is %@AB@%/noe.%@AE@%
  1724.  
  1725. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1726. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1727. %@AB@%/nofarcalltrans%@AE@%                   This option prevents the translation of 
  1728.                                   far calls within the current segment. 
  1729.                                   Without this option, far calls are 
  1730.                                   translated into the assembler 
  1731.                                   statements:
  1732.  
  1733.                                   %@AS@%.%@AE@%
  1734.                                   %@AS@%.%@AE@%
  1735.                                   %@AS@%.%@AE@%
  1736.                                   %@AS@%NOP%@AE@%
  1737.                                   %@AS@%PUSH CS%@AE@%
  1738.                                   %@AS@%NEAR CALL%@AE@%
  1739.                                   %@AS@%.%@AE@%
  1740.                                   %@AS@%.%@AE@%
  1741.                                   %@AS@%.%@AE@%
  1742.  
  1743.                                   The minimum abbreviation for this option
  1744.                                   is %@AB@%/nof%@AE@%. %@CR:C6A00020109 @%%@CR:C6A00020110 @%
  1745.  
  1746. %@AB@%/noignorecase%@AE@%                     Tells the linker to preserve lowercase 
  1747.                                   letters when matching symbols during 
  1748.                                   linking. 
  1749.  
  1750.                                   The minimum abbreviation for this option
  1751.                                   is %@AB@%/noi%@AE@%.
  1752.  
  1753. %@AB@%/pause%@AE@%                            Tells the linker to pause before copying
  1754.                                   the executable file to disk. 
  1755.  
  1756.                                   The minimum abbreviation for this option
  1757.                                   is %@AB@%/pau%@AE@%. 
  1758.  
  1759. %@AB@%/segments:%@AE@%%@AI@%number%@AE@%                  Sets the maximum number of segments the 
  1760.                                   linker will process to %@AI@%number%@AE@%. For 
  1761.                                   example, the following would tell the 
  1762.                                   linker to process no more than 200 
  1763.                                   segments:
  1764.  
  1765.                                   %@AS@%/segments:200%@AE@%
  1766.  
  1767.                                   The default is 128 segments. Windows 
  1768.                                   limits an application to 254 segments.
  1769.  
  1770.                                   The minimum abbreviation for this option
  1771.                                   is %@AB@%/se%@AE@%. %@CR:C6A00020111 @%%@CR:C6A00020112 @%
  1772.  
  1773. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1774. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1775. %@AB@%/warnfixup%@AE@%                        Causes the linker to display an error 
  1776.                                   message when an offset fixup occurs 
  1777.                                   (relative to a logical segment) outside 
  1778.                                   the physical segment. 
  1779.  
  1780.                                   The minimum abbreviation for this option
  1781.                                   is %@AB@%/w%@AE@%. 
  1782.  
  1783. The following %@AB@%LINK%@AE@% options are not allowed when linking Windows
  1784. applications:%@CR:C6A00020113 @%%@CR:C6A00020114 @%%@CR:C6A00020115 @%%@NL@%
  1785.  
  1786.  %@AB@%/dsallocate%@AE@%  %@AB@%/exepack%@AE@%  %@AB@%/high%@AE@%  %@AB@%/overlayinterrupt%@AE@%  %@NL@%
  1787.  
  1788. The following %@AB@%LINK%@AE@% options are not recommended when linking Windows
  1789. applications:%@CR:C6A00020116 @%%@NL@%
  1790.  
  1791.  %@AB@%/nogroupassociation%@AE@%  %@AB@%/packcode%@AE@%  %@AB@%/stack%@AE@%  %@NL@%
  1792.  
  1793. Instead of using the %@AB@%LINK%@AE@% option %@AB@%/stack%@AE@%, set the stack size in the
  1794. application's .DEF file.  %@NL@%
  1795.  
  1796. For more information on %@AB@%LINK%@AE@% command-line options, see the %@AI@%Microsoft C
  1797. %@AI@%Optimizing Compiler User's Guide%@AE@%.  %@NL@%
  1798.  
  1799.  
  1800. %@3@%%@CR:C6A00020117 @%%@AB@%2.3.3  Specifying Libraries on the LINK Command Line%@AE@%%@EH@%%@NL@%
  1801.  
  1802. When you link an application's object files, you must specify the
  1803. appropriate C-language libraries for Windows and C run-time libraries. The
  1804. C-language  libraries for Windows contain code for the Windows application
  1805. start-up routines and references for the Windows functions.%@CR:C6A00020118 @%%@CR:C6A00020119 @%%@CR:C6A00020120 @%%@NL@%
  1806.  
  1807. There are corresponding C-language libraries you will use when linking
  1808. dynamic-link libraries. Table 2.1 shows which Windows library to use,
  1809. depending on the memory model and whether you are linking an application or
  1810. a library.%@CR:C6A00020121 @%%@NL@%
  1811.  
  1812. Table 2.1  Linking with a Windows C-Language Library
  1813.  
  1814. %@TH:  16  1093 02 25 20 31 @%
  1815. Memory Model             For an Application  For a DLL
  1816. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1817. %@AB@%Emulated Math Package%@AE@%    
  1818. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1819. Small                    SLIBCEW.LIB         SDLLCEW.LIB
  1820. Medium                   MLIBCEW.LIB         MDLLCEW.LIB
  1821. Compact                  CLIBCEW.LIB         CDLLCEW.LIB
  1822. Large                    LLIBCEW.LIB         LDLLCEW.LIB
  1823. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1824. %@AB@%Alternate Math Package%@AE@%   
  1825. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1826. Small                    SLIBCAW.LIB         SDLLCAW.LIB
  1827. Medium                   MLIBCAW.LIB         MDLLCAW.LIB
  1828. Compact                  CLIBCAW.LIB         CDLLCAW.LIB
  1829. Large                    LLIBCAW.LIB         LDLLCAW.LIB
  1830. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1831. %@TE:  16  1093 02 25 20 31 @%
  1832.  
  1833. Which C-language libraries you link with depends on your application's
  1834. programming model and whether or not the model uses floating-point support.%@CR:C6A00020122 @%%@NL@%
  1835.  
  1836. In addition to these libraries, you must also link with the
  1837. model-independent Windows import library, LIBW.LIB.  %@NL@%
  1838.  
  1839. Use the %@AB@%/nod%@AE@% option to ensure that the linker will not try to find objects
  1840. in your non-Windows versions of the C run-time libraries.  %@NL@%
  1841.  
  1842. For example, a small-model application using the emulator math package must
  1843. be linked with the small-model library SLIBCEW.LIB and LIBW.LIB, as shown in
  1844. the following example:  %@NL@%
  1845.  
  1846. %@AS@%  LINK SAMPLE,,/NOD SLIBCEW LIBW, SAMPLE.DEF%@AE@%
  1847.  
  1848. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1849. NOTE
  1850.  
  1851. %@AI@%You should link your program with the SLIBCEW.LIB or MLIBCEW.LIB library if
  1852. %@AI@%you chose the coprocessor/emulator option by specifying %@AB@%-FPi%@AE@%%@AI@% on the compiler
  1853. %@AI@%command line. For your Windows application to use the math
  1854. %@AI@%coprocessor/emulator, you must include WIN87EM.LIB on your %@AE@%%@AI@%%@AB@%LINK%@AE@%%@AE@%%@AI@% command
  1855. %@AI@%line. This library contains import information for the WIN87EM.DLL library
  1856. %@AI@%supplied with the retail version of Windows. %@CR:C6A00020123 @%%@AE@%%@AE@%
  1857.  
  1858. %@AI@%You should link your program with the SLIBCAW.LIB or MLIBCAW.LIB library if
  1859. %@AI@%you chose the alternative math option by specifying %@AB@%-FPa%@AE@%%@AI@% on the compiler
  1860. %@AI@%command line. Ensure that these libraries are available.%@AE@%%@AE@%
  1861. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1862.  
  1863.  
  1864. %@2@%%@CR:C6A00020124 @%%@AB@%2.4  Examining Executable File Headers%@AE@%%@EH@%%@NL@%
  1865.  
  1866. You can use the %@AB@%EXEHDR%@AE@% utility to determine whether an executable file is a
  1867. Windows application or a library. The command also lets you find out which
  1868. functions are exported or imported by a module, determine the amount of
  1869. space allocated for a module's heap or stack, and determine the size and
  1870. number of the segments a module contains.%@CR:C6A00020125 @%%@CR:C6A00020126 @%%@CR:C6A00020127 @%%@CR:C6A00020128 @%%@CR:C6A00020129 @%%@NL@%
  1871.  
  1872.  
  1873. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1874.  
  1875. %@AS@%  EXEHDR exe-filename%@AE@%
  1876.  
  1877. The %@AI@%exe-filename%@AE@% parameter specifies the name of any file with an .EXE
  1878. extension.  %@NL@%
  1879.  
  1880. The following example displays the header for the executable file HELLO.EXE:
  1881. %@NL@%
  1882.  
  1883. %@AS@%  EXEHDR HELLO.EXE%@AE@%
  1884.  
  1885. The format of this header is closely related to the statements contained in
  1886. the application's module-definition file.  %@NL@%
  1887.  
  1888. For more information about %@AB@%EXEHDR%@AE@%, see the Microsoft C Optimizing  Compiler
  1889. documentation.  %@NL@%
  1890.  
  1891.  
  1892. %@2@%%@CR:C6A00020130 @%%@AB@%2.5  Summary%@AE@%%@EH@%%@NL@%
  1893.  
  1894. %@AB@%LINK%@AE@% is a tool that takes compiled sources, a list of libraries, and a
  1895. moduledefinition file, and creates a file that you can load and run with
  1896. Windows. For additional information see the following:  %@NL@%
  1897.  
  1898. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  1899. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1900. Windows versions of C run-time    %@AI@%Guide to Programming%@AE@%: Chapter 14, "C 
  1901. libraries                         and
  1902.                                   Assembly Language"
  1903.  
  1904. Module-definition statements      %@AI@%Reference, Volume 2%@AE@%: Chapter 10, 
  1905.                                   "ModuleDefinition Statements"
  1906.  
  1907.  
  1908.  
  1909.  
  1910.  
  1911.  
  1912. %@CR:C6A00030001 @%%@1@%%@AB@%Chapter 3  Compiling Resources: The Resource Compiler%@AE@%%@EH@%%@NL@%
  1913. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1914.  
  1915. Microsoft Windows Resource Compiler (%@AB@%RC%@AE@%) is a tool that lets you compile
  1916. resources, such as icons, cursors, menus, and dialog boxes, that your
  1917. application uses. You add the resulting binary resource file to your
  1918. application's binary file to produce an executable Windows application.  %@NL@%
  1919.  
  1920. This chapter describes how to do the following:  %@NL@%
  1921.  
  1922.  
  1923.   ■   Include resources in your application%@NL@%
  1924.  
  1925.   ■   Create a resource script file, which describes the resources your
  1926.       application will use%@NL@%
  1927.  
  1928.   ■   Use the Resource Compiler to compile your application's resources and
  1929.       add them to the application's executable file%@CR:C6A00030002 @%%@CR:C6A00030003 @%%@CR:C6A00030004 @%%@CR:C6A00030005 @%%@CR:C6A00030006 @%%@NL@%
  1930.  
  1931.  
  1932.  
  1933. %@2@%%@CR:C6A00030007 @%%@AB@%3.1  Including Resources in an Application%@AE@%%@EH@%%@NL@%
  1934.  
  1935. To include resources in your Windows application, follow these steps:  %@NL@%
  1936.  
  1937.  
  1938.   1.  Create individual resource files for cursors, icons, bitmaps, dialogs,
  1939.       and fonts, using the appropriate resource editors. %@NL@%
  1940.  
  1941. %@STUB@%      Part 2 of this manual, "Resource Editors," explains how to use these
  1942.       editors. %@NL@%
  1943.  
  1944.   2.  Create a resource script (.RC) file that defines each application
  1945.       resource by specifying its name and description. %@NL@%
  1946.  
  1947. %@STUB@%      If the resource is in a separate file, this description includes the
  1948.       resource's filename.%@NL@%
  1949.  
  1950. %@STUB@%      For example, the .RC file might define a cursor resource by naming it
  1951.       "SampleCursor," describing it as a resource of type "Cursor," and
  1952.       defining it as the cursor contained in the file SAMPLE.CUR. %@NL@%
  1953.  
  1954.   3.  Compile the resource script file using the Resource Compiler. %@NL@%
  1955.  
  1956. %@STUB@%      The result will be a compiled resource file with the filename
  1957.       extension .RES. %@NL@%
  1958.  
  1959.   4.  Add the compiled resources to the application's compiled executable
  1960.       (.EXE) file using the Resource Compiler. %@NL@%
  1961.  
  1962. %@STUB@%      If you want, you can perform this step and the preceding step with a
  1963.       single %@AB@%RC%@AE@% command.%@NL@%
  1964.  
  1965.  
  1966.  
  1967. %@2@%%@CR:C6A00030008 @%%@AB@%3.2  Creating a Resource Script File%@AE@%%@EH@%%@NL@%
  1968.  
  1969. After creating individual resource files for your application's icon,
  1970. cursor, bitmap, font, and dialog resources, you create a resource script
  1971. file. The resource script file always has the .RC extension, and is often
  1972. referred to simply as the .RC file.%@CR:C6A00030009 @%%@NL@%
  1973.  
  1974. The .RC file lists every resource in your application, and describes some
  1975. types of resources in great detail:  %@NL@%
  1976.  
  1977.  
  1978.   ■   For resources that exist in a separate file, such as icons and
  1979.       cursors, the .RC file simply names the resource and the file that
  1980.       contains it.%@NL@%
  1981.  
  1982.   ■   For some types of resources, such as menus, the entire definition of
  1983.       the resource exists within the .RC file.%@NL@%
  1984.  
  1985.  
  1986. You create a resource script file using an ordinary ASCII text editor. The
  1987. file can contain resource statements and directives.%@CR:C6A00030010 @%%@NL@%
  1988.  
  1989. Resource statements name and describe each resource.  %@NL@%
  1990.  
  1991. Directives are a special type of statement that defines an action you want
  1992. the Resource Compiler to perform on the resource script file before actually
  1993. compiling it. You can use directives to assign values to names, include the
  1994. contents of files, and control compilation of the script file. The
  1995. directives you use in a resource script file are identical to the C-language
  1996. directives.%@CR:C6A00030011 @%%@CR:C6A00030012 @%%@CR:C6A00030013 @%%@CR:C6A00030014 @%%@CR:C6A00030015 @%%@CR:C6A00030016 @%%@NL@%
  1997.  
  1998. A line in an .RC file cannot exceed 256 characters.  %@NL@%
  1999.  
  2000. Table 3.1 lists and briefly describes the statements and directives you can
  2001. use in a resource script file. (See the %@AI@%Reference%@AE@%, %@AI@%Volume 2%@AE@%, for detailed
  2002. descriptions and syntax.)%@CR:C6A00030017 @%%@CR:C6A00030018 @%%@CR:C6A00030019 @%%@CR:C6A00030020 @%%@CR:C6A00030021 @%%@CR:C6A00030022 @%%@NL@%
  2003.  
  2004. Table 3.1  Resource Statements
  2005.  
  2006. %@TH:   7   469 02 24 11 41 @%
  2007. Type of Statement       Statement  Description 
  2008. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2009. Single-line statements  %@AB@%BITMAP%@AE@%     Defines a bitmap by naming it and 
  2010.                                    specifying the file that contains it. 
  2011.                                    (To use a particular bitmap, the 
  2012.                                    application requests it by name.)
  2013.  
  2014. %@TE:   7   469 02 24 11 41 @%
  2015.  
  2016. Table 3.1  Resource Statements (continued)
  2017.  
  2018. %@TH:  82  4609 02 30 15 31 @%
  2019. Type of Statement             Statement      Description 
  2020. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2021.                               %@AB@%CURSOR%@AE@%         Defines a cursor by naming it
  2022.                                              and specifying the file that 
  2023.                                              contains it. (To use a 
  2024.                                              particular cursor, the 
  2025.                                              application requests it by 
  2026.                                              name.)
  2027.  
  2028.                               %@AB@%FONT%@AE@%           Specifies a file that 
  2029.                                              contains a font.
  2030.  
  2031.                               %@AB@%ICON%@AE@%           Defines an icon by naming it 
  2032.                                              and specifying the file that 
  2033.                                              contains it. (To use a 
  2034.                                              particular icon, the 
  2035.                                              application requests it by 
  2036.                                              name.)
  2037.  
  2038. Multiple-line statements      %@AB@%ACCELERATORS%@AE@%   Defines menu accelerator 
  2039.                                              keys.
  2040.  
  2041.                               %@AB@%DIALOG%@AE@%         Defines a template that an 
  2042.                                              application can use to create
  2043.                                              dialog boxes.
  2044.  
  2045.                               %@AB@%MENU%@AE@%           Defines the appearance and 
  2046.                                              function of an application 
  2047.                                              menu. 
  2048.  
  2049.                               %@AB@%RCDATA%@AE@%         Defines raw data resources. 
  2050.                                              Raw data resources let you 
  2051.                                              include binary data directly 
  2052.                                              into the executable file.
  2053.  
  2054.                               %@AB@%STRINGTABLE%@AE@%    Defines string resources. 
  2055.                                              String resources are null-
  2056.                                              terminated ASCII strings that
  2057.                                              can be loaded from the 
  2058.                                              executable file.
  2059.  
  2060. Directives                    %@AB@%#define%@AE@%        Defines a specified name by 
  2061.                                              assigning it a given value.
  2062.  
  2063.                               %@AB@%#elif%@AE@%          Marks an optional clause of a
  2064.                                              conditional compilation 
  2065.                                              block.
  2066.  
  2067.                               %@AB@%#else%@AE@%          Marks an optional clause of a
  2068.                                              conditional compilation 
  2069.                                              block.
  2070.  
  2071.                               %@AB@%#endif%@AE@%         Marks the end of a 
  2072.                                              conditional compilation 
  2073.                                              block.
  2074.  
  2075.                               %@AB@%#if%@AE@%            Carries out conditional 
  2076.                                              compilation if a specified 
  2077.                                              expression is true.
  2078.  
  2079.                               %@AB@%#ifdef%@AE@%         Carries out conditional 
  2080.                                              compilation if a specified 
  2081.                                              name has been defined.
  2082.  
  2083.                               %@AB@%#ifndef%@AE@%        Carries out conditional 
  2084.                                              compilation if a specified 
  2085.                                              name is not defined.
  2086.  
  2087.                               %@AB@%#include%@AE@%       Copies the contents of a file
  2088.                                              into the resource script 
  2089.                                              before the Resource Compiler 
  2090.                                              processes the script. 
  2091.  
  2092.                               %@AB@%#undef%@AE@%         Removes the current 
  2093.                                              definition of the specified 
  2094.                                              name.
  2095.  
  2096. User-defined resources        User-supplied  Any data that needs to be 
  2097.                                              added to the executable file.
  2098.  
  2099. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2100.  
  2101. %@TE:  82  4609 02 30 15 31 @%
  2102.  
  2103. For a detailed description of the statements in a resource script file, see
  2104. the %@AI@%Reference%@AE@%, %@AI@%Volume 2.%@AE@%  %@NL@%
  2105.  
  2106. For example, the following script file defines the resources for an
  2107. application called "Shapes":  %@NL@%
  2108.  
  2109. %@AS@%  "#include "SHAPES.H"
  2110. %@AS@%  ShapesCursor  CURSOR  SHAPES.CUR
  2111. %@AS@%  ShapesIcon  ICON  SHAPES.ICO
  2112. %@AS@%  ShapesMenu  MENU
  2113. %@AS@%  BEGIN
  2114. %@AS@%      POPUP "&Shape"
  2115. %@AS@%          BEGIN
  2116. %@AS@%              MENUITEM "&Clear", ID_CLEAR
  2117. %@AS@%              MENUITEM "&Rectangle", ID_RECT
  2118. %@AS@%              MENUITEM "&Triangle", ID_TRIANGLE
  2119. %@AS@%              MENUITEM "&Star", ID_STAR
  2120. %@AS@%              MENUITEM "&Ellipse", ID_ELLIPSE
  2121. %@AS@%          END
  2122. %@AS@%  END%@AE@%
  2123.  
  2124. "
  2125.  
  2126. The file uses the %@AB@%#include%@AE@% directive to include the contents of the header
  2127. file SHAPES.H. %@NL@%
  2128.  
  2129.  
  2130.  
  2131. The %@AB@%CURSOR%@AE@% statement names the application's cursor resource "ShapesCursor"
  2132. and specifies the cursor file SHAPES.CUR, which contains the image for that
  2133. cursor. %@NL@%
  2134.  
  2135.  
  2136.  
  2137. It does the same for the application's icon resource, "ShapesIcon", using
  2138. the %@AB@%ICON%@AE@% statement. %@NL@%
  2139.  
  2140.  
  2141.  
  2142. The script file uses the %@AB@%MENU%@AE@% statement to define an application menu named
  2143. "ShapesMenu", a pop-up menu with five menu items. %@NL@%
  2144.  
  2145.  
  2146.  
  2147. The menu definition, enclosed in the %@AB@%BEGIN%@AE@% and %@AB@%END%@AE@% key words, specifies each
  2148. menu item and the menu ID code that is returned when the user selects that
  2149. item. For example, the first item on the menu, "Clear", returns the menu ID
  2150. code "ID_CLEAR" when the user selects it. The ID values are defined in the
  2151. application header file, SHAPES.H.%@CR:C6A00030023 @%%@NL@%
  2152.  
  2153. For more information on the resource script file, the syntax of the resource
  2154. statements, and how to create user-defined resources, see the %@AI@%Reference,
  2155. %@AI@%Volume 2%@AE@%.  %@NL@%
  2156.  
  2157.  
  2158. %@2@%%@CR:C6A00030024 @%%@AB@%3.3  Using the Resource Compiler%@AE@%%@EH@%%@NL@%
  2159.  
  2160. The Resource Compiler serves the following functions:  %@NL@%
  2161.  
  2162.  
  2163.   ■   It compiles the resource script file and the resource files (such as
  2164.       icon and cursor files) into a binary resource (.RES) file.%@NL@%
  2165.  
  2166.   ■   It combines the compiled .RES file with the executable (.EXE) file
  2167.       created by the linker; the result is an executable Windows
  2168.       application. %@CR:C6A00030025 @%%@CR:C6A00030026 @%%@CR:C6A00030027 @%%@NL@%
  2169.  
  2170.   ■   It marks all Windows applications (even if they have no resources)
  2171.       with a Windows version stamp.
  2172. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2173. NOTE
  2174.  
  2175. %@AI@%All Windows applications and libraries must bear a Windows version stamp.
  2176. %@AI@%For this reason, use %@AB@%RC%@AE@%%@AI@% on every Windows application and library you build,
  2177. %@AI@%whether or not it uses any resources.%@CR:C6A00030028 @%%@AE@%%@AE@%
  2178. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2179.  
  2180. %@NL@%
  2181.  
  2182.  
  2183. To start the Resource Compiler, use the %@AB@%RC%@AE@% command. What you specify on the
  2184. command line will depend on whether you are compiling resources, adding
  2185. compiled resources to an executable file, or both.%@CR:C6A00030029 @%%@CR:C6A00030030 @%%@NL@%
  2186.  
  2187.  
  2188. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  2189.  
  2190. %@AB@%RC %@AE@%«%@AI@%options%@AE@%»%@AI@% resource-file %@AE@%«%@AI@%executable-file%@AE@%»  %@NL@%
  2191.  
  2192. There are several ways you can use the %@AB@%RC%@AE@% command:  %@NL@%
  2193.  
  2194.  
  2195.   ■   To compile resources separately, use the %@AB@%RC%@AE@% command in the following
  2196.       form:%@NL@%
  2197.  
  2198. %@STUB@%      %@AB@%RC%@AE@% %@AB@%-R%@AE@% «%@AI@%options%@AE@%» %@AI@%script-file%@AE@%%@NL@%
  2199.  
  2200. %@STUB@%      When you use this form, the Resource Compiler ignores the executable
  2201.       file if you specify one.%@NL@%
  2202.  
  2203.   ■   To compile an .RC file and add the resulting .RES file to the
  2204.       executable file, use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  2205.  
  2206. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%script-file%@AE@% «%@AI@%executable-file%@AE@%»%@NL@%
  2207.  
  2208.   ■   To compile a 3.0 version of a dynamic-link library (DLL) that does not
  2209.       have a .RES file, use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  2210.  
  2211. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%dll-file%@AE@%%@NL@%
  2212.  
  2213. %@STUB@%      When you use this form, the DLL filename must explicitly have an .EXE,
  2214.       .DRV, or .DLL extension.%@NL@%
  2215.  
  2216.   ■   To simply add a compiled resource (.RES) file to an executable file,
  2217.       use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  2218.  
  2219. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%res-file.RES%@AE@% «%@AI@%executable-file%@AE@%»%@NL@%
  2220.  
  2221.  
  2222. The rest of this section explains how to specify each of the %@AB@%RC%@AE@% command's
  2223. parameters.  %@NL@%
  2224.  
  2225.  
  2226. %@4@%%@AB@%Options Parameter%@AE@%%@EH@%%@NL@%
  2227.  
  2228. The %@AB@%RC%@AE@% command's %@AI@%options%@AE@% parameter can include one or more of the following:%@CR:C6A00030031 @%%@CR:C6A00030032 @%%@NL@%
  2229.  
  2230. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%%@CR:C6A00030033 @%
  2231. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2232. %@AB@%-R%@AE@%                                Creates an .RES file from an .RC file. 
  2233.                                   Use this option when you do not want to 
  2234.                                   add the compiled .RES file to the .EXE 
  2235.                                   file. 
  2236.  
  2237. %@AB@%-D%@AE@%                                Defines a symbol for the preprocessor 
  2238.                                   that you can test with the %@AB@%#ifdef%@AE@% 
  2239.                                   directive.%@CR:C6A00030034 @%
  2240.  
  2241. %@AB@%-FO%@AE@%                               Renames the .RES file.%@CR:C6A00030035 @%
  2242.  
  2243. %@AB@%-FE%@AE@%                               Renames the .EXE file.%@CR:C6A00030036 @%
  2244.  
  2245. %@AB@%-I%@AE@%                                Searches the specified directory before 
  2246.                                   searching the directories specified by 
  2247.                                   the INCLUDE environment variable.%@CR:C6A00030037 @%
  2248.  
  2249. %@AB@%-V%@AE@%                                Displays messages that report on the 
  2250.                                   progress of the compiler.
  2251.  
  2252. %@AB@%-X%@AE@%                                Prevents the Resource Compiler from 
  2253.                                   checking the INCLUDE environment 
  2254.                                   variable when searching for include 
  2255.                                   files or resource files. %@CR:C6A00030038 @%
  2256.  
  2257. %@AB@%-L%@AE@% or %@AB@%-LIM32%@AE@%                      Tells Windows that the application uses 
  2258.                                   expanded memory directly, according to 
  2259.                                   the Lotus(R) Intel(R) Microsoft Expanded
  2260.                                   Memory Specification (EMS), version 3.2.%@CR:C6A00030039 @%
  2261.                                   %@CR:C6A00030040 @% 
  2262.  
  2263. %@AB@%Option %@AE@%                           %@AB@%Description%@AE@%
  2264. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2265. %@AB@%-M%@AE@% or %@AB@%-MULTINST%@AE@%                   When Windows is running with the EMS 4.0
  2266.                                   memory configuration, this switch 
  2267.                                   assigns each instance of the application
  2268.                                   task to a distinct EMS bank. (By default,
  2269.                                   all instances of a task share the same 
  2270.                                   EMS bank.)%@CR:C6A00030041 @%
  2271.  
  2272. %@AB@%-E%@AE@%                                For a dynamic-link library, changes the 
  2273.                                   default location of global memory from 
  2274.                                   below the EMS bank line to above the EMS
  2275.                                   bank line. %@CR:C6A00030042 @%
  2276.  
  2277. %@AB@%-P%@AE@%                                Creates a private dynamic-link library 
  2278.                                   (DLL) that is called by only one 
  2279.                                   application. This allows Windows to use 
  2280.                                   memory better, since only one 
  2281.                                   application (or multiple instances of 
  2282.                                   the same application) will be calling 
  2283.                                   into the DLL. For example, in the 
  2284.                                   large-frame EMS memory model, the DLL is
  2285.                                   loaded above the EMS bank line, freeing 
  2286.                                   memory below the bank line.%@CR:C6A00030043 @%
  2287.  
  2288. %@AB@%-K%@AE@%                                Disables the load-optimization feature 
  2289.                                   of the Resource Compiler. If this option
  2290.                                   is not specified, the compiler arranges 
  2291.                                   segments and resources in the executable
  2292.                                   file so that all preloaded information 
  2293.                                   is contiguous. This feature allows 
  2294.                                   Windows to load the application much 
  2295.                                   more quickly.%@CR:C6A00030044 @%
  2296.  
  2297.                                   If you do not specify the %@AB@%-K%@AE@% option, all
  2298.                                   data segments, nondiscardable code 
  2299.                                   segments, and the entry-point code 
  2300.                                   segment will be preloaded, unless any 
  2301.                                   segment and its relocation information 
  2302.                                   exceed 64K. If the %@AB@%PRELOAD%@AE@% attribute is 
  2303.                                   not assigned to these segments in the 
  2304.                                   module-definition (.DEF) file when you 
  2305.                                   link your application, the compiler will
  2306.                                   add the preload attribute and display a 
  2307.                                   warning. Resources and segments will 
  2308.                                   have the same segment alignment. This 
  2309.                                   alignment should be as small as possible
  2310.                                   to prevent the final executable file 
  2311.                                   from growing unnecessarily large. You 
  2312.                                   can set the alignment using the %@AB@%LINK%@AE@% %@AB@%%@AE@%
  2313.                                   %@AB@%/alignment%@AE@% option. See Chapter 2, 
  2314.                                   "Linking Applications: The Linker," for 
  2315.                                   more information.
  2316.  
  2317. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  2318. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2319. %@AB@%-T%@AE@%                                Creates an application that runs only 
  2320.                                   with Windows in protected (standard or 
  2321.                                   386 enhanced) mode. If the user attempts
  2322.                                   to run the application in real mode, 
  2323.                                   Windows will display a message box 
  2324.                                   telling the user that the application 
  2325.                                   cannot run in real mode.
  2326.  
  2327. %@AB@%-? %@AE@%or%@AB@% -H%@AE@%                          Displays a list of the %@AB@%RC%@AE@% command line 
  2328.                                   options. %@CR:C6A00030045 @%%@CR:C6A00030046 @%  
  2329.  
  2330. Options are not case-sensitive; for example,%@AB@% -r%@AE@% and %@AB@%-R%@AE@% are equivalent. You
  2331. can combine single-letter options if they do not require any additional
  2332. parameters. For example, the command:  %@NL@%
  2333.  
  2334. %@AS@%  RC -R -E -V SAMPLE.RC%@AE@%
  2335.  
  2336. is equivalent to the command:  %@NL@%
  2337.  
  2338. %@AS@%  RC -REV SAMPLE.RC%@AE@%
  2339.  
  2340.  
  2341. %@4@%%@AB@%Resource-file Parameter%@AE@%%@EH@%%@NL@%
  2342.  
  2343. The %@AB@%RC%@AE@% command's %@AI@%resource-file%@AE@% parameter specifies the name of the script
  2344. file that contains the names, types, filenames, and descriptions of the
  2345. resources you want to add to the .EXE file. It can also specify the name of
  2346. a compiled .RES file, in which case the Resource Compiler adds the compiled
  2347. resources to the executable file.%@CR:C6A00030047 @%%@NL@%
  2348.  
  2349.  
  2350. %@4@%%@AB@%Executable-file Parameter%@AE@%%@EH@%%@NL@%
  2351.  
  2352. The %@AB@%RC%@AE@% command's %@AI@%executable-file%@AE@% parameter specifies the name of the
  2353. executable file that the resources should be added to. If you do not specify
  2354. an executable file, the Resource Compiler uses the executable file with the
  2355. same name as the script file.  %@NL@%
  2356.  
  2357.  
  2358. %@3@%%@CR:C6A00030048 @%%@AB@%3.3.1  Compiling Resources Separately%@AE@%%@EH@%%@NL@%
  2359.  
  2360. By default, the Resource Compiler adds the compiled resources to the
  2361. specified executable file. Sometimes you might want to first compile the
  2362. resources and then add them to the executable file in separate steps. This
  2363. can be useful because resource files don't tend to change much after initial
  2364. development. You can save time by compiling your application's resources
  2365. separately, then adding the compiled .RES file to your executable file each
  2366. time you recompile the .EXE file.  %@NL@%
  2367.  
  2368. You can use the %@AB@%-R%@AE@% option to compile the resources separately, without
  2369. adding them to the executable file. When you use this option, the Resource
  2370. Compiler compiles the .RC file and creates a compiled resource .RES file.%@CR:C6A00030049 @%%@CR:C6A00030050 @%%@NL@%
  2371.  
  2372. For example, the following command reads the resource script file SAMPLE.RC
  2373. and creates the compiled resource file SAMPLE.RES.  %@NL@%
  2374.  
  2375. %@AS@%  RC -R SAMPLE.RC%@AE@%
  2376.  
  2377. The command does not add SAMPLE.RES to the executable file.%@CR:C6A00030051 @%%@NL@%
  2378.  
  2379.  
  2380. %@3@%%@CR:C6A00030052 @%%@AB@%3.3.2  Defining Names for the Preprocessor%@AE@%%@EH@%%@NL@%
  2381.  
  2382. You can specify conditional branching in a resource script file, based on
  2383. whether or not a term is defined on the %@AB@%RC%@AE@% command line using the %@AB@%-D%@AE@% option.%@CR:C6A00030053 @%%@NL@%
  2384.  
  2385. For example, suppose your application has a pop-up menu, the Debug menu,
  2386. which you want to appear only during debugging. When you compile the
  2387. application for normal use, the Debug menu is not included. The resource
  2388. script file contains the following statements to define the Debug menu:  %@NL@%
  2389.  
  2390. %@AS@%  MainMenu MENU
  2391. %@AS@%  BEGIN
  2392. %@AS@%    .
  2393. %@AS@%    .
  2394. %@AS@%    .
  2395. %@AS@%  #ifdef DEBUG
  2396. %@AS@%   POPUP "&Debug"
  2397. %@AS@%   BEGIN
  2398. %@AS@%    MENUITEM "&Memory usage", ID_MEMORY
  2399. %@AS@%    MENUITEM "&Walk data heap", ID_WALK_HEAP
  2400. %@AS@%   END
  2401. %@AS@%  #endif
  2402. %@AS@%  END%@AE@%
  2403.  
  2404. When compiling resources for a debugging version of the application, you
  2405. could include the Debug menu by using the following %@AB@%RC%@AE@% command:  %@NL@%
  2406.  
  2407. %@AS@%  RC -R -D DEBUG MYAPP.RC%@AE@%
  2408.  
  2409. To compile resources for a normal version of the application─one that does
  2410. not include the Debug menu─you could use the following %@AB@%RC %@AE@%command:  %@NL@%
  2411.  
  2412. %@AS@%  RC -R MYAPP.RC%@AE@%
  2413.  
  2414.  
  2415. %@3@%%@CR:C6A00030054 @%%@AB@%3.3.3  Renaming the Compiled Resource File%@AE@%%@EH@%%@NL@%
  2416.  
  2417. Normally, when compiling resources, the Resource Compiler names the compiled
  2418. resource file after the .RC file and places it in the same directory as the
  2419. script file. For example, when compiling MYAPP.RC, you would normally type:
  2420. %@NL@%
  2421.  
  2422. %@AS@%  RC -R MYAPP.RC%@AE@%
  2423.  
  2424. The compiler would then create a compiled resource file named MYAPP.RES in
  2425. the same directory as MYAPP.RC.  %@NL@%
  2426.  
  2427. The %@AB@%-FO%@AE@% option lets you give the resulting .RES file a name that differs
  2428. from the corresponding .RC script file. For example, to name the resulting
  2429. .RES file NEWFILE.RES, you could type:  %@NL@%
  2430.  
  2431. %@AS@%  RC -R -FO NEWFILE.RES MYAPP.RC%@AE@%
  2432.  
  2433. The %@AB@%-FO%@AE@% option can also place the .RES file in a different directory. For
  2434. example, typing the following command places the compiled resource file
  2435. MYAPP.RES in the directory C:\RESOURCE:%@CR:C6A00030055 @%%@NL@%
  2436.  
  2437. %@AS@%  RC -R -FO C:\SOURCE\RESOURCE\MYAPP.RES MYAPP.RC%@AE@%
  2438.  
  2439.  
  2440. %@3@%%@CR:C6A00030056 @%%@AB@%3.3.4  Controlling the Directories that RC Searches%@AE@%%@EH@%%@NL@%
  2441.  
  2442. Normally, the Resource Compiler searches for include files and resource
  2443. files (such as icon and cursor files) first in the current directory, and
  2444. then in the directories specified by the INCLUDE environment variable. (The
  2445. PATH environment variable has no effect on the directories that the Resource
  2446. Compiler searches.)  %@NL@%
  2447.  
  2448.  
  2449. %@4@%%@AB@%Adding a Directory to Search%@AE@%%@EH@%%@NL@%
  2450.  
  2451. You can use the %@AB@%-I%@AE@% option to add a directory to the list of directories that
  2452. the Resource Compiler searches. The compiler then searches the directories
  2453. in the following order:%@CR:C6A00030057 @%%@NL@%
  2454.  
  2455.  
  2456.   1.  The current directory.%@NL@%
  2457.  
  2458.   2.  The directory or directories you specify by using the %@AB@%-I%@AE@% option, in
  2459.       the order in which they appear on the command line.%@NL@%
  2460.  
  2461.   3.  The list of directories specified by the INCLUDE environment variable,
  2462.       in the order in which the variable lists them, unless you specify the
  2463.       %@AB@%-X%@AE@% option.%@NL@%
  2464.  
  2465.  
  2466. The following example compiles the resource script file MYAPP.RC and adds
  2467. the compiled resources to MYAPP.EXE:  %@NL@%
  2468.  
  2469. %@AS@%  RC -I C:\SOURCE\STUFF -I D:\RESOURCES MYAPP.RC MYAPP.EXE%@AE@%
  2470.  
  2471. When compiling the script file, the Resource Compiler searches for include
  2472. files and resource files first in the current directory, then in
  2473. C:\SOURCE\STUFF and D:\RESOURCES, and lastly in the directories specified by
  2474. the INCLUDE  environment variable.  %@NL@%
  2475.  
  2476.  
  2477. %@4@%%@AB@%Suppressing the INCLUDE Environment Variable%@AE@%%@EH@%%@NL@%
  2478.  
  2479. You can prevent the Resource Compiler from using the INCLUDE environment
  2480. variable when determining the directories to search. To do so, use the %@AB@%-X%@AE@%
  2481. option. The compiler then searches for files only in the current directory,
  2482. and in any directories you specify using the %@AB@%-I%@AE@% option.%@CR:C6A00030058 @%%@CR:C6A00030059 @%%@NL@%
  2483.  
  2484. The following example compiles the resource script file MYAPP.RC and adds
  2485. the compiled resources to MYAPP.EXE:  %@NL@%
  2486.  
  2487. %@AS@%  RC -X -I C:\SOURCE\STUFF MYAPP.RC MYAPP.EXE%@AE@%
  2488.  
  2489. When compiling the script file, the Resource Compiler searches for include
  2490. files and resource files first in the current directory and then in
  2491. C:\SOURCE\STUFF.  %@NL@%
  2492.  
  2493.  
  2494. %@3@%%@CR:C6A00030060 @%%@AB@%3.3.5  Displaying Progress Messages%@AE@%%@EH@%%@NL@%
  2495.  
  2496. Normally, the Resource Compiler does not display messages that report on its
  2497. progress as it compiles. You can, however, tell the compiler to display
  2498. these messages. To do so, use the %@AB@%-V%@AE@% option.%@CR:C6A00030061 @%%@NL@%
  2499.  
  2500. The following example causes the compiler to report on its progress as it
  2501. compiles the script file SAMPLE.RC, creates the compiled resource file
  2502. SAMPLE.RES, and adds the .RES file to the executable file SAMPLE.EXE:  %@NL@%
  2503.  
  2504. %@AS@%  RC -V SAMPLE.RC%@AE@%
  2505.  
  2506.  
  2507. %@2@%%@CR:C6A00030062 @%%@AB@%3.4  Summary%@AE@%%@EH@%%@NL@%
  2508.  
  2509. The Resource Compiler is a tool that lets you compile resources such as
  2510. icons, dialog boxes, and fonts into a binary file. You add the binary
  2511. resource file to the binary source files to produce an executable Windows
  2512. application.  %@NL@%
  2513.  
  2514. For information related to the Resource Compiler, see the following:  %@NL@%
  2515.  
  2516. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  2517. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2518. Creating icons, cursors, and      %@AI@%Tools%@AE@%: Chapter 4, "Designing Images: 
  2519. bitmaps                           SDKPaint"
  2520.  
  2521. Creating and editing dialog       %@AI@%Tools%@AE@%: Chapter 5, "Designing Dialog 
  2522. boxes                             Boxes: The Dialog Editor"
  2523.  
  2524. Creating fonts                    %@AI@%Tools%@AE@%: Chapter 6, "Designing Fonts: The 
  2525.                                   Font Editor"
  2526.  
  2527. Introduction to application       %@AI@%Guide to Programming%@AE@%: Chapter 7, "Menus"
  2528. menus                             
  2529.  
  2530. Introduction to controls, such    %@AI@%Guide to Programming%@AE@%: Chapter 8, 
  2531. as                                "Controls"
  2532. buttons and check boxes           
  2533.  
  2534. Introduction to dialog boxes;     %@AI@%Guide to Programming%@AE@%: Chapter 9, "Dialog
  2535. also                              Boxes"
  2536. explains how to use controls in   
  2537. dialog boxes                      
  2538.  
  2539. Syntax and descriptions of each   %@AI@%Reference%@AE@%, %@AI@%Volume 2%@AE@%: Chapter 8, 
  2540. resource statement and directive  "Resource Script Statements"
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546.  
  2547. %@CR:C6A-Part 02 @%%@1@%%@AB@%PART II  Resource Editors%@AE@%%@EH@%%@NL@%
  2548. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2549.  
  2550. Part 2 describes how to use the Microsoft Windows resource editors:
  2551. SDKPaint, the Dialog Editor, and the Font Editor. SDKPaint lets you create
  2552. bitmaps, icons, and cursors for your application. The Dialog Editor lets you
  2553. create and test dialog boxes on the screen instead of defining dialog
  2554. statements in a resource script. The Font Editor lets you create fonts and
  2555. update information in the font file header.  %@NL@%
  2556.  
  2557.  
  2558.  
  2559.  
  2560.  
  2561.  
  2562. %@CR:C6A00040001 @%%@1@%%@AB@%Chapter 4  Designing Images: SDKPaint%@AE@%%@EH@%%@NL@%
  2563. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2564.  
  2565. Microsoft Windows SDKPaint (%@AB@%SDKPAINT%@AE@%) lets you create bitmaps, icons, and
  2566. cursors for your applications. Using SDKPaint, you can draw bitmaps, icons,
  2567. and cursors and examine their appearance on screens of various colors. The
  2568. editor also simulates how images appear on different display devices.%@CR:C6A00040002 @%%@NL@%
  2569.  
  2570. This chapter describes the following:  %@NL@%
  2571.  
  2572.  
  2573.   ■   How SDKPaint works with bitmap, icon, and cursor files%@NL@%
  2574.  
  2575.   ■   The SDKPaint window, including its menu items and commands%@NL@%
  2576.  
  2577.   ■   Opening files and images within the files%@NL@%
  2578.  
  2579.   ■   Drawing with SDKPaint tools%@NL@%
  2580.  
  2581.   ■   Using the SDKPaint palette, including working with different color
  2582.       types%@NL@%
  2583.  
  2584.   ■   Customizing the palette, including editing colors, saving changes to
  2585.       the palette, and loading customized palettes%@NL@%
  2586.  
  2587.   ■   Defining a cursor hotspot%@NL@%
  2588.  
  2589.   ■   Using the clipboard to transfer images between editors, to move images
  2590.       from one resource to another, and to create multiple images
  2591. %@NL@%
  2592.  
  2593.  
  2594.  
  2595. %@2@%%@CR:C6A00040003 @%%@AB@%4.1  How SDKPaint Works with Files%@AE@%%@EH@%%@NL@%
  2596.  
  2597. SDKPaint creates or modifies bitmap (.BMP), icon (.ICO), and cursor (.CUR)
  2598. files.%@CR:C6A00040004 @%%@CR:C6A00040005 @%%@CR:C6A00040006 @%%@CR:C6A00040007 @%%@CR:C6A00040008 @%%@NL@%
  2599.  
  2600. You can include these files in the resource script that you use to compile
  2601. the resource (.RES) file. The .RES file is a component of the build that
  2602. produces an executable file for your application.  %@NL@%
  2603.  
  2604. Figure 4.1 illustrates the process of incorporating bitmap, icon, and cursor
  2605. files into an executable application. For detailed information on this
  2606. process, see Chapter 3, "Compiling Resources: The Resource Compiler."  %@NL@%
  2607.  
  2608. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2609.  
  2610.  
  2611. %@3@%%@CR:C6A00040009 @%%@AB@%4.1.1  File Types%@AE@%%@EH@%%@NL@%
  2612.  
  2613. The bitmap (.BMP) files that SDKPaint produces define device-independent
  2614. monochrome or color bitmaps. Each .BMP file defines one bitmap. Bitmaps that
  2615. you create and save using SDKPaint can range in size from 1-by-1 to 72-by-72
  2616. pixels.%@CR:C6A00040010 @%%@CR:C6A00040011 @%%@NL@%
  2617.  
  2618. Unlike bitmap files, icon (.ICO) and cursor (.CUR) files define a family of
  2619. images. Each image in an icon or cursor file is designed for display on a
  2620. different kind of device. SDKPaint distinguishes the different kinds of
  2621. images by pixel dimensions and color capabilities. For example, when the
  2622. application wants to use an icon, it requests the icon by name. Windows then
  2623. selects the appropriate icon image in the specified file according to the
  2624. pixel dimensions and color capabilities required by the device driver.%@CR:C6A00040012 @%%@CR:C6A00040013 @%%@CR:C6A00040014 @%%@NL@%
  2625.  
  2626.  
  2627. %@3@%%@CR:C6A00040015 @%%@AB@%4.1.2  Icon and Cursor Data: The SDKPAINT.DAT File%@AE@%%@EH@%%@NL@%
  2628.  
  2629. SDKPaint uses the SDKPAINT.DAT file to store display-device information for
  2630. individual icon or cursor images within a file. The SDKPAINT.DAT file you
  2631. install initially contains information about common display devices, such as
  2632. EGA and VGA.%@CR:C6A00040016 @%%@CR:C6A00040017 @%%@NL@%
  2633.  
  2634. SDKPAINT.DAT is an ASCII, comma-delimited file that you can edit to add
  2635. information about display devices. Each string in the file defines a display
  2636. device. A string is terminated by a carriage return (no null character) and
  2637. contains the following six fields:  %@NL@%
  2638.  
  2639. %@AS@%  name,num-colors,curs-horz-size,curs-vert-size,icon-horz-size,
  2640. %@AS@%icon-vert-size%@AE@%
  2641.  
  2642. Field definitions are as follows:  %@NL@%
  2643.  
  2644. %@AB@%Field%@AE@%                             %@AB@%Description%@AE@%
  2645. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2646. %@AI@%name%@AE@%                              Name of the display device. The name can
  2647.                                   contain up to 10 uppercase and lowercase
  2648.                                   letters.
  2649.  
  2650. %@AI@%num-colors%@AE@%                        Number of colors of the icon or cursor 
  2651.                                   image.
  2652.  
  2653. %@AI@%curs-horz-size%@AE@%                    Horizontal size of a cursor image in 
  2654.                                   pixels.
  2655.  
  2656. %@AI@%curs-vert-size%@AE@%                    Vertical size of a cursor image in 
  2657.                                   pixels.
  2658.  
  2659. %@AI@%icon-horz-size%@AE@%                    Horizontal size of an icon image in 
  2660.                                   pixels.
  2661.  
  2662. %@AI@%icon-vert-size%@AE@%                    Vertical size of an icon image in 
  2663.                                   pixels.
  2664.  
  2665. In addition to information about icon and cursor images, SDKPAINT.DAT  can
  2666. include comments. Indicate comments by placing a semicolon (;) at the
  2667. beginning of the comment line.  %@NL@%
  2668.  
  2669. For example, the following SDKPAINT.DAT file specifies information for icons
  2670. and cursors displayed on two devices:  %@NL@%
  2671.  
  2672. %@AS@%  ";This is a sample SDKPAINT.DAT file
  2673. %@AS@%        4-Plane,16,32,32,32,32
  2674. %@AS@%        3-Plane,16,32,32,32,32%@AE@%
  2675.  
  2676.  
  2677. This line is a comment.%@NL@%
  2678.  
  2679.  
  2680.  
  2681. This line defines a device with four color planes. The device displays
  2682. 16-color cursors and icons. Cursors and icons on this device are 32-by-32
  2683. pixels.%@NL@%
  2684.  
  2685.  
  2686.  
  2687. This line defines a device with three color planes, which also displays
  2688. 16-color cursors and icons. Cursors and icons on this device are also
  2689. 32-by-32 pixels.%@NL@%
  2690.  
  2691. SDKPaint displays information from the SDKPAINT.DAT file when you load an
  2692. icon or cursor image into SDKPaint. For information about loading images,
  2693. see "Loading an Image into the Workspace" in Section 4.3.3.%@CR:C6A00040018 @%%@NL@%
  2694.  
  2695.  
  2696. %@2@%%@CR:C6A00040019 @%%@AB@%4.2  The SDKPaint Window%@AE@%%@EH@%%@NL@%
  2697.  
  2698. The SDKPaint window varies with the kind of resource you are editing. Figure
  2699. 4.2 illustrates the SDKPaint window after a user has opened an icon file.%@CR:C6A00040020 @%%@NL@%
  2700.  
  2701. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2702.  
  2703. Regardless of the type of image you edit, the menu bar contains the
  2704. following menus:%@CR:C6A00040021 @%%@NL@%
  2705.  
  2706. %@TH:  72  3485 02 34 42 @%
  2707. Menu                              Commands
  2708. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2709. File                              This menu contains the following 
  2710.                                   commands:
  2711.  
  2712.                                   New─Initializes the workspace with a 
  2713.                                   bitmap, icon, or cursor image.
  2714.  
  2715.                                   Open─Opens existing .BMP, .ICO, and .CUR
  2716.                                   files for editing.
  2717.  
  2718.                                   Save and Save As─Save changes to bitmaps,
  2719.                                   icons, and cursors.
  2720.  
  2721.                                   Exit─Exits the editor. %@CR:C6A00040022 @%%@CR:C6A00040023 @%%@CR:C6A00040024 @%%@CR:C6A00040025 @% 
  2722.  
  2723. Edit                              This menu contains the following 
  2724.                                   commands:
  2725.  
  2726.                                   Undo─Restores the image to its state 
  2727.                                   before the last edit. 
  2728.  
  2729.                                   Copy─Moves an image to the clipboard.
  2730.  
  2731.                                   Paste─Moves an image from the clipboard.
  2732.  
  2733. Image                             This menu contains the following 
  2734.                                   commands:
  2735.  
  2736.                                   New─Initializes the workspace with an 
  2737.                                   icon or cursor image.
  2738.  
  2739.                                   Open─Opens images in a bitmap, icon, or 
  2740.                                   cursor file. %@CR:C6A00040026 @%%@CR:C6A00040027 @%%@CR:C6A00040028 @%%@CR:C6A00040029 @%%@CR:C6A00040030 @% 
  2741.  
  2742.                                   Save─Retains an icon or cursor currently
  2743.                                   in the workspace.
  2744.  
  2745.                                   Restore─Restores an image to its state 
  2746.                                   when initially loaded into the editor or
  2747.                                   when last retained.
  2748.  
  2749.                                   Clear─Sets to white all the pixels in 
  2750.                                   the work area.
  2751.  
  2752.                                   Delete─Deletes an image from the work 
  2753.                                   area and clears the image from the 
  2754.                                   SDKPaint window.
  2755.  
  2756. Brushsize                         This menu lets you choose among three 
  2757.                                   sizes of brushes to draw an image.
  2758.  
  2759. Palette                           This menu contains the following 
  2760.                                   commands:
  2761.  
  2762.                                   Edit Colors─Changes the currently 
  2763.                                   selected color to the hue you specify or
  2764.                                   restores the color to its default value.
  2765.  
  2766.                                   Get Colors─Loads a color palette (.PAL) 
  2767.                                   file into the 
  2768.                                   editor.
  2769.  
  2770.                                   Save Colors─Saves newly-created colors 
  2771.                                   in a .PAL file.
  2772.  
  2773. Hotspot                           This menu contains commands that let you
  2774.                                   define or display the hotspot of a 
  2775.                                   cursor. For information about the 
  2776.                                   hotspot, see Section 4.7, "Defining the 
  2777.                                   Cursor Hotspot."%@CR:C6A00040031 @% %@CR:C6A00040032 @%%@CR:C6A00040033 @%
  2778.  
  2779. %@TE:  72  3485 02 34 42 @%
  2780.  
  2781.  
  2782. %@2@%%@CR:C6A00040034 @%%@AB@%4.3  Opening Files and Images%@AE@%%@EH@%%@NL@%
  2783.  
  2784. Before editing an existing bitmap, icon, or cursor, you must first open a
  2785. file to prepare the workspace for the kind of image you are going to edit.%@CR:C6A00040035 @%%@NL@%
  2786.  
  2787.  
  2788. %@3@%%@CR:C6A00040036 @%%@AB@%4.3.1  Converting Files to 3.0 Format%@AE@%%@EH@%%@NL@%
  2789.  
  2790. When you open a version 2.0 or later bitmap, icon, or cursor file, SDKPaint
  2791. automatically converts it to 3.0 format as it is loaded into the editor.%@CR:C6A00040037 @%%@NL@%
  2792.  
  2793.  
  2794. %@3@%%@CR:C6A00040038 @%%@AB@%4.3.2  Opening Bitmaps%@AE@%%@EH@%%@NL@%
  2795.  
  2796. To open an existing bitmap file, choose the Open command from the File menu.
  2797. SDKPaint opens the file and loads its image into the workspace of the
  2798. SDKPaint window.%@NL@%
  2799.  
  2800. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2801. NOTE
  2802.  
  2803. %@AI@%SDKPaint opens and loads only 2-color and 16-color bitmaps.%@AE@%
  2804. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2805.  
  2806. If you are creating a new bitmap instead of editing one that exists, do the
  2807. following:%@CR:C6A00040039 @%%@NL@%
  2808.  
  2809.  
  2810.   1.  Choose the New command from the File menu. %@NL@%
  2811.  
  2812. %@STUB@%      The editor displays the Resource Type dialog box.%@NL@%
  2813.  
  2814.   2.  Choose the Bitmap option.%@NL@%
  2815.  
  2816. %@STUB@%      SDKPaint displays a dialog box that lets you enter the height and
  2817.       width of the bitmap image you are creating and placing in the file.
  2818.       The dialog box also prompts you for the number of bitmap colors.%@CR:C6A00040040 @%%@CR:C6A00040041 @%%@NL@%
  2819.  
  2820.   3.  Specify either 2 or 16 colors. %@NL@%
  2821.  
  2822. %@STUB@%      By default, the first time you open a bitmap file, SDKPaint uses
  2823.       values appropriate to the display on which it is running. If you
  2824.       subsequently open additional bitmap files, SDKPaint specifies by
  2825.       default the values of the most recently created bitmap.%@NL@%
  2826.  
  2827.  
  2828. SDKPaint prepares the workspace of the SDKPaint window for the bitmap image
  2829. that you will create.  %@NL@%
  2830.  
  2831.  
  2832. %@3@%%@CR:C6A00040042 @%%@AB@%4.3.3  Opening Icons and Cursors%@AE@%%@EH@%%@NL@%
  2833.  
  2834. Because icon and cursor files contain multiple images, you must first open a
  2835. file and then load a specified image into the workspace.  %@NL@%
  2836.  
  2837.  
  2838. %@4@%%@AB@%Specifying an Icon or Cursor File%@AE@%%@EH@%%@NL@%
  2839.  
  2840. To open an existing icon or cursor file, choose the Open command from the
  2841. File menu. SDKPaint offers you a choice of files to open.  %@NL@%
  2842.  
  2843. If you want to create icons or cursors that you will save in a new file,
  2844. choose the New command from the File menu.  %@NL@%
  2845.  
  2846. When SDKPaint displays the Resource Type dialog box, do the following:%@CR:C6A00040043 @%%@NL@%
  2847.  
  2848. %@TH:  37  2010 02 34 42 @%
  2849. Image Type                        Procedure
  2850. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2851. Icon                              To specify a new icon file:
  2852.  
  2853.                                   1.  Choose the Icon option. 
  2854.  
  2855.                                   SDKPaint displays an Icon Sizes dialog 
  2856.                                   box. By default, SDKPaint displays icon 
  2857.                                   image information appropriate for the 
  2858.                                   display on which SDKPaint is running. %@CR:C6A00040044 @%%@CR:C6A00040045 @% %@CR:C6A00040046 @% 
  2859.  
  2860.                                   2.  Choose the device type from the 
  2861.                                   combo box.
  2862.  
  2863.                                   If you want to create an icon image for 
  2864.                                   a different type of device, open the 
  2865.                                   drop-down combo box and choose the kind 
  2866.                                   of device you want to target.
  2867.  
  2868. Cursor                            To specify a new cursor file, do the 
  2869.                                   following:
  2870.  
  2871.                                   1.  Choose the Cursor option. 
  2872.  
  2873.                                   SDKPaint displays a Cursor Sizes dialog 
  2874.                                   box. By default, SDKPaint displays 
  2875.                                   cursor image information appropriate for
  2876.                                   the display on which SDKPaint is running.
  2877.  
  2878.                                   2.  Choose the device type from the 
  2879.                                   combo box.
  2880.  
  2881.                                   If you want to create a cursor for a 
  2882.                                   different type of device, open the 
  2883.                                   drop-down combo box and choose the kind 
  2884.                                   of device you want to target.%@CR:C6A00040047 @%%@CR:C6A00040048 @%%@CR:C6A00040049 @% %@CR:C6A00040050 @%
  2885.  
  2886. %@TE:  37  2010 02 34 42 @%
  2887.  
  2888.  
  2889. %@4@%%@AB@%Loading an Image into the Workspace%@AE@%%@EH@%%@NL@%
  2890.  
  2891. After opening a file, you can either load an existing image into the
  2892. workspace of the SDKPaint window or specify that you will create a new
  2893. image.  %@NL@%
  2894.  
  2895. To load an icon or cursor image with a specified pixel dimension into the
  2896. workspace, choose the Open command from the Image menu. SDKPaint first
  2897. prompts you for the image you want and then displays the image you select.%@CR:C6A00040051 @%%@NL@%
  2898.  
  2899. To load a new icon or cursor image with a specified pixel dimension into the
  2900. workspace, choose the New command from the Image menu. The editor displays a
  2901. dialog box that prompts you first for the characteristics of the image you
  2902. want to create and then asks for information about the pixel dimensions of
  2903. the image.  %@NL@%
  2904.  
  2905.  
  2906. %@2@%%@CR:C6A00040052 @%%@AB@%4.4  Drawing with SDKPaint Tools%@AE@%%@EH@%%@NL@%
  2907.  
  2908. Whether editing an existing image or creating a new image from scratch, use
  2909. the tools displayed at the bottom of the SDKPaint window to draw your
  2910. bitmap, icon, or cursor.%@CR:C6A00040053 @%%@CR:C6A00040054 @%%@CR:C6A00040055 @%%@NL@%
  2911.  
  2912. Table 4.1 illustrates and describes SDKPaint tools.  %@NL@%
  2913.  
  2914. Table 4.1  SDKPaint Tools
  2915.  
  2916. %@TH:  47  2928 02 16 30 30 @%
  2917. Tool            Illustration                  Description
  2918. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2919. Oil Can         %@AU@%(Please refer to the printed%@AE@%  Fills a bordered area with 
  2920.                 %@AU@%book)%@AE@%                         the current drawing color.
  2921.  
  2922. Paintbrush      %@AU@%(Please refer to the printed%@AE@%  Paints the image using the 
  2923.                 %@AU@%book)%@AE@%                         current 
  2924.                                               drawing width and color. 
  2925.  
  2926. Rectangle       %@AU@%(Please refer to the printed%@AE@%  Draws a hollow rectangle 
  2927.                 %@AU@%book)%@AE@%                         using the 
  2928.                                               current drawing color.
  2929.  
  2930. Full Rectangle  %@AU@%(Please refer to the printed%@AE@%  Draws a rectangle and fills 
  2931.                 %@AU@%book)%@AE@%                         it with the current drawing 
  2932.                                               color.
  2933.  
  2934. Circle          %@AU@%(Please refer to the printed%@AE@%  Draws a hollow circle or 
  2935.                 %@AU@%book)%@AE@%                         ellipse using the current 
  2936.                                               drawing color.
  2937.  
  2938. Full Circle     %@AU@%(Please refer to the printed%@AE@%  Draws a circle or ellipse 
  2939.                 %@AU@%book)%@AE@%                         and fills it with the 
  2940.                                               current drawing color.
  2941.  
  2942. Line            %@AU@%(Please refer to the printed%@AE@%  Draws a straight line 
  2943.                 %@AU@%book)%@AE@%                         between selected star and 
  2944.                                               end points using the current
  2945.                                               drawing color.
  2946.  
  2947. Pick Rectangle  %@AU@%(Please refer to the printed%@AE@%  Selects a rectangular region
  2948.                 %@AU@%book)%@AE@%                         in the image. Choose the 
  2949.                                               Copy command from the Edit 
  2950.                                               menu to transfer the 
  2951.                                               selected portion of the 
  2952.                                               image to the clipboard. 
  2953.                                               Choose the Paste command 
  2954.                                               from the Edit menu to 
  2955.                                               transfer the contents of the
  2956.                                               clipboard to the selected 
  2957.                                               region. The selected region 
  2958.                                               reverts to the entire 
  2959.                                               workspace following a copy 
  2960.                                               or paste operation.
  2961.  
  2962. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2963.  
  2964. %@TE:  47  2928 02 16 30 30 @%
  2965.  
  2966.  
  2967. %@2@%%@CR:C6A00040056 @%%@AB@%4.5  Using the SDKPaint Palette%@AE@%%@EH@%%@NL@%
  2968.  
  2969. The SDKPaint palette defines available and currently selected colors for
  2970. drawing and display. SDKPaint displays two types of colors in the palette:
  2971. true colors and dithered colors. When you are creating a bitmap or icon, the
  2972. 16 colors that SDKPaint displays in the leftmost eight columns of the
  2973. palette are true colors. The remaining colors are dithered. When you are
  2974. creating a cursor, all colors of the palette are true colors.%@CR:C6A00040057 @%%@CR:C6A00040058 @%%@CR:C6A00040059 @%%@CR:C6A00040060 @%%@NL@%
  2975.  
  2976. The 16 true colors are red, green, and blue (RGB) values guaranteed to be
  2977. distinct on a device that displays 16 or more colors.  %@NL@%
  2978.  
  2979. If you are working with icons or cursors, you can get information about the
  2980. RGB values of a color on the palette by first selecting the color and then
  2981. choosing the Edit Colors command from the Palette menu. If you are editing a
  2982. bitmap image, you can also get the information by double-clicking the color.
  2983. The editor lists RGB values of the selected color in the Edit Colors dialog
  2984. box.%@CR:C6A00040061 @%%@CR:C6A00040062 @%%@NL@%
  2985.  
  2986. The palette differs with the type of resource you are editing. Figure 4.3
  2987. illustrates the palette that SDKPaint displays when you are editing a
  2988. bitmap.%@CR:C6A00040063 @%%@CR:C6A00040064 @%%@CR:C6A00040065 @%%@NL@%
  2989.  
  2990. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2991.  
  2992. The palette displays 16 true and 12 dithered colors that you can use to
  2993. define screen background.  %@NL@%
  2994.  
  2995. Figure 4.4 illustrates the palette that SDKPaint displays when you are
  2996. editing an icon.%@CR:C6A00040066 @%%@NL@%
  2997.  
  2998. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2999.  
  3000. The palette displays 16 true and 12 dithered colors.  %@NL@%
  3001.  
  3002. Figure 4.5 illustrates the palette that SDKPaint displays when you are
  3003. editing a cursor.%@CR:C6A00040067 @%%@CR:C6A00040068 @%%@NL@%
  3004.  
  3005. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3006.  
  3007. The palette indicates that you can use only black and white opaque colors to
  3008. define a cursor. The palette also displays 16 true colors that you can use
  3009. for screen and inverse color.%@CR:C6A00040069 @%%@NL@%
  3010.  
  3011. The following section describes how to use the colors that the palette
  3012. displays.  %@NL@%
  3013.  
  3014.  
  3015. %@3@%%@CR:C6A00040070 @%%@AB@%4.5.1  Working with Opaque, Screen, and Inverse Colors%@AE@%%@EH@%%@NL@%
  3016.  
  3017. Images comprise one or more of the following types of colors:  %@NL@%
  3018.  
  3019. %@AB@%Color%@AE@%                             %@AB@%Description%@AE@%
  3020. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3021. Color (opaque)                    Colors that retain their hue regardless 
  3022.                                   of the color of the screen.%@CR:C6A00040071 @% %@CR:C6A00040072 @% %@CR:C6A00040073 @%
  3023.  
  3024. Screen                            The color that defines the screen 
  3025.                                   background. %@CR:C6A00040074 @%
  3026.  
  3027. Inverse                           The color that is the inverse of the 
  3028.                                   screen color. SDKPaint always displays 
  3029.                                   the inverse color of the currently 
  3030.                                   specified screen color.%@CR:C6A00040075 @%
  3031.  
  3032. To select an opaque, screen, or inverse color from the palette, do the
  3033. following:  %@NL@%
  3034.  
  3035.  
  3036.   1.  Select the type of color you want to draw within the color type
  3037.       window.%@NL@%
  3038.  
  3039.   2.  Click the color displayed in the palette.%@NL@%
  3040.  
  3041. %@STUB@%      SDKPaint displays the selected color in the color type window.%@NL@%
  3042.  
  3043.  
  3044. When using the opaque color type, you can associate a color with the left
  3045. mouse button by clicking that color with the left mouse button. The color
  3046. you select appears in the box labeled "Left."  %@NL@%
  3047.  
  3048. To associate an opaque color with the right mouse button, click the color
  3049. with the right mouse button. The selected color appears in the box labeled
  3050. "Right."  %@NL@%
  3051.  
  3052. The following sections describe how to use opaque, screen, and inverse
  3053. colors.  %@NL@%
  3054.  
  3055.  
  3056. %@4@%%@AB@%Using Opaque Colors%@AE@%%@EH@%%@NL@%
  3057.  
  3058. The following describes the opaque color options for each image:%@CR:C6A00040076 @%%@NL@%
  3059.  
  3060. %@AB@%Image%@AE@%                             %@AB@%Color Options%@AE@%
  3061. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3062. Bitmap%@CR:C6A00040077 @%                            Bitmaps are either monochrome or color.%@CR:C6A00040078 @% 
  3063.  
  3064. Icon                              Icons can use the full spectrum of the 
  3065.                                   palette. %@CR:C6A00040079 @%%@CR:C6A00040080 @% %@CR:C6A00040081 @%
  3066.  
  3067. Cursor                            Cursors are monochrome. %@CR:C6A00040082 @% %@CR:C6A00040083 @%
  3068.  
  3069.  
  3070. %@4@%%@AB@%Using Screen Colors%@AE@%%@EH@%%@NL@%
  3071.  
  3072. Screen colors let you see how your icon or cursor looks against various
  3073. screens. SDKPaint displays screen colors in the viewing area of the SDKPaint
  3074. window. In addition to the selection method described above, you can change
  3075. screen colors as follows:%@CR:C6A00040084 @%%@CR:C6A00040085 @%%@CR:C6A00040086 @%%@NL@%
  3076.  
  3077.  
  3078.   ■   Select a color from the palette and then click in the viewing area.%@NL@%
  3079.  
  3080. %@STUB@%      This method changes the screen color, regardless of the color type you
  3081.       have selected. If you are currently drawing with the opaque color
  3082.       type, using this procedure changes the color of the screen to the
  3083.       color you select from the palette. %@NL@%
  3084.  
  3085.   ■   Select the inverse color type and then click a color in the palette. %@NL@%
  3086.  
  3087. %@STUB@%      SDKPaint displays the inverse color you have selected and
  3088.       automatically  displays the corresponding screen color. %@NL@%
  3089.  
  3090.  
  3091.  
  3092. %@4@%%@AB@%Using Inverse Colors%@AE@%%@EH@%%@NL@%
  3093.  
  3094. When the opaque colors of an icon or cursor are identical to the color of
  3095. the screen on which they are displayed, the icon or cursor is not visible.
  3096. Inverse colors are useful for defining the image when this condition occurs.
  3097. For example, if you outline an icon in an inverse color, the border of the
  3098. icon is visible when the screen and opaque colors are identical.%@CR:C6A00040087 @%%@CR:C6A00040088 @%%@CR:C6A00040089 @%%@NL@%
  3099.  
  3100. In addition to the selection method described in the preceding section, you
  3101. can change the inverse color by choosing a new screen color. When you change
  3102. the screen color, SDKPaint automatically displays the compatible inverse
  3103. color.  %@NL@%
  3104.  
  3105.  
  3106. %@2@%%@CR:C6A00040090 @%%@AB@%4.6  Customizing the Palette%@AE@%%@EH@%%@NL@%
  3107.  
  3108. SDKPaint lets you customize the palette by editing colors. After editing one
  3109. or more colors, you can save them in a special palette that you load into
  3110. the editor.%@CR:C6A00040091 @%%@NL@%
  3111.  
  3112. This section describes how to do the following:  %@NL@%
  3113.  
  3114.  
  3115.   ■   Edit colors for bitmaps and color icons%@NL@%
  3116.  
  3117.   ■   Save a palette that you have customized%@NL@%
  3118.  
  3119.   ■   Load a customized palette into the editor
  3120. %@NL@%
  3121.  
  3122.  
  3123.  
  3124. %@3@%%@CR:C6A00040092 @%%@AB@%4.6.1  Editing Colors%@AE@%%@EH@%%@NL@%
  3125.  
  3126. SDKPaint lets you edit the palette used to draw bitmaps and color icons. To
  3127. edit a color from the palette that is currently loaded in SDKPaint, do the
  3128. following:%@CR:C6A00040093 @%%@CR:C6A00040094 @%%@CR:C6A00040095 @%%@NL@%
  3129.  
  3130.  
  3131.   1.  Select the color you want to edit.%@NL@%
  3132.  
  3133.   2.  Choose the Edit Colors command from the Palette menu. %@NL@%
  3134.  
  3135. %@STUB@%      If you are editing a bitmap, you can also double-click the color on
  3136.       the palette. In either case, SDKPaint displays the Edit Colors dialog
  3137.       box.%@NL@%
  3138.  
  3139.   3.  Change the RGB values of the color.%@NL@%
  3140.  
  3141. %@STUB@%      The editor displays the changes to the color in the dialog box.%@NL@%
  3142.  
  3143.   4.  Choose OK if you are satisfied with the new color.%@NL@%
  3144.  
  3145. %@STUB@%      If you want to cancel your edits on the color, choose Cancel.%@NL@%
  3146.  
  3147.  
  3148.  
  3149. %@3@%%@CR:C6A00040096 @%%@AB@%4.6.2  Saving a Palette%@AE@%%@EH@%%@NL@%
  3150.  
  3151. After you customize a palette by editing selected colors on it, you can save
  3152. the palette for future use by choosing the Save Colors command from the
  3153. Palette menu. SDKPaint prompts you for the filename of the palette you are
  3154. saving.%@CR:C6A00040097 @%%@NL@%
  3155.  
  3156. SDKPaint assigns the extension .PAL to custom palettes by default.  %@NL@%
  3157.  
  3158.  
  3159. %@3@%%@CR:C6A00040098 @%%@AB@%4.6.3  Loading a Customized Palette%@AE@%%@EH@%%@NL@%
  3160.  
  3161. Choose the Get Colors command from the Palette menu to load a customized
  3162. palette into SDKPaint. SDKPaint prompts you for the name and location of the
  3163. palette you want to use.  %@NL@%
  3164.  
  3165. After you load the palette into SDKPaint, you can return to the default
  3166. palette by doing the following:%@CR:C6A00040099 @%%@NL@%
  3167.  
  3168.  
  3169.   1.  Choose the Edit Colors command from the Palette menu.%@NL@%
  3170.  
  3171.   2.  Select Default in the Edit Colors dialog box.%@NL@%
  3172.  
  3173.  
  3174.  
  3175. %@2@%%@CR:C6A00040100 @%%@AB@%4.7  Defining the Cursor Hotspot%@AE@%%@EH@%%@NL@%
  3176.  
  3177. To define the hotspot of a cursor do the following:  %@NL@%
  3178.  
  3179.  
  3180.   1.  Choose the Set Hotspot command from the Hotspot menu.%@NL@%
  3181.  
  3182. %@STUB@%      SDKPaint changes the cursor to a bullseye and displays a window that
  3183.       gives the coordinates of the cursor as you move it around the work
  3184.       area. %@NL@%
  3185.  
  3186.   2.  Click the left mouse button to define the hotspot. %@NL@%
  3187.  
  3188. %@STUB@%      Clicking the mouse button when the cursor is outside the work area
  3189.       disables the Set Hotspot command.%@CR:C6A00040101 @% %@CR:C6A00040102 @%%@CR:C6A00040103 @%%@CR:C6A00040104 @%%@NL@%
  3190.  
  3191.  
  3192. To show the current hotspot, choose the Show Hotspot command from the
  3193. Hotspot menu. The editor displays the coordinates of the current hotspot in
  3194. a window. To delete the window, choose Show Hotspot again.  %@NL@%
  3195.  
  3196.  
  3197. %@2@%%@CR:C6A00040105 @%%@AB@%4.8  Using the Clipboard%@AE@%%@EH@%%@NL@%
  3198.  
  3199. SDKPaint lets you transfer images to and from the clipboard using the Copy
  3200. and Paste commands from the Edit menu. Transferring images is useful to do
  3201. the following:%@CR:C6A00040106 @%%@NL@%
  3202.  
  3203.  
  3204.   ■   Load an image created using Paintbrush or another paint program.%@NL@%
  3205.  
  3206.   ■   Move an image from one resource type to another, such as when using a
  3207.       cursor image to create an icon.%@CR:C6A00040107 @%%@CR:C6A00040108 @%%@NL@%
  3208.  
  3209.   ■   Create multiple device-specific versions of one image.%@NL@%
  3210.  
  3211.  
  3212. The editor uses two data formats when transferring images to and from the
  3213. clipboard. To transfer opaque colors, SDKPaint uses the CF_BITMAP format. To
  3214. transfer inverse colors, the editor uses a private format. Many drawing
  3215. applications, such as Paintbrush, recognize the CF_BITMAP format.  %@NL@%
  3216.  
  3217. The image you transfer from the clipboard may be smaller or larger than the
  3218. selected rectangular region of the image. By default, the selected region is
  3219. the entire workspace; you can select a smaller region using the Pick
  3220. Rectangle tool.  %@NL@%
  3221.  
  3222. When the clipboard image is not the same size as the selected region,
  3223. SDKPaint displays a dialog box that gives you the following options:%@CR:C6A00040109 @%%@NL@%
  3224.  
  3225.  
  3226.   ■   Stretch/shrink Clipboard bitmap?%@NL@%
  3227.  
  3228.   ■   Clip Clipboard bitmap?%@NL@%
  3229.  
  3230.  
  3231. If you select the Stretch/shrink option, SDKPaint stretches or compresses
  3232. the image as necessary. For details about this process, see the description
  3233. of the %@AB@%StretchBlt%@AE@% function in the %@AI@%Reference, Volume 1%@AE@%.  %@NL@%
  3234.  
  3235. If you select the Clip option, SDKPaint pastes the clipboard bitmap to the
  3236. screen, justified on the top left corners of the workspace and viewing area.
  3237. SDKPaint modifies rows and columns of the image as follows:  %@NL@%
  3238.  
  3239. %@AB@%Size of Clipboard Bitmap%@AE@%          %@AB@%Rows and Columns Modified%@AE@%
  3240. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3241. Smaller than selected region      Rows at the bottom and columns at the 
  3242.                                   far right of the selected region
  3243.                                   remain unchanged.
  3244.  
  3245. Larger than selected region       SDKPaint clips rows at the bottom and 
  3246.                                   columns at the far right of the 
  3247.                                   clipboard bitmap.
  3248.  
  3249.  
  3250. %@2@%%@CR:C6A00040110 @%%@AB@%4.9  Using ZoomIn to Examine Images%@AE@%%@EH@%%@NL@%
  3251.  
  3252. The Microsoft Windows ZoomIn utility (%@AB@%ZOOMIN%@AE@%) allows you to examine screen
  3253. images in detail. ZoomIn captures images from the screen and expands or
  3254. contracts the size of the pixels of that image. For example, you could use
  3255. ZoomIn to capture the image of a character displayed with the system font,
  3256. expand that image to show the pixel pattern of the character, and then
  3257. duplicate the character in the image you are creating with SDKPaint.  %@NL@%
  3258.  
  3259. When you run ZoomIn, the utility displays a small overlapped window with a
  3260. vertical scroll bar. To capture an image, press the left mouse button while
  3261. the cursor is inside the client area of the ZoomIn window. A rectangle
  3262. appears that shows the size of the area on the screen which ZoomIn will
  3263. display. Drag the rectangle to the image on the screen you want to capture,
  3264. and then release the mouse button.  %@NL@%
  3265.  
  3266. To vary the detail of the image, use the vertical scroll bar of the ZoomIn
  3267. window. Scrolling up decreases the detail, and scrolling down increases the
  3268. detail. To change the size of the image captured by ZoomIn, resize the
  3269. ZoomIn window.  %@NL@%
  3270.  
  3271.  
  3272. %@2@%%@CR:C6A00040111 @%%@AB@%4.10  Summary%@AE@%%@EH@%%@NL@%
  3273.  
  3274. SDKPaint is a tool that lets you design bitmaps, icons, and cursors.  %@NL@%
  3275.  
  3276. For more information on subjects related to creating images, see the
  3277. following:%@NL@%
  3278.  
  3279. %@AB@%Subject%@AE@%                           %@AB@%Reference%@AE@%
  3280. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3281. Resource files                    %@AI@%Tools%@AE@%: Chapter 3, "Compiling Resources: 
  3282.                                   The Resource Compiler"
  3283.  
  3284. Icons                             %@AI@%Guide to Programming%@AE@%: Chapter 5, "Icons"
  3285.  
  3286. Cursors                           %@AI@%Guide to Programming%@AE@%: Chapter 6, "The 
  3287.                                   Cursor, the Mouse, and the Keyboard"
  3288.  
  3289. Bitmaps                           %@AI@%Guide to Programming%@AE@%: Chapter 11, 
  3290.                                   "Bitmaps"
  3291.  
  3292. Clipboard files                   %@AI@%Reference%@AE@%,%@AI@% Volume 2%@AE@%: Chapter 9, "File 
  3293.                                   Formats"
  3294.  
  3295.                                   
  3296.  
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302. %@CR:C6A00050001 @%%@1@%%@AB@%Chapter 5  Designing Dialog Boxes: The Dialog Editor%@AE@%%@EH@%%@NL@%
  3303. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3304.  
  3305. Microsoft Windows Dialog Editor (%@AB@%DIALOG%@AE@%) is a tool that lets you design and
  3306. test a dialog box on the display screen instead of defining dialog
  3307. statements in a resource script. Using the Dialog Editor, you can add,
  3308. modify, and delete controls in a dialog box. The Dialog Editor saves the
  3309. changes you make as resource script statements. You then compile these
  3310. statements into a binary resource file that is linked to your application's
  3311. executable file.%@CR:C6A00050002 @%%@CR:C6A00050003 @%%@CR:C6A00050004 @%%@CR:C6A00050005 @%%@CR:C6A00050006 @%%@CR:C6A00050007 @%%@NL@%
  3312.  
  3313. This chapter describes the following topics:%@CR:C6A00050008 @%%@NL@%
  3314.  
  3315.  
  3316.   ■   How the Dialog Editor works with files%@NL@%
  3317.  
  3318.   ■   Installing custom controls%@NL@%
  3319.  
  3320.   ■   Viewing the Dialog Editor window%@NL@%
  3321.  
  3322.   ■   Opening resource files, include files, and dialog boxes%@NL@%
  3323.  
  3324.   ■   Editing individual controls%@NL@%
  3325.  
  3326.   ■   Working with groups of controls%@NL@%
  3327.  
  3328.   ■   Working with dialog boxes%@NL@%
  3329.  
  3330.   ■   Moving a dialog box between resources%@NL@%
  3331.  
  3332.   ■   Working with include files
  3333. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3334. NOTE
  3335.  
  3336. %@AI@%You must use a mouse or similar pointing device with the Dialog Editor.%@CR:C6A00050009 @%%@AE@%
  3337. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3338.  
  3339. %@NL@%
  3340.  
  3341.  
  3342.  
  3343. %@2@%%@CR:C6A00050010 @%%@AB@%5.1  How the Dialog Editor Works with Files%@AE@%%@EH@%%@NL@%
  3344.  
  3345. The Dialog Editor creates or modifies the following types of files:%@CR:C6A00050011 @%%@CR:C6A00050012 @%%@CR:C6A00050013 @%%@NL@%
  3346.  
  3347. %@AB@%File Type%@AE@%                         %@AB@%Description%@AE@%
  3348. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3349. Dialog script (.DLG)              Text file containing %@AB@%DIALOG%@AE@% and %@AB@%CONTROL%@AE@% 
  3350.                                   statements that the Resource Compiler 
  3351.                                   interprets
  3352.  
  3353. Resource file (.RES)              Binary file containing multiple dialog 
  3354.                                   resources, and other resources such as 
  3355.                                   bitmaps, icons, menus, and string tables
  3356.                                   %@CR:C6A00050014 @% %@CR:C6A00050015 @% 
  3357.  
  3358. %@AB@%File Type%@AE@%                         %@AB@%Description%@AE@%
  3359. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3360. Include file (.H)                 Text file containing %@AB@%#define%@AE@% constants 
  3361.                                   that are associated with symbol names 
  3362.                                   for the various controls located in a 
  3363.                                   dialog box %@CR:C6A00050016 @%%@CR:C6A00050017 @%
  3364.  
  3365. Figure 5.1 illustrates how the Dialog Editor manages these files.  %@NL@%
  3366.  
  3367. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3368.  
  3369.  
  3370. %@3@%%@CR:C6A00050018 @%%@AB@%5.1.1  The Dialog Script%@AE@%%@EH@%%@NL@%
  3371.  
  3372. The most important output of the Dialog Editor is the dialog script (.DLG)
  3373. file. You can define more than one dialog box in a .DLG file. The following
  3374. exemplifies a .DLG script that Dialog Editor produces:%@CR:C6A00050019 @%%@CR:C6A00050020 @%%@NL@%
  3375.  
  3376. %@AS@%  FirstBox DIALOG LOADONCALL MOVEABLE DISCARDABLE 12, 20, 130, 113
  3377. %@AS@%  STYLE WS_DLGFRAME | WS_POPUP
  3378. %@AS@%  BEGIN
  3379. %@AS@%  CONTROL "Option 1", 102, "button", BS_RADIOBUTTON |
  3380. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 19, 28, 12
  3381. %@AS@%  CONTROL "Option 2", 103, "button", BS_RADIOBUTTON |
  3382. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 36, 28, 12
  3383. %@AS@%  CONTROL "Option 3", 104, "button", BS_RADIOBUTTON |
  3384. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 53, 28, 12
  3385. %@AS@%  CONTROL "Ok", 1, "button", BS_PUSHBUTTON |
  3386. %@AS@%            WS_TABSTOP | WS_CHILD, 29, 86, 24, 14
  3387. %@AS@%  CONTROL "Cancel", 2, "button", BS_PUSHBUTTON |
  3388. %@AS@%            WS_TABSTOP | WS_CHILD, 70, 86, 24, 14
  3389. %@AS@%  END
  3390. %@AS@%  
  3391. %@AS@%  SecondBox DIALOG LOADONCALL MOVEABLE DISCARDABLE  30, 40, 135, 125
  3392. %@AS@%  STYLE WS_DLGFRAME | WS_POPUP
  3393. %@AS@%  BEGIN
  3394. %@AS@%            .
  3395. %@AS@%            .
  3396. %@AS@%            .%@AE@%
  3397.  
  3398. You include the dialog script within your application's resource script
  3399. (.RC) file by using an %@AB@%#include%@AE@% statement that refers to the .DLG file. If
  3400. you name the dialog script MYDLGS.DLG, your .RC file might look similar to
  3401. the following example:%@CR:C6A00050021 @%%@CR:C6A00050022 @%%@NL@%
  3402.  
  3403. %@AS@%  #include "mydlgs.h"
  3404. %@AS@%  .
  3405. %@AS@%  .
  3406. %@AS@%  .
  3407. %@AS@%  MainMenu  MENU
  3408. %@AS@%  BEGIN
  3409. %@AS@%     POPUP  "&File"
  3410. %@AS@%      BEGIN
  3411. %@AS@%          MENUITEM  "&New",  MI_FILE_NEW
  3412. %@AS@%          .
  3413. %@AS@%          .
  3414. %@AS@%           .
  3415. %@AS@%     END
  3416. %@AS@%  END
  3417. %@AS@%  
  3418. %@AS@%  #include "mydlgs.dlg"
  3419. %@AS@%  .
  3420. %@AS@%  .
  3421. %@AS@%  .%@AE@%
  3422.  
  3423. Using the %@AB@%#include%@AE@% directive, include the .DLG script into the application's
  3424. overall .RC script. Then compile the .RC text file to produce an .RES binary
  3425. file using the %@AB@%-r%@AE@% switch. Finally, link the .RES file into your
  3426. application's .EXE file.  %@NL@%
  3427.  
  3428. See Section 5.1.3, "The Include File," for more information on how to
  3429. include the .H header and the .DLG files.  %@NL@%
  3430.  
  3431.  
  3432. %@3@%%@CR:C6A00050023 @%%@AB@%5.1.2  The Resource File%@AE@%%@EH@%%@NL@%
  3433.  
  3434. The Dialog Editor produces an .RES file that is a companion to the .DLG
  3435. file. This .RES file is a compiled, binary representation of the dialog
  3436. script.%@CR:C6A00050024 @%%@NL@%
  3437.  
  3438. The purpose of the .RES file produced by the Dialog Editor is solely to
  3439. reedit the dialog script. The Dialog Editor does not read in .DLG files; it
  3440. reads only in .RES files. Note that this .RES file should not be linked to
  3441. your application's .EXE file because it does not include the other
  3442. resources─such as bitmaps, icons, menus, and string tables─required by your
  3443. application.  %@NL@%
  3444.  
  3445. There are two methods for reediting a dialog resource. The first method is
  3446. to read back into the Dialog Editor the .RES file that the editor produced
  3447. as a companion to the .DLG file.%@CR:C6A00050025 @%%@CR:C6A00050026 @%%@CR:C6A00050027 @%%@NL@%
  3448.  
  3449. The second method is to read into the Dialog Editor the .RES file that the
  3450. Resource Compiler produced from the combined .RC and .DLG scripts.  %@NL@%
  3451.  
  3452. Which method you choose is a matter of personal preference. The advantage of
  3453. the first method is that you can group together categories of dialog boxes
  3454. into separate .DLG files and their corresponding .RES files, and manage them
  3455. separately. Also, it is not necessary for you to use the Resource Compiler
  3456. to convert the .DLG text file into the binary .RES format required as input
  3457. to the Dialog Editor. The advantage of the second method is that you can
  3458. discard .RES files produced by the Dialog Editor and free up disk space.  %@NL@%
  3459.  
  3460.  
  3461. %@3@%%@CR:C6A00050028 @%%@AB@%5.1.3  The Include File%@AE@%%@EH@%%@NL@%
  3462.  
  3463. The include (.H) file produced by the Dialog Editor contains %@AB@%#define%@AE@%
  3464. statements that identify controls in dialog boxes.%@CR:C6A00050029 @%%@NL@%
  3465.  
  3466. When creating a dialog box, you can assign symbolic names to controls. You
  3467. use the symbolic names in your application's C source code to refer to the
  3468. controls. As a result of these assignments, the Dialog Editor produces a
  3469. header file containing %@AB@%#define%@AE@% statements such as the following:%@CR:C6A00050030 @%%@CR:C6A00050031 @%%@CR:C6A00050032 @%%@NL@%
  3470.  
  3471. %@AS@%  #define DI_OPTION1  102
  3472. %@AS@%  #define DI_OPTION2  103
  3473. %@AS@%  #define DI_OPTION3  104%@AE@%
  3474.  
  3475. By including the header file in your C source code with an %@AB@%#include%@AE@%
  3476. statement, you can refer to the controls by symbolic names, rather than
  3477. numeric values, as the following illustrates:  %@NL@%
  3478.  
  3479. %@AS@%  BOOL FAR PASCAL FirstDlgProc(hDlg, wMessage, wParam, lParam)
  3480. %@AS@%   .
  3481. %@AS@%   .
  3482. %@AS@%   .
  3483. %@AS@%  switch (wMessage)
  3484. %@AS@%  {
  3485. %@AS@%     case DI_OPTION1:
  3486. %@AS@%        /* Respond to Ok button here */
  3487. %@AS@%              break;        case DI_OPTION2:
  3488. %@AS@%       /* Respond to Cancel button here */
  3489. %@AS@%      break;
  3490. %@AS@%   .
  3491. %@AS@%  .
  3492. %@AS@%  .%@AE@%
  3493.  
  3494. You must include the header file in your application's resource script file
  3495. before including the dialog script. This is necessary because the dialog
  3496. script refers to the controls using the symbolic names instead of the
  3497. numeric values. For an example of including files, see Section 5.1.1, "The
  3498. Dialog Script."  %@NL@%
  3499.  
  3500. When assigning ID values to controls, you can assign any number you want;
  3501. however, there are some special guidelines for ID values 1 and 2.  %@NL@%
  3502.  
  3503.  
  3504. %@4@%%@AB@%ID Value of 1%@AE@%%@EH@%%@NL@%
  3505.  
  3506. When the user presses ENTER, Windows automatically sends a WM_COMMAND
  3507. message to the dialog-input function. If the dialog box has a default button
  3508. (for example, the OK button), pressing ENTER sends a WM_COMMAND message with
  3509. the ID value. If you have a default OK button, you should assign it an ID
  3510. value of 1 so that it is activated when the user presses ENTER. This is
  3511. consistent with the recommended guidelines for creating a Windows
  3512. application set forth in %@AI@%Guide to Programming%@AE@%.  %@NL@%
  3513.  
  3514. Windows defines the ID value of 1 as IDOK.  %@NL@%
  3515.  
  3516.  
  3517. %@4@%%@AB@%ID Value of 2%@AE@%%@EH@%%@NL@%
  3518.  
  3519. When the user presses CANCEL or ESCAPE, Windows automatically sends a
  3520. WM_COMMAND message with the ID value of 2. If you have a Cancel button in a
  3521. dialog box, it should have an ID value of 2.%@CR:C6A00050033 @%%@NL@%
  3522.  
  3523. Windows defines the ID value of 2 as IDCANCEL.  %@NL@%
  3524.  
  3525.  
  3526. %@2@%%@CR:C6A00050034 @%%@AB@%5.2  Installing and Removing Custom Controls%@AE@%%@EH@%%@NL@%
  3527.  
  3528. The Dialog Editor provides a menu and toolbox of standard controls─such as
  3529. edit fields and list boxes─that you can select when designing a dialog box.
  3530. In addition, you can incorporate nonstandard custom controls into a dialog
  3531. box.%@CR:C6A00050035 @%%@CR:C6A00050036 @%%@NL@%
  3532.  
  3533. You can develop or acquire any number of custom controls and maintain them
  3534. in a catalog recognized by the Dialog Editor. A custom control consists of a
  3535. dynamic-link library (DLL) that contains the window procedure for the
  3536. control. The DLL also contains functions that interact with the Dialog
  3537. Editor. For more information on developing custom controls, see %@AI@%Guide to
  3538. %@AI@%Programming%@AE@%.%@CR:C6A00050037 @%%@CR:C6A00050038 @%%@NL@%
  3539.  
  3540. The Dialog Editor maintains the catalog of custom controls in your WIN.INI
  3541. file under the heading [User Controls]. Each entry equates the name of a
  3542. custom control with the full pathname of the control's DLL file, as shown in
  3543. the following example:%@CR:C6A00050039 @%%@NL@%
  3544.  
  3545. %@AS@%  [user controls]
  3546. %@AS@%  rainbow = c:\myctrls\rainbow.dll%@AE@%
  3547.  
  3548. The Dialog Editor lets you add and remove custom controls from this catalog.
  3549. %@NL@%
  3550.  
  3551.  
  3552. %@3@%%@CR:C6A00050040 @%%@AB@%5.2.1  Installing a Custom Control%@AE@%%@EH@%%@NL@%
  3553.  
  3554. To install a custom control in the catalog, do the following:  %@NL@%
  3555.  
  3556.  
  3557.   1.  Choose the Add Custom Control command from the File menu.%@NL@%
  3558.  
  3559.   2.  Specify the full pathname of the DLL file that defines your custom
  3560.       control.%@CR:C6A00050041 @%%@NL@%
  3561.  
  3562.  
  3563. If you want to call up a custom control only during a Dialog Editor session,
  3564. without permanently adding it to your custom control catalog, then select
  3565. the Create Temporary Control radio button in the Add Control dialog box.%@CR:C6A00050042 @%%@NL@%
  3566.  
  3567. For information on working with custom controls, see Section 5.5, "Editing
  3568. Dialog Box Controls."  %@NL@%
  3569.  
  3570.  
  3571. %@3@%%@CR:C6A00050043 @%%@AB@%5.2.2  Removing a Custom Control%@AE@%%@EH@%%@NL@%
  3572.  
  3573. To remove a custom control from the catalog, choose the Remove Control
  3574. command from the File menu. The editor displays a Remove Control Library
  3575. dialog box that lists custom controls you can remove.%@CR:C6A00050044 @%%@NL@%
  3576.  
  3577.  
  3578. %@2@%%@CR:C6A00050045 @%%@AB@%5.3  Viewing a Dialog Box: The Dialog Editor Window%@AE@%%@EH@%%@NL@%
  3579.  
  3580. Figure 5.2 illustrates the Dialog Editor window after a user has loaded a
  3581. dialog box and has chosen the Toolbox and Status commands from the Options
  3582. menu.%@CR:C6A00050046 @%%@NL@%
  3583.  
  3584. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3585.  
  3586. The menu bar contains the following menus:%@CR:C6A00050047 @%%@NL@%
  3587.  
  3588. %@TH:  95  3875 02 34 42 @%
  3589. Menu                              Commands
  3590. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3591. File                              This menu contains the following 
  3592.                                   commands:
  3593.  
  3594.                                   New─Creates .DLG and companion .RES 
  3595.                                   files
  3596.  
  3597.                                   Open─Opens existing .RES files for 
  3598.                                   editing
  3599.  
  3600.                                   Save and Save As─Save changes to a 
  3601.                                   dialog boxes
  3602.  
  3603.                                   Add Custom Control and Remove Custom 
  3604.                                   Control─Adds and removes members of your
  3605.                                   custom control catalog
  3606.  
  3607.                                   Exit─Exits the editor
  3608.  
  3609. Include                           This menu contains the following 
  3610.                                   commands:
  3611.  
  3612.                                   New─Creates a new include file
  3613.  
  3614.                                   Open─Opens an existing include file
  3615.  
  3616.                                   Save and Save As─Save changes to include
  3617.                                   files
  3618.  
  3619.                                   View/Edit─Displays and edits include 
  3620.                                   files
  3621.  
  3622.                                   Hex Values─Toggles the display of 
  3623.                                   hexadecimal and 
  3624.                                   decimal values in include files
  3625.  
  3626. Dialog                            This menu contains the following 
  3627.                                   commands:
  3628.  
  3629.                                   New─Creates a new dialog box
  3630.  
  3631.                                   View─Lists current dialog boxes in the 
  3632.                                   resource file 
  3633.  
  3634.                                   Flags─Sets memory flags
  3635.  
  3636.                                   Groups─Sets tab stops and group markers
  3637.  
  3638.                                   Rename─Renames the current dialog box
  3639.  
  3640.                                   Test─Toggles work and test modes to 
  3641.                                   allow you to test your dialog box
  3642.  
  3643. Edit                              This menu contains the following 
  3644.                                   commands:
  3645.  
  3646.                                   Restore─Reverts to last saved version of
  3647.                                   a dialog box
  3648.  
  3649.                                   Cut─Moves a dialog box to the clipboard
  3650.  
  3651.                                   Copy─Copies a dialog box to the 
  3652.                                   clipboard
  3653.  
  3654.                                   Paste─Copies a dialog box from the 
  3655.                                   clipboard
  3656.  
  3657.                                   Erase Dialog─Removes a dialog box
  3658.  
  3659.                                   Styles─Changes the style of a control or
  3660.                                   dialog box
  3661.  
  3662.                                   Group Mode─Allows you to move a group of
  3663.                                   controls as a unit
  3664.  
  3665.                                   Duplicate Mode─Allows you to duplicate 
  3666.                                   controls by dragging them
  3667.  
  3668. Control                           This menu contains different types of 
  3669.                                   controls that you can select for the 
  3670.                                   dialog box. 
  3671.  
  3672. Options                           This menu contains the following 
  3673.                                   commands:
  3674.  
  3675.                                   Status─Displays and hides the Selected 
  3676.                                   Item Status window
  3677.  
  3678.                                   Toolbox─Displays and hides the Toolbox 
  3679.                                   window
  3680.  
  3681.                                   Grid─Allows you to specify grid 
  3682.                                   increments for aligning controls
  3683.  
  3684. %@TE:  95  3875 02 34 42 @%
  3685.  
  3686.  
  3687. %@3@%%@CR:C6A00050048 @%%@AB@%5.3.1  The Mode Display%@AE@%%@EH@%%@NL@%
  3688.  
  3689. Beneath the menu bar, the Dialog Editor displays the mode you are currently
  3690. using. The modes are as follows:  %@NL@%
  3691.  
  3692. %@TH:  14   693 02 34 42 @%
  3693. Mode                              Meaning
  3694. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3695. Work                              Indicates you are creating or modifying 
  3696.                                   a dialog box
  3697.  
  3698. Test                              Indicates you are testing a box 
  3699.  
  3700. Work/Group                        Indicates that you are in the process of
  3701.                                   selecting and moving a group of controls
  3702.  
  3703. Work/Copy                         Indicates that you are in the process of
  3704.                                   duplicating 
  3705.                                   controls %@CR:C6A00050049 @%
  3706.  
  3707. %@TE:  14   693 02 34 42 @%
  3708.  
  3709.  
  3710. %@3@%%@CR:C6A00050050 @%%@AB@%5.3.2  The Toolbox%@AE@%%@EH@%%@NL@%
  3711.  
  3712. The Toolbox is a convenient alternative to choosing controls from the
  3713. Control menu. Initially, the Dialog Editor does not display the Toolbox. If
  3714. you choose the Toolbox command in the Options menu, the editor displays the
  3715. toolbox in the upper-right corner of the window.%@CR:C6A00050051 @%%@CR:C6A00050052 @%%@NL@%
  3716.  
  3717. You can move the Toolbox by dragging its title bar.  %@NL@%
  3718.  
  3719.  
  3720. %@3@%%@CR:C6A00050053 @%%@AB@%5.3.3  The Selected Item Status Window%@AE@%%@EH@%%@NL@%
  3721.  
  3722. When you choose the Status command from the Options menu, the Dialog Editor
  3723. displays the Selected Item Status window in the lower-right corner of the
  3724. Dialog Editor window. You can move the Selected Item Status window or close
  3725. it by choosing the Status command from the Options menu a second time. The
  3726. window supplies the following information about the currently displayed
  3727. dialog box and its controls:%@CR:C6A00050054 @%%@CR:C6A00050055 @%%@CR:C6A00050056 @%%@NL@%
  3728.  
  3729. %@TH:  22  1176 02 34 42 @%
  3730. Field                             Description
  3731. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3732. Dialog                            The name of the dialog box being edited.
  3733.  
  3734. (x, y)                            Position of the upper-left corner of the
  3735.                                   selected dialog box or control.
  3736.  
  3737. (cx, cy)                          Offset of the selected dialog box or 
  3738.                                   control.
  3739.  
  3740. Control                           Type of control selected (for example, 
  3741.                                   Radio Button or Check Box). If the 
  3742.                                   dialog box itself is selected, the 
  3743.                                   editor displays "Dialog Box" in this 
  3744.                                   field.
  3745.  
  3746. ID Value                          Identifier of the selected control. The 
  3747.                                   identifier is displayed 
  3748.                                   as either a number or a symbol. If the 
  3749.                                   dialog box is selected instead of a 
  3750.                                   control, no ID value is shown.
  3751.  
  3752. %@TE:  22  1176 02 34 42 @%
  3753.  
  3754. Size and position values are given in horizontal and vertical dialog units.
  3755. The horizontal units are 1/4 of the dialog base width unit; the vertical
  3756. units are 1/8 of the dialog base height unit. The current dialog base units
  3757. are computed from the height and width of the current system font. The
  3758. %@AB@%GetDialogBaseUnits%@AE@% function returns the dialog base units in pixels.%@CR:C6A00050057 @%%@CR:C6A00050058 @%%@NL@%
  3759.  
  3760. When you change the dialog box or controls, the window reflects the change.
  3761. %@NL@%
  3762.  
  3763.  
  3764. %@2@%%@CR:C6A00050059 @%%@AB@%5.4  Opening Files and Dialog Boxes%@AE@%%@EH@%%@NL@%
  3765.  
  3766. After invoking %@AB@%DIALOG%@AE@%, you can open the following:  %@NL@%
  3767.  
  3768.  
  3769.   ■   An existing or new resource file%@NL@%
  3770.  
  3771.   ■   An existing or new include file%@NL@%
  3772.  
  3773.   ■   An existing or new dialog box%@NL@%
  3774.  
  3775.  
  3776. Whenever you open a new resource or include file, the editor offers you the
  3777. opportunity of saving your previous work.%@CR:C6A00050060 @%%@NL@%
  3778.  
  3779.  
  3780. %@3@%%@CR:C6A00050061 @%%@AB@%5.4.1  Opening a Resource File%@AE@%%@EH@%%@NL@%
  3781.  
  3782. Using the File menu, you can either create a new resource file or open an
  3783. existing resource file.%@CR:C6A00050062 @%%@NL@%
  3784.  
  3785. If opening an existing resource file, you can specify an .RES file that
  3786. either the Dialog Editor or the Resource Compiler created.  %@NL@%
  3787.  
  3788.  
  3789. %@3@%%@CR:C6A00050063 @%%@AB@%5.4.2  Opening an Include File%@AE@%%@EH@%%@NL@%
  3790.  
  3791. After you load a resource file, Dialog Editor prompts you for an include
  3792. file. The include file associates symbolic names with control identifiers.%@CR:C6A00050064 @%%@CR:C6A00050065 @%%@NL@%
  3793.  
  3794. If you are already working with an include file, you can choose to continue
  3795. working with it or open a new one.  %@NL@%
  3796.  
  3797. If you loaded an existing resource file, the Dialog Editor displays the Open
  3798. File window. To edit an include file, choose one of the files listed.  %@NL@%
  3799.  
  3800.  
  3801. %@3@%%@CR:C6A00050066 @%%@AB@%5.4.3  Opening a Dialog Box%@AE@%%@EH@%%@NL@%
  3802.  
  3803. If you are loading an existing resource file, the Dialog Editor offers you
  3804. the choice of opening an existing dialog box. The editor displays a list of
  3805. dialog boxes available for editing in the View Dialog window. If you want to
  3806. create a new dialog box in the existing resource file, choose the Cancel
  3807. button from the View Dialog window.%@CR:C6A00050067 @%%@NL@%
  3808.  
  3809.  
  3810. %@4@%%@AB@%Opening an Existing Dialog Box%@AE@%%@EH@%%@NL@%
  3811.  
  3812. To open an existing dialog box, choose it from the list that the View Dialog
  3813. window displays. The dialog box appears in the working area of the Dialog
  3814. Editor window.%@CR:C6A00050068 @%%@NL@%
  3815.  
  3816.  
  3817. %@4@%%@AB@%Creating a New Dialog Box%@AE@%%@EH@%%@NL@%
  3818.  
  3819. To create a new dialog box, choose the New command from the Dialog menu. The
  3820. Dialog Editor prompts you for a dialog box name.%@CR:C6A00050069 @%%@CR:C6A00050070 @%%@CR:C6A00050071 @%%@NL@%
  3821.  
  3822.  
  3823. %@2@%%@CR:C6A00050072 @%%@AB@%5.5  Editing Dialog Box Controls%@AE@%%@EH@%%@NL@%
  3824.  
  3825. The Dialog Editor lets you add, modify, and delete dialog box controls,
  3826. which are described in Table 5.1.  %@NL@%
  3827.  
  3828. Table 5.1  Dialog Box Controls
  3829.  
  3830. %@TH:  66  4516 02 23 26 27 @%
  3831. Control                Illustration              Description
  3832. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3833. Push button            %@AU@%(Please refer to the %@AE@%     Push buttons let the user
  3834.                        %@AU@%printed book)%@AE@%             choose an immediate 
  3835.                                                  action, such as canceling
  3836.                                                  the dialog box. %@CR:C6A00050073 @% %@CR:C6A00050074 @%
  3837.  
  3838. Radio button           %@AU@%(Please refer to the %@AE@%     Radio buttons are 
  3839.                        %@AU@%printed book)%@AE@%             typically used in groups 
  3840.                                                  to give the user a choice
  3841.                                                  of selections. The user 
  3842.                                                  can select only one radio
  3843.                                                  button in a group at a 
  3844.                                                  time.%@CR:C6A00050075 @% %@CR:C6A00050076 @%
  3845.  
  3846. Check box              %@AU@%(Please refer to the %@AE@%     Check boxes are 
  3847.                        %@AU@%printed book)%@AE@%             independent of one 
  3848.                                                  another, although two or 
  3849.                                                  more often appear next to
  3850.                                                  each other to give the 
  3851.                                                  user a choice of 
  3852.                                                  selections. The user can 
  3853.                                                  turn any number of check 
  3854.                                                  boxes on or off at a 
  3855.                                                  given moment. %@CR:C6A00050077 @% %@CR:C6A00050078 @%
  3856.  
  3857. Horizontal scroll bar  %@AU@%(Please refer to the %@AE@%     Scroll bars let the user 
  3858.                        %@AU@%printed book)%@AE@%             scroll data. They are 
  3859.                                                  usually associated with 
  3860.                                                  another control or window
  3861.                                                  that 
  3862.                                                  contains text or graphics.
  3863.                                                  %@CR:C6A00050079 @% %@CR:C6A00050080 @% %@CR:C6A00050081 @% 
  3864.  
  3865. Vertical scroll bar    %@AU@%(Please refer to the %@AE@%
  3866.                        %@AU@%printed book)%@AE@%
  3867.  
  3868. Edit                   %@AU@%(Please refer to the %@AE@%     Edit controls display 
  3869.                        %@AU@%printed book)%@AE@%             both numbers and text, 
  3870.                                                  and let the user type in 
  3871.                                                  
  3872.                                                  numbers and text. %@CR:C6A00050082 @%%@CR:C6A00050083 @% 
  3873.  
  3874. Static text            %@AU@%(Please refer to the %@AE@%     Static text controls 
  3875.                        %@AU@%printed book)%@AE@%             label other 
  3876.                                                  controls, such as edit 
  3877.                                                  controls. %@CR:C6A00050084 @% %@CR:C6A00050085 @% 
  3878.  
  3879. Group box              %@AU@%(Please refer to the %@AE@%     Group boxes enclose a 
  3880.                        %@AU@%printed book)%@AE@%             collection or group of 
  3881.                                                  other controls, such as a
  3882.                                                  group of radio buttons. %@CR:C6A00050086 @% %@CR:C6A00050087 @%
  3883.  
  3884. List box               %@AU@%(Please refer to the %@AE@%     List boxes display a list
  3885.                        %@AU@%printed book)%@AE@%             of strings, such as file 
  3886.                                                  or directory names. %@CR:C6A00050088 @% %@CR:C6A00050089 @% 
  3887.  
  3888. Combo box              %@AU@%(Please refer to the %@AE@%     Combo boxes combine list 
  3889.                        %@AU@%printed book)%@AE@%             boxes with edit controls.
  3890.                                                  %@CR:C6A00050090 @% %@CR:C6A00050091 @%
  3891.  
  3892. Frame                  %@AU@%(Please refer to the %@AE@%     A hollow rectangle you 
  3893.                        %@AU@%printed book)%@AE@%             can use to frame a 
  3894.                                                  control or group of 
  3895.                                                  controls. %@CR:C6A00050092 @% %@CR:C6A00050093 @% 
  3896.  
  3897. %@TE:  66  4516 02 23 26 27 @%
  3898.  
  3899. Table 5.1  Dialog Box Controls (continued)
  3900.  
  3901. %@TH:  18  1225 02 11 32 33 @%
  3902. Control    Illustration                    Description
  3903. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3904. Icon       %@AU@%(Please refer to the printed %@AE@%   A rectangular space in which 
  3905.            %@AU@%book)%@AE@%                           you can place an icon. Do not 
  3906.                                            size the icon space; icons 
  3907.                                            automatically size themselves. %@CR:C6A00050094 @%
  3908.                                            %@CR:C6A00050095 @% 
  3909.  
  3910. Rectangle  %@AU@%(Please refer to the printed %@AE@%   A filled rectangle you can use 
  3911.            %@AU@%book)%@AE@%                           for graphical emphasis. %@CR:C6A00050096 @% %@CR:C6A00050097 @% 
  3912.  
  3913. Custom                                     A control you design and define
  3914.                                            in a DLL file. See Section 5.2,
  3915.                                            "Installing and Removing Custom
  3916.                                            Controls." %@CR:C6A00050098 @%%@CR:C6A00050099 @% %@CR:C6A00050100 @%
  3917.  
  3918. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3919.  
  3920. %@TE:  18  1225 02 11 32 33 @%
  3921.  
  3922.  
  3923. %@3@%%@CR:C6A00050101 @%%@AB@%5.5.1  Adding Controls%@AE@%%@EH@%%@NL@%
  3924.  
  3925. The Dialog Editor lets you choose the controls you want to add to a dialog
  3926. box from either the Control menu or the Toolbox. The Toolbox displays an
  3927. icon for each control.%@CR:C6A00050102 @%%@NL@%
  3928.  
  3929.  
  3930. %@4@%%@AB@%Enabling the Toolbox%@AE@%%@EH@%%@NL@%
  3931.  
  3932. To enable the Toolbox, choose the Toolbox command from the Options menu. The
  3933. Dialog Editor displays the Toolbox in the upper-right section of the Dialog
  3934. Editor window. You can move the Toolbox by dragging its title bar.%@CR:C6A00050103 @%%@CR:C6A00050104 @%%@CR:C6A00050105 @%%@NL@%
  3935.  
  3936.  
  3937. %@4@%%@AB@%Adding Standard Controls%@AE@%%@EH@%%@NL@%
  3938.  
  3939. To add standard controls to a dialog box, do the following:  %@NL@%
  3940.  
  3941.  
  3942.   1.  Choose the control you want to add from either the Control menu or the
  3943.       Toolbox. %@NL@%
  3944.  
  3945. %@STUB@%      Choosing either a control command in the Control menu or a control
  3946.       icon in the Toolbox changes the cursor to a plus sign (+). %@NL@%
  3947.  
  3948.   2.  Position the cursor where you want to add the control.%@NL@%
  3949.  
  3950.   3.  Click the mouse button. %@NL@%
  3951.  
  3952.  
  3953. If the control includes text, add the text using the method described in
  3954. Section 5.5.2, "Working with Individual Controls."  %@NL@%
  3955.  
  3956.  
  3957. %@4@%%@AB@%Adding Custom Controls%@AE@%%@EH@%%@NL@%
  3958.  
  3959. After you have installed a custom control using the procedure described in
  3960. Section 5.2.1, "Installing a Custom Control," the control is accessible in
  3961. the Control menu and the Toolbox. To add the custom control to a dialog box,
  3962. choose either the Custom Control command from the Control menu or the Custom
  3963. Control icon from the Toolbox. The Dialog Editor displays the Select Custom
  3964. Control dialog box illustrated in Figure 5.3.%@CR:C6A00050106 @%%@NL@%
  3965.  
  3966. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3967.  
  3968. The window lets you select and view a specified custom control. To complete
  3969. the selection, choose the OK button.  %@NL@%
  3970.  
  3971. You can specify the styles for custom controls as you would standard
  3972. controls. For information about editing controls, see the next section.  %@NL@%
  3973.  
  3974.  
  3975. %@3@%%@CR:C6A00050107 @%%@AB@%5.5.2  Working with Individual Controls%@AE@%%@EH@%%@NL@%
  3976.  
  3977. The Dialog Editor lets you make changes to individual controls, as follows:
  3978. %@NL@%
  3979.  
  3980.  
  3981.   ■   Moving a control%@NL@%
  3982.  
  3983.   ■   Resizing a control%@NL@%
  3984.  
  3985.   ■   Changing control identifiers and styles%@NL@%
  3986.  
  3987.   ■   Adding or changing text associated with a control%@NL@%
  3988.  
  3989.   ■   Duplicating a control%@NL@%
  3990.  
  3991.   ■   Deleting a control
  3992. %@NL@%
  3993.  
  3994.  
  3995.  
  3996. %@4@%%@AB@%Moving a Control%@AE@%%@EH@%%@NL@%
  3997.  
  3998. The Dialog Editor lets you move individual controls. Use the mouse to drag a
  3999. control to its new position and the DIRECTION keys to make fine adjustments
  4000. to the control position.%@CR:C6A00050108 @%%@NL@%
  4001.  
  4002. The DIRECTION keys let you move a control horizontally and vertically by
  4003. dialog units. (For a description of dialog units, see Section 5.3.3, "The
  4004. Selected Item Status Window.") By default, controls move one dialog unit
  4005. each time you press a DIRECTION key. To change the distance moved, choose
  4006. the Grid command from the Options menu. The Grid command lets you specify
  4007. the number of dialog units moved along the %@AI@%x%@AE@% and %@AI@%y%@AE@% axes. If you choose new
  4008. grid coordinates after you have placed a control, the control will align
  4009. with the new grid coordinates when you move it.%@CR:C6A00050109 @%%@NL@%
  4010.  
  4011. For information about moving groups of controls, see Section 5.6, "Working
  4012. with Groups of Controls."  %@NL@%
  4013.  
  4014.  
  4015. %@4@%%@AB@%Resizing a Control%@AE@%%@EH@%%@NL@%
  4016.  
  4017. To change the size of a control, do the following:  %@NL@%
  4018.  
  4019.  
  4020.   1.  Select the control.%@NL@%
  4021.  
  4022.   2.  Drag one of the eight small rectangles that appear on the boundaries. %@CR:C6A00050110 @%%@CR:C6A00050111 @%%@NL@%
  4023.  
  4024.  
  4025. Dragging one of the corner rectangles changes the width and height of the
  4026. control simultaneously.  %@NL@%
  4027.  
  4028. The Grid command in the Options menu also affects how a control is resized.
  4029. When you resize the control, it will automatically size to the nearest grid
  4030. coordinate. However, if you select new grid coordinates and then resize the
  4031. control, the size of the control will change in increments of the grid
  4032. coordinates, but relative to the control's current position. The control
  4033. itself will not move when you resize it, even though it may no longer be
  4034. aligned with the grid. To ensure that a control aligns with new grid
  4035. coordinates, you must move the control.  %@NL@%
  4036.  
  4037.  
  4038. %@4@%%@AB@%Changing Control Identifiers and Styles%@AE@%%@EH@%%@NL@%
  4039.  
  4040. To change the identifier or style of a control, do the following:%@CR:C6A00050112 @%%@CR:C6A00050113 @%%@CR:C6A00050114 @%%@NL@%
  4041.  
  4042.  
  4043.   1.  Double-click the control, or select the control and choose the Styles
  4044.       command from the Edit menu. %@NL@%
  4045.  
  4046. %@STUB@%      The Dialog Editor displays a window that lists the identifier, text,
  4047.       and style of the control selected. Figure 5.4 illustrates the Button
  4048.       Control Style dialog box.%@CR:C6A00050115 @%%@CR:C6A00050116 @%%@CR:C6A00050117 @%%@NL@%
  4049.  
  4050. %@STUB@%      %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4051.  
  4052.   2.  To change the identifier, type the new identifier in the ID Value box.
  4053.       %@NL@%
  4054.  
  4055. %@STUB@%      If you supply a symbolic name instead of a numeric value, the Dialog
  4056.       Editor checks to determine whether or not you have already defined the
  4057.       name in the current include file. If you have not, the editor offers
  4058.       you the option of adding the name.%@NL@%
  4059.  
  4060.   3.  To change the style of a control, select the styles you want in the
  4061.       Styles box.%@NL@%
  4062.  
  4063.  
  4064.  
  4065. %@4@%%@AB@%Adding or Changing Text%@AE@%%@EH@%%@NL@%
  4066.  
  4067. In addition to changing identifiers and styles, the Style window lets you
  4068. add or modify text associated with a control.%@CR:C6A00050118 @%%@CR:C6A00050119 @%%@CR:C6A00050120 @%%@NL@%
  4069.  
  4070. To add or modify text, type the text in the Text box.  %@NL@%
  4071.  
  4072. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4073. NOTE
  4074.  
  4075. %@AI@%When you add an icon control to a dialog box, the names of the control and
  4076. %@AI@%the identifier in the .RC file should be the same. For example, if the .RC
  4077. %@AI@%file defines an icon as "myicon", name the control "myicon" also.%@AE@%
  4078. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4079.  
  4080.  
  4081. %@4@%%@AB@%Duplicating A Control%@AE@%%@EH@%%@NL@%
  4082.  
  4083. You can copy a control from an existing control in your dialog box by using
  4084. either of the following methods:  %@NL@%
  4085.  
  4086.  
  4087.   ■   Drag the original control while holding down the CONTROL key. The Mode
  4088.       Display beneath the menu bar indicates "Work/Copy" during this
  4089.       operation. A copy of the original control follows the cursor until you
  4090.       release the drag.%@CR:C6A00050121 @%%@CR:C6A00050122 @%%@NL@%
  4091.  
  4092.   ■   Choose the Duplicate Controls command from the Edit menu. While
  4093.       Duplicate Controls is selected, the Mode Display beneath the menu bar
  4094.       indicates "Work/Copy." In this mode, the effect of dragging a control
  4095.       is to duplicate it, rather than move it. To cancel this mode, toggle
  4096.       it by choosing the Duplicate Controls command again.%@NL@%
  4097.  
  4098.  
  4099.  
  4100. %@4@%%@AB@%Deleting A Control%@AE@%%@EH@%%@NL@%
  4101.  
  4102. To delete a control, select it and press the DELETE key or choose the Clear
  4103. Control command from the Edit menu. The Dialog Editor deletes the selected
  4104. control from the dialog box.%@CR:C6A00050123 @%%@CR:C6A00050124 @%%@NL@%
  4105.  
  4106.  
  4107. %@2@%%@CR:C6A00050125 @%%@AB@%5.6  Working with Groups of Controls%@AE@%%@EH@%%@NL@%
  4108.  
  4109. The Dialog Editor lets you do the following with groups of controls:  %@NL@%
  4110.  
  4111.  
  4112.   ■   Move controls as a group%@NL@%
  4113.  
  4114.   ■   Define the input focus sequence of a group
  4115. %@NL@%
  4116.  
  4117.  
  4118.  
  4119. %@3@%%@CR:C6A00050126 @%%@AB@%5.6.1  Moving Groups of Controls%@AE@%%@EH@%%@NL@%
  4120.  
  4121. To move a group of controls, do the following:  %@NL@%
  4122.  
  4123.  
  4124.   1.  Choose the Group Move command from the Edit menu. %@NL@%
  4125.  
  4126. %@STUB@%      The work mode will indicate "Work/Group."%@NL@%
  4127.  
  4128.   2.  Click each control in the group you want to move. %@NL@%
  4129.  
  4130. %@STUB@%      The editor outlines each control you select, and the group itself,
  4131.       with a gray line.%@CR:C6A00050127 @% %@CR:C6A00050128 @%%@NL@%
  4132.  
  4133.   3.  Click the mouse button while pointing to a location in the group
  4134.       rectangle not occupied by one of the controls.%@NL@%
  4135.  
  4136.   4.  While holding down the mouse button, drag the group of controls to a
  4137.       new position.%@NL@%
  4138.  
  4139.   5.  Cancel the "Work/Group" mode by toggling the Group Move command in the
  4140.       Edit menu.%@NL@%
  4141.  
  4142.  
  4143. You must select %@AI@%all%@AE@% the controls you want to move, even if one control
  4144. encloses another. For instance, to move several radio buttons and the group
  4145. box that encloses them, you must select each radio button %@AI@%and%@AE@% the group box,
  4146. and then move them as a unit.  %@NL@%
  4147.  
  4148.  
  4149. %@3@%%@CR:C6A00050129 @%%@AB@%5.6.2  Defining Input Focus Sequence%@AE@%%@EH@%%@NL@%
  4150.  
  4151. The Groups command in the Dialog menu lets you specify the input focus
  4152. sequence in a group of controls, as follows:%@CR:C6A00050130 @%%@CR:C6A00050131 @%%@NL@%
  4153.  
  4154.  
  4155.   ■   Specify the controls forming a group. A group defines a sequence of
  4156.       controls within which the user can shift input focus by using the
  4157.       DIRECTION keys.%@NL@%
  4158.  
  4159.   ■   Specify tab stops that define how input shifts from group to group as
  4160.       the user presses the TAB key.%@NL@%
  4161.  
  4162.   ■   Specify the sequential order in which individual and groups of
  4163.       controls receive input focus as the user presses DIRECTION and TAB
  4164.       keys.%@NL@%
  4165.  
  4166.  
  4167. When you choose the Groups command, the Dialog Editor displays the Order
  4168. Groups window illustrated in Figure 5.5.  %@NL@%
  4169.  
  4170. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4171.  
  4172.  
  4173. %@4@%%@AB@%Defining a Group%@AE@%%@EH@%%@NL@%
  4174.  
  4175. To specify a group of controls, place a group marker before the first
  4176. control in the group and another after the last control, as follows:%@CR:C6A00050132 @%%@CR:C6A00050133 @%%@CR:C6A00050134 @%%@CR:C6A00050135 @%%@NL@%
  4177.  
  4178.  
  4179.   1.  Select the first control in the group.%@NL@%
  4180.  
  4181.   2.  Click the Group Marker button.%@NL@%
  4182.  
  4183. %@STUB@%      The Dialog Editor inserts a group marker above the control. %@NL@%
  4184.  
  4185.   3.  Select the control below the last control in the group.%@NL@%
  4186.  
  4187.   4.  Click the Group Marker button. %@NL@%
  4188.  
  4189. %@STUB@%      The Dialog Editor inserts a group marker below the last control in the
  4190.       group. This marker defines the beginning of the next group.%@NL@%
  4191.  
  4192.  
  4193. Placing a group marker before a control instructs the Dialog Editor to
  4194. assign the WS_GROUP style to the control.  %@NL@%
  4195.  
  4196. To delete a group marker, select the group marker and click the Delete Group
  4197. button.%@CR:C6A00050136 @%%@CR:C6A00050137 @%%@NL@%
  4198.  
  4199.  
  4200. %@4@%%@AB@%Setting and Deleting Tab Stops%@AE@%%@EH@%%@NL@%
  4201.  
  4202. Tab stops determine where input focus shifts when the user presses the TAB
  4203. key. Set or delete tab stops on individual controls, or on the first control
  4204. in a group, as follows:%@CR:C6A00050138 @%%@CR:C6A00050139 @%%@CR:C6A00050140 @%%@NL@%
  4205.  
  4206.  
  4207.   1.  Select the control on which you want to set or remove a tab stop.%@NL@%
  4208.  
  4209.   2.  Click the Tab Stop or Delete Tab button to set or delete a tab,
  4210.       respectively. %@NL@%
  4211.  
  4212.  
  4213. An asterisk appears next to each control on which a tab stop is set.  %@NL@%
  4214.  
  4215. Placing a tab stop on a control instructs the Dialog Editor to assign the
  4216. WS_TABSTOP style to the control.  %@NL@%
  4217.  
  4218.  
  4219. %@4@%%@AB@%Changing the Input Focus Sequence of Controls%@AE@%%@EH@%%@NL@%
  4220.  
  4221. By default, controls receive input focus in the order in which you place
  4222. them in the dialog box, not their position in the dialog box. Repositioning
  4223. controls does not affect the order in which they receive input focus.  %@NL@%
  4224.  
  4225. To change the order in which controls receive user input, reorder the
  4226. controls listed in the Order Groups window as follows:%@CR:C6A00050141 @%%@CR:C6A00050142 @%%@NL@%
  4227.  
  4228.  
  4229.   1.  Select the control you want to move.%@NL@%
  4230.  
  4231.   2.  Move the cursor to the position where you want the control to appear
  4232.       in the list box. %@NL@%
  4233.  
  4234. %@STUB@%      The cursor changes from an arrow to a short, horizontal bar. The bar
  4235.       appears only in places where you can insert the control.%@NL@%
  4236.  
  4237.   3.  Click the mouse button to insert the control.%@NL@%
  4238.  
  4239.  
  4240.  
  4241. %@2@%%@CR:C6A00050143 @%%@AB@%5.7  Working with a Dialog Box%@AE@%%@EH@%%@NL@%
  4242.  
  4243. In addition to adding, changing, and deleting controls in a dialog box, you
  4244. can do the following to the box as a whole:  %@NL@%
  4245.  
  4246.  
  4247.   ■   Change its size and name%@NL@%
  4248.  
  4249.   ■   Define its styles%@NL@%
  4250.  
  4251.   ■   Set flags that indicate how Windows stores the box in memory%@NL@%
  4252.  
  4253.   ■   Erase the box
  4254. %@NL@%
  4255.  
  4256.  
  4257.  
  4258. %@3@%%@CR:C6A00050144 @%%@AB@%5.7.1  Resizing a Dialog Box%@AE@%%@EH@%%@NL@%
  4259.  
  4260. To change the size of a dialog box, select it and drag one of its resize
  4261. handles.%@CR:C6A00050145 @%%@NL@%
  4262.  
  4263. For information about resizing a control, see Section 5.5.2, "Working with
  4264. Individual Controls."  %@NL@%
  4265.  
  4266. The Grid command in the Options menu affects how a dialog box is resized.
  4267. When you resize the dialog box, it will automatically size to the nearest
  4268. grid coordinate. However, the presence of the grid does not affect how a
  4269. dialog box is moved.  %@NL@%
  4270.  
  4271.  
  4272. %@3@%%@CR:C6A00050146 @%%@AB@%5.7.2  Renaming a Dialog Box%@AE@%%@EH@%%@NL@%
  4273.  
  4274. To rename a dialog box, do the following:%@CR:C6A00050147 @%%@NL@%
  4275.  
  4276.  
  4277.   1.  Choose the Rename command from the Dialog menu.%@NL@%
  4278.  
  4279.   2.  Enter the new name in the Name Dialog window.%@NL@%
  4280.  
  4281.  
  4282.  
  4283. %@3@%%@CR:C6A00050148 @%%@AB@%5.7.3  Defining Styles%@AE@%%@EH@%%@NL@%
  4284.  
  4285. To define the styles of a dialog box, do the following:%@CR:C6A00050149 @%%@CR:C6A00050150 @%%@NL@%
  4286.  
  4287.  
  4288.   1.  Select the dialog box.%@NL@%
  4289.  
  4290.   2.  Choose the Styles command from the Edit menu.%@NL@%
  4291.  
  4292.   3.  Select the relevant styles from the Dialog Box Styles window.%@NL@%
  4293.  
  4294.  
  4295.  
  4296. %@3@%%@CR:C6A00050151 @%%@AB@%5.7.4  Setting Memory Flags%@AE@%%@EH@%%@NL@%
  4297.  
  4298. To set memory flags for the currently displayed dialog box, do the
  4299. following:%@CR:C6A00050152 @%%@CR:C6A00050153 @%%@NL@%
  4300.  
  4301.  
  4302.   1.  Choose the Flags command from the Dialog menu.%@NL@%
  4303.  
  4304.   2.  Select the relevant memory flags from the Memory Flags window.%@NL@%
  4305.  
  4306.  
  4307. Memory flags are as follows:  %@NL@%
  4308.  
  4309.  
  4310.   ■   Moveable─Dialog resource data segment can be moved in memory if
  4311.       necessary to compact memory.%@NL@%
  4312.  
  4313.   ■   Preload─Dialog resource data segment is loaded immediately.%@NL@%
  4314.  
  4315.   ■   Discard─Dialog resource data segment can be discarded if no longer
  4316.       needed.%@NL@%
  4317.  
  4318.  
  4319. By default, dialog boxes are moveable, loaded on call rather than preloaded,
  4320. and discardable.  %@NL@%
  4321.  
  4322. For more information about memory flags, see %@AI@%Guide to Programming%@AE@% and the
  4323. %@AI@%Reference, Volume 2%@AE@%.  %@NL@%
  4324.  
  4325.  
  4326. %@3@%%@CR:C6A00050154 @%%@AB@%5.7.5  Canceling Edits%@AE@%%@EH@%%@NL@%
  4327.  
  4328. To cancel edits on a dialog box, use either the Restore or the Clear command
  4329. from the Edit menu. The Restore command cancels edits and reloads the
  4330. currently displayed dialog box. The Clear command removes the currently
  4331. displayed dialog box from the work area and the resource.%@CR:C6A00050155 @%%@CR:C6A00050156 @%%@NL@%
  4332.  
  4333.  
  4334. %@2@%%@CR:C6A00050157 @%%@AB@%5.8  Moving a Dialog Box Between Resources%@AE@%%@EH@%%@NL@%
  4335.  
  4336. To move a dialog box from one resource file to another, use the Cut, Copy,
  4337. and Paste commands from the Edit menu, as follows:%@CR:C6A00050158 @%%@NL@%
  4338.  
  4339.  
  4340.   1.  Cut or copy the currently displayed dialog box to the clipboard. %@NL@%
  4341.  
  4342. %@STUB@%      The Cut command removes the dialog box from the work area and copies
  4343.       the resource to the clipboard; the Copy command copies the box to the
  4344.       clipboard.%@NL@%
  4345.  
  4346.   2.  Load a new resource file into the Dialog Editor.%@NL@%
  4347.  
  4348.   3.  Paste the dialog box from the clipboard to the work area.%@NL@%
  4349.  
  4350.  
  4351. The Dialog Editor supports the clipboard bitmap format (CF_BITMAP) so that
  4352. other clipboard viewers can paste dialog box images. The editor also uses a
  4353. private clipboard format, "Dialog," for its own use. The Dialog Editor can
  4354. paste from the clipboard only if an instance of the Dialog Editor has
  4355. previously copied data to the clipboard in the private "Dialog" format.%@CR:C6A00050159 @%%@NL@%
  4356.  
  4357.  
  4358. %@2@%%@CR:C6A00050160 @%%@AB@%5.9  Working with Include Files%@AE@%%@EH@%%@NL@%
  4359.  
  4360. Dialog Editor lets you create and modify include files that define symbolic
  4361. names for controls.%@CR:C6A00050161 @%%@NL@%
  4362.  
  4363. This section describes the following:  %@NL@%
  4364.  
  4365.  
  4366.   ■   How to create new include files when editing a dialog box%@NL@%
  4367.  
  4368.   ■   How to load existing include files into the Dialog Editor%@NL@%
  4369.  
  4370.   ■   How to edit include files%@NL@%
  4371.  
  4372.   ■   How to save include files%@NL@%
  4373.  
  4374.  
  4375. Table 5.2 describes the commands used for editing include files.  %@NL@%
  4376.  
  4377. Table 5.2  Commands for Editing Include Files
  4378.  
  4379. %@TH:  19   899 02 34 42 @%
  4380. Command                           Description
  4381. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4382. New                               Creates a new include file.
  4383.  
  4384. Open                              Opens an existing include file.
  4385.  
  4386. Save                              Saves a specified include file.
  4387.  
  4388. Save As                           Renames an include file and saves it.
  4389.  
  4390. View/Edit                         Displays the View/Edit Include File 
  4391.                                   window. This window enables the user to 
  4392.                                   edit symbolic definitions for controls.
  4393.  
  4394. Hex Values                        Toggles the display of identifier values
  4395.                                   between decimal and hexidecimal.
  4396.  
  4397. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4398.  
  4399. %@TE:  19   899 02 34 42 @%
  4400.  
  4401. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4402. NOTE
  4403.  
  4404. %@AI@%The Dialog Editor works with include files that have only %@AB@%#define%@AE@%%@AI@%
  4405. %@AI@%directives. The Dialog Editor will not work with header files that contain
  4406. %@AI@%other directives, such as %@AE@%%@AI@%%@AB@%typedef%@AE@%%@AE@%%@AI@%, or comments preceded by a semicolon ( ;
  4407. %@AI@%). When the Dialog Editor saves the include file, it strips out any blank
  4408. %@AI@%lines that may have existed previously in the include file.%@AE@%%@AE@%
  4409.  
  4410. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4411.  
  4412.  
  4413. %@3@%%@CR:C6A00050162 @%%@AB@%5.9.1  Creating New Include Files%@AE@%%@EH@%%@NL@%
  4414.  
  4415. The Dialog Editor lets you create new include files to define symbol names
  4416. for controls in your dialog boxes. You can create new include files either
  4417. when you create a new resource file or when you are editing a dialog box.%@CR:C6A00050163 @%%@CR:C6A00050164 @%%@NL@%
  4418.  
  4419. Typically, you create a new include file when creating a new resource file.
  4420. After creating a new resource file using the method described in Section
  4421. 5.4.1, "Opening a Resource File," the Dialog Editor asks whether or not you
  4422. want to create a new include file.  %@NL@%
  4423.  
  4424. When creating a new include file, you can give it a name identical to the
  4425. resource filename. Giving the resource and include files identical names
  4426. causes the Dialog Editor to open the include file automatically each time
  4427. you load the corresponding resource file into the editor. If you give the
  4428. resource file and include file different filenames, the Dialog Editor
  4429. prompts you for the include file you want to open.  %@NL@%
  4430.  
  4431. If you want to create a new include file while you are editing a dialog box,
  4432. choose the New command from the Include menu.  %@NL@%
  4433.  
  4434.  
  4435. %@3@%%@CR:C6A00050165 @%%@AB@%5.9.2  Loading Existing Include Files%@AE@%%@EH@%%@NL@%
  4436.  
  4437. Just as you can create a new include file either when loading a resource
  4438. file at the beginning of an editing session or later when editing a dialog
  4439. box, you can load existing include files either at the beginning or during
  4440. your editing session.%@CR:C6A00050166 @%%@CR:C6A00050167 @%%@NL@%
  4441.  
  4442. Typically, you load an existing include file into the editor at the
  4443. beginning of an editing session. When you open a resource file at the
  4444. beginning of a session, the Dialog Editor automatically loads the
  4445. corresponding include file, if the file has the same name as the resource
  4446. file you open. If the include filename is different than the resource
  4447. filename, the editor asks you to select the include file you want to open.  %@NL@%
  4448.  
  4449. If you want to open an existing include file while you are editing a dialog
  4450. box, choose the Open command from the Include menu. The Dialog Editor
  4451. displays an Open File window that lists include files you can load.  %@NL@%
  4452.  
  4453.  
  4454. %@3@%%@CR:C6A00050168 @%%@AB@%5.9.3  Editing Include Files%@AE@%%@EH@%%@NL@%
  4455.  
  4456. You can edit an include file in the following ways:%@CR:C6A00050169 @%%@CR:C6A00050170 @%%@NL@%
  4457.  
  4458.  
  4459.   ■   Select individual controls and define their symbolic names.%@NL@%
  4460.  
  4461.   ■   Open the file and edit its symbolic names and identifiers.%@NL@%
  4462.  
  4463.  
  4464. The second method lets you define symbolic names for controls as you work
  4465. with them.%@CR:C6A00050171 @%%@NL@%
  4466.  
  4467.  
  4468. %@4@%%@AB@%Defining Names by Individual Control%@AE@%%@EH@%%@NL@%
  4469.  
  4470. Instead of opening an include file and editing it as a whole, you can define
  4471. symbolic names for individual controls as you work with them. The Dialog
  4472. Editor saves the names in the include file that you loaded into the editor.
  4473. %@NL@%
  4474.  
  4475. To define the symbolic name of an individual control as you are working with
  4476. it, do the following:  %@NL@%
  4477.  
  4478.  
  4479.   1.  Double-click the control. %@NL@%
  4480.  
  4481. %@STUB@%      The Dialog Editor displays a Style window.%@NL@%
  4482.  
  4483.   2.  Enter the symbolic name of the control in the ID Value field. %@NL@%
  4484.  
  4485. %@STUB@%      If you have not defined the symbolic name before, the Dialog Editor
  4486.       displays the following warning message: "That symbol does not exist."%@NL@%
  4487.  
  4488.   3.  Click the OK button in the Warning Message window. %@NL@%
  4489.  
  4490. %@STUB@%      The Dialog Editor displays the View/Edit Include File window with the
  4491.       symbolic name you have defined for the control.%@NL@%
  4492.  
  4493.   4.  Click the Add button to complete adding the symbolic name to the
  4494.       include file.%@NL@%
  4495.  
  4496.  
  4497.  
  4498. %@4@%%@AB@%Editing the File%@AE@%%@EH@%%@NL@%
  4499.  
  4500. To edit an include file, do the following:%@CR:C6A00050172 @%%@CR:C6A00050173 @%%@CR:C6A00050174 @%%@CR:C6A00050175 @%%@NL@%
  4501.  
  4502.  
  4503.   1.  Choose the View/Edit command from the Include menu. The editor
  4504.       displays the View/Edit Include File window.%@NL@%
  4505.  
  4506.   2.  Select the symbol you want to edit.%@NL@%
  4507.  
  4508.   3.  Make the change in the Symbol Name or ID Value text box.%@NL@%
  4509.  
  4510.   4.  Choose the Change button. %@NL@%
  4511.  
  4512.   5.  Select the symbol and choose the Delete command.%@NL@%
  4513.  
  4514.  
  4515.  
  4516. %@3@%%@CR:C6A00050176 @%%@AB@%5.9.4  Saving Include Files%@AE@%%@EH@%%@NL@%
  4517.  
  4518. When saving an include file, give the file a name identical to the name of
  4519. its corresponding resource file, if possible. If the resource file and
  4520. include file have the same name, the Dialog Editor loads the include file
  4521. automatically when you open its corresponding resource file.%@CR:C6A00050177 @%%@CR:C6A00050178 @%%@NL@%
  4522.  
  4523.  
  4524. %@2@%%@CR:C6A00050179 @%%@AB@%5.10  Summary%@AE@%%@EH@%%@NL@%
  4525.  
  4526. This chapter described the Dialog Editor, a tool that lets you design a
  4527. dialog box on the display screen instead of defining dialog statements in a
  4528. resource script file. For further information, see the following:  %@NL@%
  4529.  
  4530. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  4531. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4532. Resource file                     %@AI@%Tools%@AE@%: Chapter 3, "Compiling Resources: 
  4533. management                        The Resource Compiler"
  4534.  
  4535. Introduction to dialog boxes      %@AI@%Guide to Programming%@AE@%: Chapter 8, 
  4536.                                   "Controls," and Chapter 9, "Dialog 
  4537.                                   Boxes"
  4538.  
  4539. Memory flags                      %@AI@%Guide to Programming%@AE@%: Chapter 15, 
  4540.                                   "Memory
  4541.                                   Management" and %@AI@%Reference, Volume 2%@AE@%: 
  4542.                                   Chapter 8, "Resource Script Statements"
  4543.  
  4544. Control and dialog box styles     %@AI@%Reference, Volume 2%@AE@%: Chapter 8, 
  4545.                                   "Resource Script Statements"
  4546.  
  4547.                                   %@AI@%System Application Architecture, Common %@AE@%
  4548.                                   %@AI@%User Access: Advanced Interface Design %@AE@%
  4549.                                   %@AI@%Guide%@AE@%
  4550.  
  4551.  
  4552.  
  4553.  
  4554.  
  4555. %@CR:C6A00060001 @%%@1@%%@AB@%Chapter 6  Designing Fonts: The Font Editor%@AE@%%@EH@%%@NL@%
  4556. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4557.  
  4558. Microsoft Windows Font Editor (%@AB@%FONTEDIT%@AE@%) lets you modify existing fonts to
  4559. create new fonts for your applications. Using the Font Editor, you can
  4560. modify each character in a font, or the height, width, and character mapping
  4561. of a font itself. In addition, you can use the editor to update information
  4562. in the font file header.%@CR:C6A00060002 @%%@NL@%
  4563.  
  4564. This chapter describes the following:%@CR:C6A00060003 @%%@NL@%
  4565.  
  4566.  
  4567.   ■   Editing letters, numbers, and other characters in the font%@NL@%
  4568.  
  4569.   ■   Modifying the height, width, and character mapping of the font%@NL@%
  4570.  
  4571.   ■   Changing information in the font file header%@NL@%
  4572.  
  4573.  
  4574. You can use the Font Editor only to create and edit raster fonts.  %@NL@%
  4575.  
  4576. After creating a new font with the Font Editor, you must add the new font to
  4577. a font resource file.  %@NL@%
  4578.  
  4579. For information on creating vector fonts and adding fonts to the font
  4580. resource file, see the %@AI@%Reference, Volume 2%@AE@%.%@CR:C6A00060004 @%%@CR:C6A00060005 @%%@CR:C6A00060006 @%%@CR:C6A00060007 @%%@NL@%
  4581.  
  4582. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4583. NOTE
  4584.  
  4585. %@AI@%You must use a mouse or similar pointing device with the Font Editor.%@CR:C6A00060008 @%%@AE@%
  4586.  
  4587. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4588.  
  4589.  
  4590. %@2@%%@CR:C6A00060009 @%%@AB@%6.1  Opening a Font%@AE@%%@EH@%%@NL@%
  4591.  
  4592. To create a new font, you must open and edit an existing font. You cannot
  4593. create a new font from scratch. The font file you open must be in Windows
  4594. 2.0 or 3.0 format.%@CR:C6A00060010 @%%@CR:C6A00060011 @%%@NL@%
  4595.  
  4596. If you do not have an existing 2.0 or 3.0 font to edit, the SDK disks
  4597. provide two "seed" fonts that are installed in your Windows development
  4598. tools directory (named \WINDEV by default). The ATRM1111.FNT is a
  4599. fixed-pitch font, while the VGASYS.FNT is a variable-pitch font.  %@NL@%
  4600.  
  4601. After opening a font, the Font Editor displays the font, a specified
  4602. character, and information about the character. Figure 6.1 illustrates the
  4603. Font Editor window.  %@NL@%
  4604.  
  4605. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4606.  
  4607. The Font Editor window has the following features:%@CR:C6A00060012 @%%@CR:C6A00060013 @%%@CR:C6A00060014 @%%@CR:C6A00060015 @%%@NL@%
  4608.  
  4609. %@AB@%Feature%@AE@%                           %@AB@%Description%@AE@%
  4610. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4611. Character window                  Contains a copy of the character you 
  4612.                                   want to edit. A grid divides the window 
  4613.                                   into rectangles. Each rectangle 
  4614.                                   represents a pixel. %@CR:C6A00060016 @%%@CR:C6A00060017 @%
  4615.  
  4616. Character-viewing window          Displays two instances of the character 
  4617.                                   in its normal size. The 
  4618.                                   character-viewing window lets you 
  4619.                                   examine the effect of the changes you 
  4620.                                   make to the character. It also lets you 
  4621.                                   see external character leading, the 
  4622.                                   amount of vertical separation between 
  4623.                                   lines. %@CR:C6A00060018 @%%@CR:C6A00060019 @%
  4624.  
  4625. Character information             Displays the character ANSI value and 
  4626.                                   the character width and height in pixels.
  4627.                                   %@CR:C6A00060020 @% %@CR:C6A00060021 @% 
  4628.  
  4629. Font window                       Displays normal-size copies of the 
  4630.                                   characters in the font. This window is 
  4631.                                   moveable.%@CR:C6A00060022 @%
  4632.  
  4633. The following sections describe how to edit characters displayed in the Font
  4634. Editor window.  %@NL@%
  4635.  
  4636.  
  4637. %@2@%%@CR:C6A00060023 @%%@AB@%6.2  Editing Characters%@AE@%%@EH@%%@NL@%
  4638.  
  4639. The Font Editor lets you change characters. This section describes how to
  4640. change characters in the following ways:  %@NL@%
  4641.  
  4642.  
  4643.   ■   By turning on and off individual pixels%@NL@%
  4644.  
  4645.   ■   By adding and deleting columns or rows of pixels%@NL@%
  4646.  
  4647.   ■   By modifying specified blocks of pixels%@CR:C6A00060024 @%%@CR:C6A00060025 @%%@CR:C6A00060026 @%%@NL@%
  4648.  
  4649.   ■   By changing the width of a specified character, if the character
  4650.       belongs to a variable-pitch font%@CR:C6A00060027 @%%@NL@%
  4651.  
  4652. %@STUB@%      %@AI@%NOTE  %@AE@%When you select a new character for editing, the Font Editor
  4653.       updates the current workspace with the character you have edited. If
  4654.       you do not want to save your edits, make sure you cancel changes,
  4655.       using the Refresh command in the Edit menu, before you make the new
  4656.       selection. See Section 6.2.6, "Canceling Changes to a Character," for
  4657.       more information on the Refresh command. %@NL@%
  4658.  
  4659.  
  4660.  
  4661. %@3@%%@CR:C6A00060028 @%%@AB@%6.2.1  Turning Pixels On or Off%@AE@%%@EH@%%@NL@%
  4662.  
  4663. The Font Editor lets you change characters pixel by pixel. To turn a
  4664. character pixel on or off, point to the pixel and click the left mouse
  4665. button. To turn several pixels on or off, drag the cursor over the pixels
  4666. you want to change.%@CR:C6A00060029 @%%@CR:C6A00060030 @%%@CR:C6A00060031 @%%@CR:C6A00060032 @%%@NL@%
  4667.  
  4668.  
  4669. %@3@%%@CR:C6A00060033 @%%@AB@%6.2.2  Changing Rows and Columns of Pixels%@AE@%%@EH@%%@NL@%
  4670.  
  4671. The Font Editor lets you copy or delete rows and columns of pixels. The Row
  4672. and Column menus each contain Add and Delete commands.  %@NL@%
  4673.  
  4674.  
  4675. %@4@%%@AB@%Adding a Row or Column%@AE@%%@EH@%%@NL@%
  4676.  
  4677. The Font Editor adds rows and columns to a character by copying the row or
  4678. column you select. To add a row or column, do the following:  %@NL@%
  4679.  
  4680.  
  4681.   1.  Choose the Add command from the appropriate menu.%@NL@%
  4682.  
  4683.   2.  Select the row or column you want to delete by clicking on it.%@NL@%
  4684.  
  4685.  
  4686. The Font Editor duplicates the row or column selected.%@CR:C6A00060034 @%%@CR:C6A00060035 @%%@CR:C6A00060036 @%%@CR:C6A00060037 @%%@CR:C6A00060038 @%%@NL@%
  4687.  
  4688. When adding a new row, the Font Editor inserts it between the selected row
  4689. and the row immediately below it. The Font Editor pushes all rows below the
  4690. new row down one, and deletes the row at the bottom of the Character window.
  4691. Figure 6.2 illustrates selecting a row for addition to the character. Figure
  4692. 6.3 illustrates the character after the Font Editor has duplicated the row.%@CR:C6A00060039 @%%@CR:C6A00060040 @%%@CR:C6A00060041 @%%@CR:C6A00060042 @%%@NL@%
  4693.  
  4694. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4695.  
  4696. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4697.  
  4698. When adding a new column, the Font Editor inserts it between the selected
  4699. column and the one to its right. The Font Editor inserts the new column and
  4700. pushes all columns to its right one column to the right, and deletes the
  4701. column at the far right of the Character window. Figure 6.4 illustrates
  4702. selecting a column for addition to the character. Figure 6.5 illustrates the
  4703. character after the Font Editor has duplicated the column.  %@NL@%
  4704.  
  4705. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4706.  
  4707. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4708.  
  4709.  
  4710. %@4@%%@AB@%Deleting a Row or Column%@AE@%%@EH@%%@NL@%
  4711.  
  4712. To delete a row or column of pixels, do the following:  %@NL@%
  4713.  
  4714.  
  4715.   1.  Choose the Delete command from the appropriate menu.%@NL@%
  4716.  
  4717.   2.  Select the row or column you want to delete by clicking on it.%@NL@%
  4718.  
  4719.  
  4720. Deleting a row causes all rows below it to move up one, and causes the last
  4721. row in the Character window to be duplicated.%@CR:C6A00060043 @%%@CR:C6A00060044 @%%@CR:C6A00060045 @%%@CR:C6A00060046 @%%@CR:C6A00060047 @%%@CR:C6A00060048 @%%@NL@%
  4722.  
  4723. When you delete a whole column, all columns to the right of the deleted
  4724. column move left one, and the column at the far right of the Character
  4725. window is duplicated.  %@NL@%
  4726.  
  4727.  
  4728. %@3@%%@CR:C6A00060049 @%%@AB@%6.2.3  Modifying Blocks of Pixels%@AE@%%@EH@%%@NL@%
  4729.  
  4730. The Fill menu provides commands that let you select and change specified
  4731. blocks of pixels. The commands on the Fill menu are useful if you want to
  4732. modify a large number of pixels in the same way. For example, you can select
  4733. a block of pixels and fill all of them in one operation.%@CR:C6A00060050 @%%@CR:C6A00060051 @%%@CR:C6A00060052 @%%@NL@%
  4734.  
  4735. The Fill menu contains the following commands:  %@NL@%
  4736.  
  4737. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  4738. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4739. Clear                             Changes a specified block of pixels to 
  4740.                                   background pixels.
  4741.  
  4742. Solid                             Fills a specified block with foreground 
  4743.                                   pixels.
  4744.  
  4745. Hatched                           Creates alternate foreground and 
  4746.                                   background pixels in a specified block.
  4747.  
  4748. Inverted                          Changes foreground pixels to background 
  4749.                                   pixels, and vice versa, in a specified 
  4750.                                   block.
  4751.  
  4752. Left=Right                        Rotates a specified block horizontally 
  4753.                                   180 degrees.
  4754.  
  4755. Top=Bottom                        Rotates a specified block vertically 180
  4756.                                   degrees.
  4757.  
  4758. Copy                              Copies pixels in a specified block to 
  4759.                                   the clipboard.
  4760.  
  4761. Paste                             Fills a specified block with pixels from
  4762.                                   the clipboard.
  4763.  
  4764. If you are pasting pixels from the clipboard, be sure the area of the
  4765. Character window in which you want to paste is the same size as the block on
  4766. the clipboard. If you try to paste your data from the clipboard into an area
  4767. that is larger or smaller than the block, the Font Editor tries to stretch
  4768. or squeeze the block to fit.%@CR:C6A00060053 @%%@CR:C6A00060054 @%%@CR:C6A00060055 @%%@CR:C6A00060056 @%%@CR:C6A00060057 @%%@NL@%
  4769.  
  4770. The procedure for carrying out commands in the Fill menu is as follows:%@CR:C6A00060058 @%%@CR:C6A00060059 @%%@NL@%
  4771.  
  4772.  
  4773.   1.  Choose the relevant command from the menu.%@NL@%
  4774.  
  4775.   2.  Select the block of pixels you want to change.%@NL@%
  4776.  
  4777.  
  4778. The editor executes the relevant operation on all pixels within the
  4779. specified block.  %@NL@%
  4780.  
  4781.  
  4782. %@3@%%@CR:C6A00060060 @%%@AB@%6.2.4  Changing Character Width%@AE@%%@EH@%%@NL@%
  4783.  
  4784. Use the Width menu to change the width of a character belonging to a
  4785. variable-pitch font. Commands in the Width menu change the number of columns
  4786. in the character bitmap in the following ways:%@CR:C6A00060061 @%%@CR:C6A00060062 @%%@NL@%
  4787.  
  4788. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  4789. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4790. Wider (left)                      Adds a blank column to the left side of 
  4791.                                   the character. %@CR:C6A00060063 @% %@CR:C6A00060064 @%
  4792.  
  4793. Wider (right)                     Adds a blank column to the right side of
  4794.                                   the character.
  4795.  
  4796. Wider (both)                      Adds a blank column to each side of the 
  4797.                                   character.
  4798.  
  4799. Narrower (left)                   Deletes a column from the left side of 
  4800.                                   the character.
  4801.  
  4802. Narrower (right)                  Deletes a column from the right side of 
  4803.                                   the character.
  4804.  
  4805. Narrower (both)                   Deletes a column from each side of the 
  4806.                                   character.
  4807.  
  4808. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4809. NOTE
  4810.  
  4811. %@AI@%The width of a character can be changed only on variable-pitch fonts.%@CR:C6A00060065 @%%@AE@%
  4812.  
  4813. %@AI@%Characters in a variable-pitch font cannot be wider than the maximum
  4814. %@AI@%character width. If you try to make a character cell wider than the maximum
  4815. %@AI@%character width, a dialog box appears, warning you that the maximum
  4816. %@AI@%character width will increase. %@CR:C6A00060066 @%%@CR:C6A00060067 @%%@AE@%
  4817. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4818.  
  4819.  
  4820. %@3@%%@CR:C6A00060068 @%%@AB@%6.2.5  Storing Changes to a Character%@AE@%%@EH@%%@NL@%
  4821.  
  4822. You can store changes to a character by selecting it in the Font-viewing
  4823. window.%@CR:C6A00060069 @%%@CR:C6A00060070 @%%@NL@%
  4824.  
  4825. The Font Editor stores your selection by copying it back to the font buffer.
  4826. The Font-viewing window is updated to show the new character.  %@NL@%
  4827.  
  4828. You can also store changes to a character by making a new selection. The
  4829. Font Editor copies the old selection into the font buffer before copying the
  4830. new selection to the Character window. This is useful if you want to
  4831. continue editing characters in the same font.  %@NL@%
  4832.  
  4833.  
  4834. %@3@%%@CR:C6A00060071 @%%@AB@%6.2.6  Canceling Changes to a Character%@AE@%%@EH@%%@NL@%
  4835.  
  4836. To recover from an editing mistake, use either the Undo command or the
  4837. Refresh command from the Edit menu.%@CR:C6A00060072 @%%@NL@%
  4838.  
  4839. The Undo command restores the character window to its state before the last
  4840. change in the window.%@CR:C6A00060073 @%%@CR:C6A00060074 @%%@NL@%
  4841.  
  4842. The Undo command cannot cancel changes made to a character that you have
  4843. stored in the buffer.  %@NL@%
  4844.  
  4845. To cancel all changes you have made to a character, use the Refresh command
  4846. from the Edit menu. The Refresh command replaces the current character in
  4847. the character window with a copy from the Font window.  %@NL@%
  4848.  
  4849. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4850. NOTE
  4851.  
  4852. %@AI@%You cannot cancel changes to a character by selecting a new character.
  4853. %@AI@%Selecting a new character, or reselecting the current character, causes the
  4854. %@AI@%Font Editor to store all changes to the character in the font buffer. Only
  4855. %@AI@%the Refresh command cancels changes. %@AE@%
  4856. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4857.  
  4858.  
  4859. %@2@%%@CR:C6A00060075 @%%@AB@%6.3  Editing a Font%@AE@%%@EH@%%@NL@%
  4860.  
  4861. To change the height, width, and character-mapping ANSI value of a font, use
  4862. the Size command in the Font menu. The command displays a dialog box that
  4863. contains the following options:%@CR:C6A00060076 @%%@CR:C6A00060077 @%%@CR:C6A00060078 @%%@CR:C6A00060079 @%%@CR:C6A00060080 @%%@CR:C6A00060081 @%%@CR:C6A00060082 @%%@NL@%
  4864.  
  4865. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  4866. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4867. Character Pixel Height            Defines the height (in pixels) of the 
  4868.                                   characters in the font. %@CR:C6A00060083 @%
  4869.  
  4870. Maximum Width (variable-width     Defines the width (in pixels) of the 
  4871. fonts only)                       widest possible character in a 
  4872.                                   variable-pitch font. %@CR:C6A00060084 @%
  4873.  
  4874. Character Pixel Width             Defines the width (in pixels) of all 
  4875. (fixed-pitch fonts only)          characters in a fixed-pitch font. In 
  4876.                                   fixed-pitch fonts all characters have 
  4877.                                   equal width. %@CR:C6A00060085 @% 
  4878.  
  4879. First Character                   Defines the character value (for example,
  4880.                                   the ANSI value) of the first character 
  4881.                                   in the font. The first character is the 
  4882.                                   character to the far left when you 
  4883.                                   scroll the contents of the font-viewing 
  4884.                                   window to the far right. %@CR:C6A00060086 @%%@CR:C6A00060087 @% %@CR:C6A00060088 @%
  4885.  
  4886. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  4887. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4888. Last Character                    Defines the character value (for example,
  4889.                                   the ANSI value) of the last character in
  4890.                                   the font. The last character is the 
  4891.                                   character to the far right when you 
  4892.                                   scroll the contents of the font-viewing 
  4893.                                   window to the far left.%@CR:C6A00060089 @%%@CR:C6A00060090 @% 
  4894.  
  4895. Pitch  %@NL@%
  4896.  
  4897.                                   Defines the font as either Fixed or 
  4898.                                   Variable. Fixed and Variable are 
  4899.                                   mutually exclusive. %@CR:C6A00060091 @% %@CR:C6A00060092 @% %@CR:C6A00060093 @% %@CR:C6A00060094 @% %@CR:C6A00060095 @%%@CR:C6A00060096 @%
  4900.  
  4901.                                   You can change a font from fixed-pitch 
  4902.                                   to variable-pitch by selecting Variable 
  4903.                                   in the Size dialog box. You cannot 
  4904.                                   change a variable-pitch font to 
  4905.                                   fixed-pitch. 
  4906.  
  4907. Weight                            Lists options that define the font 
  4908.                                   weight, ranging from thin to heavy. Each
  4909.                                   option represents the specific degree of
  4910.                                   heaviness (i.e., thickness of stroke) of
  4911.                                   the font. The options are mutually 
  4912.                                   exclusive. %@CR:C6A00060097 @%%@CR:C6A00060098 @%
  4913.  
  4914.  
  4915. %@2@%%@CR:C6A00060099 @%%@AB@%6.4  Changing Font File Header Information%@AE@%%@EH@%%@NL@%
  4916.  
  4917. To change the information in the font file header, use the Header command in
  4918. the Font menu. The Header command displays a dialog box that contains the
  4919. following information about the font:%@CR:C6A00060100 @%%@CR:C6A00060101 @%%@CR:C6A00060102 @%%@CR:C6A00060103 @%%@NL@%
  4920.  
  4921. %@AB@%Item%@AE@%                              %@AB@%Description%@AE@%
  4922. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4923. Face Name                         The name used to distinguish the font 
  4924.                                   from other fonts. It is not necessarily 
  4925.                                   the same as the font filename. The face 
  4926.                                   name can be as many as 32 characters. %@CR:C6A00060104 @%
  4927.  
  4928. File Name                         The name of the font file being edited. %@CR:C6A00060105 @%
  4929.  
  4930. Copyright                         Either a copyright notice or additional 
  4931.                                   information about the font. It can be as
  4932.                                   many as 60 characters in length. %@CR:C6A00060106 @% 
  4933.  
  4934. Nominal Point Size                The point size of the characters in the 
  4935.                                   font. One point is equal to 
  4936.                                   approximately 1/72 of an inch. %@CR:C6A00060107 @% 
  4937.  
  4938. %@AB@%Item%@AE@%                              %@AB@%Description%@AE@%
  4939. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4940. Height of Ascent                  The distance (in pixels) from the top of
  4941.                                   an ascender to the baseline. %@CR:C6A00060108 @%
  4942.  
  4943. Nominal Vert.                     The vertical resolution at which the 
  4944. Resolution                        characters were digitized. %@CR:C6A00060109 @%
  4945.  
  4946. Nominal Horiz.                    The horizontal resolution at which the 
  4947. Resolution                        characters were digitized. %@CR:C6A00060110 @%
  4948.  
  4949. External Leading                  The pixel height of the external leading.
  4950.                                   External leading is the vertical 
  4951.                                   distance (in rows) from the bottom of 
  4952.                                   one character cell to the top of the 
  4953.                                   character cell below it. The 
  4954.                                   Character-viewing window shows two 
  4955.                                   copies of the character, one above the 
  4956.                                   other, so that you can see the effect of
  4957.                                   the leading. %@CR:C6A00060111 @% %@CR:C6A00060112 @%
  4958.  
  4959. Internal Leading                  The pixel height of the internal leading.
  4960.                                   Internal leading is the vertical 
  4961.                                   distance (in rows) within a character 
  4962.                                   cell above the top of the tallest 
  4963.                                   letter; only marks such as accents, 
  4964.                                   umlauts, and tildes for capital letters 
  4965.                                   should appear within the space 
  4966.                                   designated as internal leading. %@CR:C6A00060113 @%%@CR:C6A00060114 @% 
  4967.  
  4968. Default Character                 The character value (for example, the 
  4969.                                   ANSI value) of the default character. 
  4970.                                   The default character is used whenever 
  4971.                                   your application tries to use a 
  4972.                                   character that does not exist in the 
  4973.                                   font. %@CR:C6A00060115 @%%@CR:C6A00060116 @%%@CR:C6A00060117 @%
  4974.  
  4975. Break Character                   The character value of the break 
  4976.                                   character. The break character is used 
  4977.                                   to pad lines that have been justified. 
  4978.                                   The break character is typically the 
  4979.                                   space character. (For example, in the 
  4980.                                   ANSI character set, the value is 32.) %@CR:C6A00060118 @%
  4981.  
  4982. ANSI, OEM, or                     These options define the character set. 
  4983. SYMBOL                            The ANSI character set (value zero) is 
  4984.                                   the default Windows character set. The 
  4985.                                   OEM character set (value 255) is 
  4986.                                   machine-specific. The Symbol character 
  4987.                                   set (value 2) contains special 
  4988.                                   characters typically used to represent 
  4989.                                   mathematical and scientific formulas. 
  4990.                                   The number to the right of these options
  4991.                                   defines the character set. It can be any
  4992.                                   value from 0 to 255, but only 0, 2, and 
  4993.                                   255 have a predefined meaning. %@CR:C6A00060119 @% %@CR:C6A00060120 @%%@CR:C6A00060121 @%
  4994.  
  4995. %@AB@%Item %@AE@%                             %@AB@%Description%@AE@%
  4996. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4997. Font Family                       The family to which the font belongs. 
  4998.                                   Font families define the general 
  4999.                                   characteristics of the font as follows: 
  5000.                                   %@CR:C6A00060122 @% %@CR:C6A00060123 @%
  5001.  
  5002.                                   %@AB@%Family%@AE@% %@AB@%%@AE@%     %@AB@%Description%@AE@%
  5003.                                   %@AB@%Name%@AE@%        
  5004. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5005.                                   Roman       Proportionally-spaced fonts 
  5006.                                               with serifs.
  5007.  
  5008.                                   Modern      Fixed-pitch fonts. 
  5009.  
  5010.                                   Swiss       Proportionally-spaced fonts 
  5011.                                               without serifs.
  5012.  
  5013.                                   Decorative  Novelty fonts.
  5014.  
  5015.                                   Script      Cursive or script fonts.
  5016.  
  5017.                                   Dontcare    Custom font.
  5018.  
  5019.                                   Italic      This option defines an 
  5020.                                               italic font.
  5021.  
  5022.                                   Underline   This option defines an 
  5023.                                               underlined font. %@CR:C6A00060124 @% 
  5024.  
  5025.                                   Strikeout   This option defines a font 
  5026.                                               whose characters have been 
  5027.                                               struck out. %@CR:C6A00060125 @%
  5028.  
  5029.  
  5030. %@2@%%@CR:C6A00060126 @%%@AB@%6.5  Summary%@AE@%%@EH@%%@NL@%
  5031.  
  5032. The Font Editor lets you modify existing fonts on the screen to create new
  5033. fonts for your application. For an introduction to Windows fonts, see
  5034. Chapter 18, "Fonts," in %@AI@%Guide to Programming%@AE@%.  %@NL@%
  5035.  
  5036.  
  5037.  
  5038.  
  5039.  
  5040.  
  5041. %@CR:C6A-Part 03 @%%@1@%%@AB@%PART III  Debugging and Optimization Tools%@AE@%%@EH@%%@NL@%
  5042. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5043.  
  5044. Part 3 describes Microsoft Windows debugging and optimization tools.  The
  5045. SDK includes three debuggers: Code View for Windows, Symbolic  Debugger, and
  5046. Windows 80386 Debugger. Use Code View for Windows to debug your application
  5047. with protected-mode (standard or 386 enhanced) Windows, and the Symbolic
  5048. Debugger to debug your application with real-mode Windows. Use the 80386
  5049. Debugger for more advanced debugging in protected mode.  %@NL@%
  5050.  
  5051. The SDK also includes tools that let you monitor messages and analyze memory
  5052. management. Spy lets you monitor messages sent to a specified window or to
  5053. all windows. It is useful for verifying that the messages you think a window
  5054. is receiving are, in fact, being received. Heap Walker, Profiler, Swap, and
  5055. Shaker help you analyze memory management. Heap Walker is useful for
  5056. analyzing your application when it allocates objects in the global heap.
  5057. Profiler lets you determine the amount of time Windows spends executing
  5058. sections of code. Swap ets you analyze the calls, swaps, discards, and
  5059. returns that occur when your application runs. It is useful for minimizing
  5060. the number of procedure calls that occur across segment boundaries. Shaker
  5061. lets you see the effect of memory movement on your applications.  %@NL@%
  5062.  
  5063.  
  5064.  
  5065.  
  5066.  
  5067.  
  5068. %@CR:C6A00070001 @%%@1@%%@AB@%Chapter 7  Debugging in Protected Mode: CodeView for Windows%@AE@%%@EH@%%@NL@%
  5069. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5070.  
  5071. Version 3.0 of the Microsoft CodeView(R) for Windows (%@AB@%CVW%@AE@%) debugger is a
  5072. powerful, easy-to-use tool for analyzing the behavior of programs. With %@AB@%CVW%@AE@%,
  5073. you have the power to test completely the execution of your program and
  5074. examine your data simultaneously. You can isolate problems quickly because
  5075. you can display any combination of variables─global or local─%@AI@%while%@AE@% you halt
  5076. or trace a program's execution.%@CR:C6A00070002 @%%@NL@%
  5077.  
  5078. The %@AB@%CVW%@AE@% debugger provides a variety of ways to analyze a program. You can
  5079. use the debugger to examine source code, disassemble machine code, or
  5080. examine a mixed display that shows you precisely what machine instructions
  5081. correspond to each of your C-language statements. You can also monitor the
  5082. occurrence of specific Windows messages.  %@NL@%
  5083.  
  5084. %@AB@%CVW%@AE@% is similar to CodeView (CV) for DOS version 3.0. If you are familiar
  5085. with CV for DOS, see Section 7.2.2, "Differences between CVW and CodeView
  5086. for DOS," for a concise description of %@AB@%CVW%@AE@%'s unique features.%@CR:C6A00070003 @%%@CR:C6A00070004 @%%@CR:C6A00070005 @%%@NL@%
  5087.  
  5088. This chapter serves as a complement to the %@AB@%CVW%@AE@% on-line Help system. A
  5089. significant portion of the %@AB@%CVW%@AE@% documentation is on-line. For information on
  5090. using the %@AB@%CVW%@AE@% on-line Help system, see Section 7.7, "Getting On-line Help in
  5091. %@AB@%CVW%@AE@%."  %@NL@%
  5092.  
  5093. This chapter describes the following:  %@NL@%
  5094.  
  5095.  
  5096.   ■   Requirements for using %@AB@%CVW%@AE@%%@NL@%
  5097.  
  5098.   ■   Differences between %@AB@%CVW%@AE@% other Microsoft debuggers%@NL@%
  5099.  
  5100.   ■   Preparing to run %@AB@%CVW%@AE@% %@NL@%
  5101.  
  5102.   ■   Starting %@AB@%CVW%@AE@%%@NL@%
  5103.  
  5104.   ■   Working with the %@AB@%CVW%@AE@% screen%@NL@%
  5105.  
  5106.   ■   Displaying program data%@NL@%
  5107.  
  5108.   ■   Controlling program execution%@NL@%
  5109.  
  5110.   ■   Advanced %@AB@%CVW%@AE@% debugging techniques%@NL@%
  5111.  
  5112.   ■   Customizing %@AB@%CVW%@AE@% behavior with the TOOLS.INI file%@NL@%
  5113.  
  5114.   ■   Using %@AB@%CVW%@AE@% to debug a sample application%@NL@%
  5115.  
  5116. %@STUB@%      %@AI@%NOTE  %@AE@%%@AB@%CVW%@AE@% supports the Microsoft Mouse, or any fully compatible
  5117.       pointing device. All operations are first described using the mouse.
  5118.       The keyboard command follows.%@NL@%
  5119.  
  5120.  
  5121.  
  5122. %@2@%%@CR:C6A00070006 @%%@AB@%7.1  Requirements for Use%@AE@%%@EH@%%@NL@%
  5123.  
  5124. To use version 3.0 of %@AB@%CVW%@AE@%, your system must meet the standard requirements
  5125. for running the Microsoft Windows Software Development Kit (SDK). For a list
  5126. of the SDK requirements, see the %@AI@%Installation and Update Guide%@AE@%. %@AB@%CVW%@AE@%
  5127. specifically requires the following:  %@NL@%
  5128.  
  5129.  
  5130.   ■   A secondary monochrome display adapter and monitor. (%@AB@%CVW%@AE@% version 3.0
  5131.       does not support a serial terminal.) For IBM PS/2 systems, %@AB@%CVW%@AE@%
  5132.       supports (through the %@AB@%/8%@AE@% option) a dual-monitor configuration, where
  5133.       an 8514/a monitor serves as the Windows screen and a VGA monitor
  5134.       serves as the debugging screen.%@NL@%
  5135.  
  5136.   ■   At least 384K of extended memory. For applications compiled with many
  5137.       symbols, 1 megabyte or more of extended memory is required.%@CR:C6A00070007 @%%@NL@%
  5138.  
  5139.   ■   For 80386-based systems, the following entry in the [386enh] section
  5140.       of your SYSTEM.INI file:
  5141.  
  5142. %@AS@%      device=windebug.386%@AE@%
  5143. %@NL@%
  5144.  
  5145. %@STUB@%      The SDK %@AB@%INSTALL%@AE@% program automatically adds this entry to your
  5146.       SYSTEM.INI file.%@NL@%
  5147.  
  5148.   ■   A PATH environment variable that lists the directory containing
  5149.       CVW.EXE, WINDEBUG.DLL, WINDEBUG.386, and CVW.HLP. The SDK %@AB@%INSTALL%@AE@%
  5150.       program will place WINDEBUG.DLL and WINDEBUG.386 in the same directory
  5151.       as CVW.EXE.%@NL@%
  5152.  
  5153.  
  5154.  
  5155. %@2@%%@CR:C6A00070008 @%%@AB@%7.2  Comparing %@AB@%CVW%@AE@% with Other Microsoft Debuggers%@AE@%%@EH@%%@NL@%
  5156.  
  5157. If you have programmed in the Windows environment, you may have used the
  5158. Symbolic Debugger %@AB@%(SYMDEB)%@AE@% or %@AB@%CVW%@AE@% version 2.0 to debug Windows applications.
  5159. Or you may have used CodeView (CV) for DOS, which accompanies the Microsoft
  5160. C Optimizing Compiler. This section describes the features and functions of
  5161. %@AB@%CVW%@AE@% that are different from these other Microsoft debugging tools.  %@NL@%
  5162.  
  5163.  
  5164. %@3@%%@CR:C6A00070009 @%%@AB@%7.2.1  Differences between CVW and SYMDEB%@AE@%%@EH@%%@NL@%
  5165.  
  5166. %@AB@%CVW%@AE@% has all the capabilities of %@AB@%SYMDEB%@AE@% and a number of features that %@AB@%SYMDEB%@AE@%
  5167. does not provide. The following list summarizes differences between %@AB@%SYMDEB%@AE@%
  5168. and %@AB@%CVW%@AE@%.%@CR:C6A00070010 @%%@NL@%
  5169.  
  5170. %@AB@%SYMDEB Feature%@AE@%                    %@AB@%CVW Feature%@AE@%
  5171. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5172. Debugs applications in real       Debugs applications in protected mode.
  5173. mode.                             
  5174.  
  5175. Examines only global (static)     Examines both global and local
  5176. variables.                        variables.
  5177.  
  5178. When examining variables, you     Examines memory directly, but also uses 
  5179. must specify simple memory        the C expression evaluators to combine 
  5180. addresses or symbol names.        any program variables with higher 
  5181.                                   level-language syntax.
  5182.  
  5183. Provides only breakpoints to      Provides breakpoints, tracepoints, and 
  5184. halt execution.                   watchpoints to set Boolean conditions 
  5185.                                   and then break execution whenever these 
  5186.                                   conditions become true. 
  5187.  
  5188. Does not set breakpoints or       Sets breakpoints and tracepoints on 
  5189. tracepoints on Windows messages.  Windows messages.
  5190.  
  5191. Uses only line-oriented           Uses line-oriented or menu-driven 
  5192. commands.                         commands.
  5193.  
  5194. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5195. NOTE 
  5196.  
  5197. %@AI@%%@AB@%CVW%@AE@%%@AI@% version 3.0 supports Windows in protected mode (that is, standard and
  5198. %@AI@%386 enhanced modes) only; it does not support  Windows in real mode. Use
  5199. %@AI@%%@AE@%%@AI@%%@AB@%SYMDEB%@AE@%%@AE@%%@AI@% for real-mode debugging.%@AE@%%@AE@%
  5200. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5201.  
  5202.  
  5203. %@3@%%@CR:C6A00070011 @%%@AB@%7.2.2  Differences between CVW and CodeView for DOS%@AE@%%@EH@%%@NL@%
  5204.  
  5205. Like CV for DOS, %@AB@%CVW%@AE@% allows you to display and modify %@AI@%any%@AE@% program variable,
  5206. section of addressable memory, or processor register. Also like CV for DOS,
  5207. %@AB@%CVW%@AE@% lets you monitor the path of execution and precisely control where
  5208. execution pauses. However, CV for DOS and %@AB@%CVW%@AE@% differ in the following ways:%@CR:C6A00070012 @%%@NL@%
  5209.  
  5210. %@AB@%CV for DOS Feature%@AE@%                %@AB@%CVW Feature%@AE@%
  5211. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5212. Starts from the DOS prompt.       Starts from within Windows.
  5213.  
  5214. ALT+/ repeats a search.           CTRL+R repeats a search.
  5215.  
  5216. Exits back to DOS.                Under normal termination conditions, 
  5217.                                   exits back to Windows. Abnormal 
  5218.                                   terminations of %@AB@%CVW%@AE@% may cause the 
  5219.                                   Windows session to be terminated also.
  5220.  
  5221. In addition to these differences %@AB@%CVW%@AE@% includes the following unique features:
  5222. %@NL@%
  5223.  
  5224.  
  5225.   ■   The ability to track your application's segments and data as Windows
  5226.       moves their locations in memory. As items are moved, the debugger
  5227.       readjusts its symbol table accordingly.%@NL@%
  5228.  
  5229.   ■   The %@AB@%(lh)%@AE@% and %@AB@%(gh)%@AE@% type casts, which you can use to dereference local
  5230.       and global handles of a memory object into near and far pointer
  5231.       addresses. For a more detailed description, see "Dereferencing Memory
  5232.       Handles" in Section  7.8.6.%@NL@%
  5233.  
  5234.   ■   Windows-specific commands. %@AB@%CVW%@AE@% has six new commands:%@NL@%
  5235.  
  5236.  
  5237. %@AB@%Command%@AE@%                           %@AB@%What it does%@AE@%
  5238. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5239. %@AB@%wdl%@AE@% (Windows Display Local Heap)  Displays a list of the memory objects in
  5240.                                   the local heap.
  5241.  
  5242. %@AB@%wdg%@AE@% (Windows Display Global       Displays a list of the memory objects in
  5243. Heap)                             the global heap.
  5244.  
  5245. %@AB@%wdm%@AE@% (Windows Display Module       Displays a list of the application and 
  5246. List)                             library modules known by Windows.
  5247.  
  5248. %@AB@%wwm%@AE@% (Windows Watch Message)       Displays a Windows message or class of 
  5249.                                   messages in the %@AB@%CVW%@AE@% 
  5250.                                   Command window.
  5251.  
  5252. %@AB@%wbm%@AE@% (Windows Break Message)       Sets a breakpoint on a Windows message 
  5253.                                   or class of messages. %@CR:C6A00070013 @%
  5254.  
  5255. %@AB@%wka%@AE@% (Windows Kill Application)    Terminates the currently executing task.
  5256.                                   You should use this command with caution.
  5257.                                   See Section 7.10.4,
  5258.                                   "Interrupting Your Program," for more 
  5259.                                   information.%@CR:C6A00070014 @%
  5260.  
  5261.  
  5262. %@2@%%@CR:C6A00070015 @%%@AB@%7.3  Preparing to Run CVW%@AE@%%@EH@%%@NL@%
  5263.  
  5264. Before beginning a %@AB@%CVW%@AE@% debugging session, you must do the following:  %@NL@%
  5265.  
  5266.  
  5267.   ■   Set up a secondary monitor on which to display %@AB@%CVW%@AE@% information.%@NL@%
  5268.  
  5269.   ■   Ensure that the Windows application you are going to debug has been
  5270.       compiled and linked properly.%@NL@%
  5271.  
  5272.  
  5273. In addition to these mandatory steps, it is also recommended that you set up
  5274. a debugging version of Windows.  %@NL@%
  5275.  
  5276. The following sections describe how to prepare your system for running %@AB@%CVW%@AE@%.
  5277. %@NL@%
  5278.  
  5279.  
  5280. %@3@%%@CR:C6A00070016 @%%@AB@%7.3.1  Setting Up a Secondary Monitor%@AE@%%@EH@%%@NL@%
  5281.  
  5282. In addition to the graphics adapter card and graphics display monitor
  5283. required for your Windows display, you need a monochrome adapter card and
  5284. monochrome display monitor to use %@AB@%CVW%@AE@%.%@CR:C6A00070017 @%%@NL@%
  5285.  
  5286. To set up a secondary monitor for debugging, do the following:  %@NL@%
  5287.  
  5288.  
  5289.   1.  Install a secondary monochrome adapter card in a free slot on your
  5290.       computer and connect the monochrome monitor to the port in the back.%@NL@%
  5291.  
  5292.   2.  Set the secondary-display-adapter switches to the appropriate
  5293.       settings, according to the display adapter and computer manufacturer
  5294.       recommendations.%@NL@%
  5295.  
  5296.  
  5297. If your system is an IBM PS/2, it must be configured with an 8514/a monitor
  5298. as the primary monitor, and a VGA as the secondary monitor. To use this
  5299. configuration, specify the %@AB@%/8%@AE@% (8514/a) option when you choose the Run
  5300. command from the %@AB@%CVW%@AE@% File menu. If your VGA monitor is monochrome, you must
  5301. also use the %@AB@%/B%@AE@% (black and white) option. The 8514/a serves as the Windows
  5302. screen and the VGA as the debugging screen.  %@NL@%
  5303.  
  5304. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5305. IMPORTANT
  5306.  
  5307. %@AI@%Do not attempt to run non-Windows applications or the DOS shell while
  5308. %@AI@%running %@AB@%CVW%@AE@%%@AI@% with the %@AE@%%@AI@%%@AB@%/8%@AE@%%@AE@%%@AI@% option.%@AE@%%@AE@%
  5309. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5310.  
  5311. By default, the debugging screen operates in 50-line mode in this
  5312. configuration. If you specify the %@AB@%/8%@AE@% option, you can optionally specify the
  5313. %@AB@%/25%@AE@% or %@AB@%/43%@AE@% option for 25- or 43-line mode, respectively, on the VGA
  5314. debugging screen.  %@NL@%
  5315.  
  5316. With the secondary monitor connected to your system, you can view %@AB@%CVW%@AE@% output
  5317. and Windows output simultaneously.  %@NL@%
  5318.  
  5319.  
  5320. %@3@%%@CR:C6A00070018 @%%@AB@%7.3.2  Setting Up the Debugging Version of Windows%@AE@%%@EH@%%@NL@%
  5321.  
  5322. You can run %@AB@%CVW%@AE@% with either the debugging or retail version of Windows.  %@NL@%
  5323.  
  5324. The debugging version performs error checking which is not available in the
  5325. retail version. For example, the debugging version of Windows checks whether
  5326. a window handle passed to a Windows function is valid. When the debugging
  5327. version of Windows detects such an error, it reports a fatal exit. If this
  5328. happens while you are running %@AB@%CVW%@AE@%, the fatal exit is reported in the %@AB@%CVW%@AE@%
  5329. Command window. Section 7.11, "Handling Abnormal Termination of the
  5330. Application," discusses this error handling in greater detail.  %@NL@%
  5331.  
  5332. Another advantage to using the debugging version of Windows with %@AB@%CVW%@AE@% is the
  5333. additional support which the Windows core dynamic-link libraries (DLLs)
  5334. (KRNL286.EXE, KRNL386.EXE, GDI.EXE, and USER.EXE) provide for debugging.
  5335. These DLLs contain symbol information which makes it easier to determine the
  5336. cause of an error. For example, if your application causes a general
  5337. protection (GP) fault while running with the debugging version, Windows can
  5338. display symbol information for the Windows code that was executing when the
  5339. GP fault was detected. If, instead, you were running with the retail version
  5340. of Windows, Windows would only be able to display CS:IP address values of
  5341. the code that was executing when the fault occurred.  %@NL@%
  5342.  
  5343. %@AB@%CVW%@AE@% does not automatically use these Windows core DLL symbols. To provide
  5344. %@AB@%CVW%@AE@% access to these symbols, you must specify one or more of the core DLLs
  5345. either using the %@AB@%/L%@AE@% command-line option or in response to the DLL prompt
  5346. within %@AB@%CVW%@AE@%. If you are running %@AB@%CVW%@AE@% with Windows in standard mode, specify
  5347. KRNL286.EXE. In 386 enhanced mode, specify KRNL386.EXE. Section 7.4.4,
  5348. "Starting a Debugging Session for DLLs," explains how to load symbols from a
  5349. DLL.  %@NL@%
  5350.  
  5351. Installing the debugging version of Windows requires only three simple
  5352. steps:  %@NL@%
  5353.  
  5354.  
  5355.   1.  Rename or copy the KRNL286.EXE, KRNL386.EXE, GDI.EXE, and USER.EXE
  5356.       files located in the Windows system directory. If you accepted the
  5357.       default Windows directory name offered by Windows Setup, the Windows
  5358.       system directory is named \WINDOWS\SYSTEM. %@NL@%
  5359.  
  5360.   2.  Copy the debugging version of these files from the Windows development
  5361.       debugging directory (named \WINDEV\DEBUG by default) to the Windows
  5362.       system directory.%@NL@%
  5363.  
  5364.   3.  Copy the corresponding symbol files from the debugging directory to
  5365.       the system directory.%@NL@%
  5366.  
  5367.  
  5368.  
  5369. %@3@%%@CR:C6A00070019 @%%@AB@%7.3.3  Preparing Windows Applications for Debugging%@AE@%%@EH@%%@NL@%
  5370.  
  5371. To prepare a Windows application for use with %@AB@%CVW%@AE@%, take the following steps:
  5372. %@NL@%
  5373.  
  5374.  
  5375.   1.  Compile your C source code with the %@AB@%/Zi%@AE@% option and, optionally, the
  5376.       %@AB@%/Od%@AE@% options.%@CR:C6A00070020 @%%@NL@%
  5377.  
  5378. %@STUB@%      The %@AB@%/Zi%@AE@% option directs the compiler to produce object files that
  5379.       contain CodeView symbolic information. The %@AB@%/Od%@AE@% option disables the
  5380.       compiler's optimization. If optimization is enabled, the code
  5381.       generated by the compiler does not match as closely the statements in
  5382.       the C source code. Using the %@AB@%/Od%@AE@% option makes debugging easier.%@NL@%
  5383.  
  5384. %@STUB@%      For example:%@NL@%
  5385.  
  5386. %@AS@%      CL -d -c -AS -Gsw -Zpei -Od OUTPUT.C%@AE@%
  5387.  
  5388.   2.  Link your application with the %@AB@%/CO%@AE@% option.%@NL@%
  5389.  
  5390. %@STUB@%      The %@AB@%/CO%@AE@% option directs the linker to produce an executable file that
  5391.       contains CodeView information. This information is used directly by
  5392.       %@AB@%CVW%@AE@%. %@NL@%
  5393.  
  5394. %@STUB@%      Note that no other switches, intermediate files, or programs (such as
  5395.       %@AB@%MAPSYM%@AE@%, used with %@AB@%SYMDEB%@AE@%) are required for %@AB@%CVW%@AE@%. For example:%@NL@%
  5396.  
  5397. %@AS@%      LINK OUTPUT,,,/NOD /CO SLIBW SLIBCEW, OUTPUT.DEF%@AE@%
  5398.  
  5399.  
  5400. After compiling and linking your application with these options, you can
  5401. start a %@AB@%CVW%@AE@% debugging session.%@CR:C6A00070021 @%%@NL@%
  5402.  
  5403.  
  5404. %@2@%%@CR:C6A00070022 @%%@AB@%7.4  Starting a Debugging Session%@AE@%%@EH@%%@NL@%
  5405.  
  5406. Like most Windows applications, you can start CodeView for Windows several
  5407. ways. For a complete description of how to start Windows applications, see
  5408. the %@AI@%Windows User's Guide%@AE@%. To specify %@AB@%CVW%@AE@% options, you must choose the Run
  5409. command from the File menu in Program Manager. See Section 7.4.5, "Using %@AB@%CVW%@AE@%
  5410. File Run Options," for more information on %@AB@%CVW%@AE@% options.%@CR:C6A00070023 @%%@NL@%
  5411.  
  5412. You can run %@AB@%CVW%@AE@% to perform the following tasks:  %@NL@%
  5413.  
  5414.  
  5415.   ■   Debug a single application%@NL@%
  5416.  
  5417.   ■   Debug multiple instances of an application%@NL@%
  5418.  
  5419.   ■   Debug multiple applications%@NL@%
  5420.  
  5421.   ■   Debug dynamic-link libraries (DLLs)%@NL@%
  5422.  
  5423.  
  5424. This section describes the methods you use to perform these tasks, and
  5425. summarizes the syntax of the Run command in the File menu of %@AB@%CVW%@AE@%.  %@NL@%
  5426.  
  5427.  
  5428. %@3@%%@CR:C6A00070024 @%%@AB@%7.4.1  Starting a Debugging Session for a Single Application%@AE@%%@EH@%%@NL@%
  5429.  
  5430. After you start %@AB@%CVW%@AE@% from Windows, %@AB@%CVW%@AE@% will display the Command Line dialog
  5431. box on your secondary monitor. To start debugging a single application:  %@NL@%
  5432.  
  5433.  
  5434.   1.  At the Command Line prompt, type the name of the application. If you
  5435.       do not include an extension, %@AB@%CVW%@AE@% assumes the .EXE extension by
  5436.       default. You can also include any arguments that the application
  5437.       recognizes. The following shows the syntax of the command to start
  5438.       debugging a single application:%@NL@%
  5439.  
  5440. %@STUB@%      %@AB@%appname«.EXE» «%@AE@%%@AI@%application_arguments%@AE@%%@AB@%»%@AE@%%@NL@%
  5441.  
  5442.   2.  Press ENTER or click OK.%@NL@%
  5443.  
  5444. %@STUB@%      %@AB@%CVW%@AE@% displays the following prompt:%@NL@%
  5445.  
  5446. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  5447.  
  5448. %@STUB@%      Since you are debugging only one application and no DLLs, press ENTER
  5449.       or click OK. %@AB@%CVW%@AE@% loads the application and displays the source code
  5450.       for the application's WinMain routine on the debugging screen.%@NL@%
  5451.  
  5452.   3.  Set breakpoints in the code, if you desire.%@NL@%
  5453.  
  5454.   4.  Use the %@AB@%go%@AE@% command to resume execution of the application. %@NL@%
  5455.  
  5456.  
  5457. If you want to avoid the start-up dialog boxes, you can start %@AB@%CVW%@AE@% more
  5458. quickly by specifying the application name as an argument in the Run command
  5459. line, as follows:  %@NL@%
  5460.  
  5461.  
  5462.   1.  Choose the Run command from the Windows File menu.%@NL@%
  5463.  
  5464.   2.  Type the application name and any application arguments in the %@AB@%CVW%@AE@%
  5465.       command line. The following shows the syntax of the command line to
  5466.       start debugging a single application:%@NL@%
  5467.  
  5468. %@STUB@%      %@AB@%CVW «%@AE@%%@AI@%cvw_options%@AE@%%@AB@%» appname«.EXE» «%@AE@%%@AI@%application_arguments%@AE@%%@AB@%»%@AE@% %@NL@%
  5469.  
  5470.   3.  Press ENTER or click OK.%@NL@%
  5471.  
  5472.  
  5473.  
  5474. %@3@%%@CR:C6A00070025 @%%@AB@%7.4.2  Starting a Debugging Session for Multiple Instances of an Application%@AE@%%@EH@%%@NL@%
  5475.  
  5476. Windows can run multiple instances of an application simultaneously, which
  5477. can be a potential problem for your application. For example, two instances
  5478. of an application might interfere with each other, or perhaps one could
  5479. corrupt the data of the other.  %@NL@%
  5480.  
  5481. To help you solve problems associated with running multiple instances of a
  5482. program, %@AB@%CVW%@AE@% allows you to debug multiple instances of an application
  5483. simultaneously. You can determine which instance of an application you are
  5484. looking at by examining the DS register at any breakpoint.%@CR:C6A00070026 @%%@NL@%
  5485.  
  5486. To debug multiple instances of an application, perform the following steps:
  5487. %@NL@%
  5488.  
  5489.  
  5490.   1.  Start %@AB@%CVW%@AE@% as usual for your application.%@NL@%
  5491.  
  5492.   2.  Run one or more additional instances of your application by choosing
  5493.       the Run command from the File menu in Windows. %@NL@%
  5494.  
  5495.  
  5496. Specifying your application name more than once when starting %@AB@%CVW%@AE@% does not
  5497. have the effect of loading multiple instances of the application.  %@NL@%
  5498.  
  5499. The breakpoints you set in your application will apply to all instances of
  5500. the application. To determine which instance of the application has the
  5501. current focus in %@AB@%CVW%@AE@%, examine the DS register.  %@NL@%
  5502.  
  5503.  
  5504. %@3@%%@CR:C6A00070027 @%%@AB@%7.4.3  Starting a Debugging Session for Multiple Applications%@AE@%%@EH@%%@NL@%
  5505.  
  5506. You can debug two or more applications at the same time, such as a DDE
  5507. Client and Server. However, global symbols shared by both applications (such
  5508. as the symbol name "WINMAIN") are not distinguished. %@AB@%CVW%@AE@% always resolves
  5509. symbol references to the first application named when you started %@AB@%CVW%@AE@%.  %@NL@%
  5510.  
  5511. Perform the following steps to debug more than one application at the same
  5512. time:  %@NL@%
  5513.  
  5514.  
  5515.   1.  Start %@AB@%CVW%@AE@% as usual for a single application.%@NL@%
  5516.  
  5517.   2.  Provide the name of the second application when %@AB@%CVW%@AE@% displays this
  5518.       prompt:
  5519.  
  5520. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  5521. %@NL@%
  5522.  
  5523. %@STUB@%      You %@AI@%must%@AE@% include the .EXE extension of the filename of the second
  5524.       application.%@NL@%
  5525.  
  5526.   3.  Set breakpoints in either or both applications, using the File Open
  5527.       Module command to display the source code for the different modules.%@NL@%
  5528.  
  5529.   4.  Use the %@AB@%go%@AE@% command to continue execution of the first application. %@NL@%
  5530.  
  5531.   5.  Choose the Run command from the File menu in Windows to start
  5532.       execution of the second application.%@NL@%
  5533.  
  5534.  
  5535. Alternatively, you can use the %@AB@%/L%@AE@% option on the Run command line in %@AB@%CVW%@AE@% to
  5536. load the symbols for a second application, as shown:  %@NL@%
  5537.  
  5538. %@AS@%  cvw /l second.exe first.exe%@AE@%
  5539.  
  5540. The %@AB@%/L%@AE@% option and the name of the second application must precede the name
  5541. of the first application on the Run command line. You can repeat the %@AB@%/L%@AE@%
  5542. option for each application to be included in the debugging session.  %@NL@%
  5543.  
  5544. Once %@AB@%CVW%@AE@% starts, choose the Run command from the File menu in Windows to
  5545. start execution of the second application.  %@NL@%
  5546.  
  5547.  
  5548. %@3@%%@CR:C6A00070028 @%%@AB@%7.4.4  Starting a Debugging Session for DLLs%@AE@%%@EH@%%@NL@%
  5549.  
  5550. You can debug one or more DLLs while you are debugging an application. As
  5551. with multiple applications, global symbols shared by both applications are
  5552. not distinguished.  %@NL@%
  5553.  
  5554. Perform the following steps to debug a DLL at the same time as an
  5555. application:  %@NL@%
  5556.  
  5557.  
  5558.   1.  Start %@AB@%CVW%@AE@% as usual for the application.%@NL@%
  5559.  
  5560.   2.  Provide the name of the DLL when %@AB@%CVW%@AE@% displays this prompt:
  5561.  
  5562. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  5563. %@NL@%
  5564.  
  5565. %@STUB@%      %@AB@%CVW%@AE@% assumes the .DLL extension if you do not supply an extension with
  5566.       the filename. If your DLL has another extension (such as .DRV), you
  5567.       must specify it explicitly.%@NL@%
  5568.  
  5569.   3.  Set breakpoints in either the application or the DLL, using the File
  5570.       Open Module command to display the source code for the different
  5571.       modules.%@NL@%
  5572.  
  5573.   4.  Use the %@AB@%go%@AE@% command to continue execution of the application. %@NL@%
  5574.  
  5575.  
  5576. Alternatively, you can use the %@AB@%/L%@AE@% option on the %@AB@%CVW%@AE@% File Run command line to
  5577. specify the DLL, as shown:  %@NL@%
  5578.  
  5579. %@AS@%  cvw /l appdll appname.exe%@AE@%
  5580.  
  5581. The %@AB@%/L%@AE@% option and the name of the DLL must precede the name of the first
  5582. application on the %@AB@%CVW%@AE@% File Run command line. You can repeat the %@AB@%/L%@AE@% option
  5583. for each DLL to be included in the debugging session. The .DLL extension is
  5584. the default extension for the %@AB@%/L%@AE@% option.  %@NL@%
  5585.  
  5586. %@AB@%CVW%@AE@% allows you to debug the LibEntry initialization routine of a DLL. If
  5587. your application implicitly loads the library, then a special technique is
  5588. required to debug the LibEntry routine. An application implicitly loads a
  5589. DLL if the library routines are imported in the application's
  5590. module-definition (.DEF) file, or if your application imports library
  5591. routines through an import library when you link the application. An
  5592. application explicitly loads a DLL by calling the %@AB@%LoadLibrary%@AE@% function.  %@NL@%
  5593.  
  5594. If your application implicitly loads the DLL and you specify the application
  5595. at the Command Line prompt, %@AB@%CVW%@AE@% automatically loads the DLL and executes the
  5596. DLL's LibEntry routine when %@AB@%CVW%@AE@% loads the application. This gives you no
  5597. opportunity to debug the LibEntry routine. To avoid this problem, perform
  5598. the following steps:  %@NL@%
  5599.  
  5600.  
  5601.   1.  Do not provide the name of your application at the Command Line
  5602.       prompt. Instead, provide the name of any "dummy" application which
  5603.       does not implicitly load the library.%@NL@%
  5604.  
  5605.   2.  Enter the name of your DLL, being sure to include the extension if it
  5606.       is not .DLL, at the following prompt:
  5607.  
  5608. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  5609. %@NL@%
  5610.  
  5611.   3.  Use the File Open Module command to display the source code for the
  5612.       library module containing the LibEntry routine. Set breakpoints in the
  5613.       LibEntry routine.%@NL@%
  5614.  
  5615.   4.  Use the File Open Module command to display the source code for other
  5616.       library or application modules and set desired breakpoints.%@NL@%
  5617.  
  5618.   5.  Use the %@AB@%go%@AE@% command to start execution of the "dummy" application.%@NL@%
  5619.  
  5620.   6.  Execute your application (that is, the application that implicitly
  5621.       loads the DLL) by choosing the Run command from the File menu in
  5622.       Windows. %@AB@%CVW%@AE@% will resume control when the breakpoint in the LibEntry
  5623.       routine is encountered.%@NL@%
  5624.  
  5625.  
  5626. Alternatively, you can use the %@AB@%CVW%@AE@% File Run command line to identify the
  5627. "dummy" application, your application, and the DLL, as shown:  %@NL@%
  5628.  
  5629. %@AS@%  cvw /l appdll dummyapp%@AE@%
  5630.  
  5631.  
  5632. %@3@%%@CR:C6A00070029 @%%@AB@%7.4.5  Using CVW File Run Options%@AE@%%@EH@%%@NL@%
  5633.  
  5634. Sections 7.4.1 through 7.4.4 illustrated different ways to use the %@AB@%CVW%@AE@% File
  5635. Run command line. The following shows the general syntax of this command
  5636. line:  %@NL@%
  5637.  
  5638. %@AS@%  CVW «cvw_options» app_name«.EXE» «app_arguments»%@AE@%
  5639.  
  5640. None of the parameters are case-sensitive.  %@NL@%
  5641.  
  5642. The following list describes these parameters.  %@NL@%
  5643.  
  5644. %@TH:  90  5342 02 15 30 31 @%
  5645. Parameter      Description
  5646. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5647. %@AI@%cvw_options%@AE@%    Specifies one or more 
  5648.                options that modify how %@AB@%CVW%@AE@% 
  5649.                runs. Acceptable options 
  5650.                are:
  5651.  
  5652.                Option                        Purpose
  5653.  
  5654.                %@AB@%/L%@AE@% %@AI@%dll_or_exe%@AE@%                 Specifies the name of an 
  5655.                                              application or DLL that has 
  5656.                                              been compiled and linked with
  5657.                                              %@AB@%CVW%@AE@% symbols. %@AB@%CVW%@AE@% assumes the 
  5658.                                              default file extension .DLL 
  5659.                                              if no extension is supplied. 
  5660.                                              You can use the %@AB@%/L%@AE@% option 
  5661.                                              more than once to specify 
  5662.                                              multiple DLLs or executable 
  5663.                                              files.
  5664.  
  5665.                %@AB@%/C%@AE@% %@AI@%command%@AE@%                    Specifies one or more %@AB@%CVW%@AE@% 
  5666.                                              commands which %@AB@%CVW%@AE@% executes 
  5667.                                              when it loads the application
  5668.                                              specified by the %@AI@%app_name%@AE@% 
  5669.                                              parameter. The commands must 
  5670.                                              be enclosed in double 
  5671.                                              quotation marks ( " ) and 
  5672.                                              separated with semicolons ( ;
  5673.                                              ).
  5674.  
  5675.                %@AB@%/M%@AE@%                            Disables the use of the mouse
  5676.                                              at the debugging screen. You 
  5677.                                              should use this option when 
  5678.                                              you set breakpoints in code 
  5679.                                              that is responsive to mouse 
  5680.                                              movements on the Windows 
  5681.                                              (application) screen.
  5682.  
  5683.                %@AB@%/TSF%@AE@%                          Toggles the save state-file 
  5684.                                              status. See Section 
  5685.                                              <NO>7</NO>.5, "Saving Session
  5686.                                              Information," for details.
  5687.  
  5688.                %@AB@%/8%@AE@%                            Allows %@AB@%CVW%@AE@% to recognize a 
  5689.                                              dual-monitor configuration. 
  5690.                                              See <NO>7</NO>.3.1, "Setting 
  5691.                                              Up a Secondary Monitor," for 
  5692.                                              more information.
  5693.  
  5694.                %@AB@%/B%@AE@%                            Specifies a monochrome VGA 
  5695.                                              monitor used as the secondary
  5696.                                              display with an 8514/a 
  5697.                                              display. This option is valid
  5698.                                              only in conjunction with the %@AB@%%@AE@%
  5699.                                              %@AB@%/8%@AE@% option.
  5700.  
  5701.                Option                        Purpose
  5702.  
  5703.                %@AB@%/25%@AE@%                           Specifies 25-line mode for 
  5704.                                              the secondary VGA monitor. 
  5705.                                              This option is valid only in 
  5706.                                              conjunction with the %@AB@%/8%@AE@% 
  5707.                                              option.
  5708.  
  5709.                %@AB@%/43%@AE@%                           Specifies 43-line mode for 
  5710.                                              the secondary VGA monitor. 
  5711.                                              This option is valid only in 
  5712.                                              conjunction with the %@AB@%/8%@AE@% 
  5713.                                              option. 
  5714.  
  5715.                %@AB@%/50%@AE@%                           Specifies 50-line mode for 
  5716.                                              the secondary VGA monitor. 
  5717.                                              This option is valid only in 
  5718.                                              conjunction with the %@AB@%/8%@AE@% 
  5719.                                              option. The %@AB@%/50%@AE@% option is not
  5720.                                              required, since 50-line mode 
  5721.                                              is the default for the 
  5722.                                              dual-monitor configuration.
  5723.  
  5724. %@AI@%app_name%@AE@%       Specifies the pathname of 
  5725.                the application for which %@AB@%%@AE@%
  5726.                %@AB@%CVW%@AE@% will load symbols and 
  5727.                issue an initial breakpoint.
  5728.                The .EXE extension is 
  5729.                optional.
  5730.  
  5731. %@AI@%app_arguments%@AE@%  Specifies one or more 
  5732.                arguments recognized by the 
  5733.                application that %@AB@%CVW%@AE@% loads.
  5734.  
  5735. %@TE:  90  5342 02 15 30 31 @%
  5736.  
  5737.  
  5738. %@2@%%@CR:C6A00070030 @%%@AB@%7.5  Saving Session Information%@AE@%%@EH@%%@NL@%
  5739.  
  5740. After your session, %@AB@%CVW%@AE@% stores session information in a file called
  5741. CURRENT.STS, which is located in the directory pointed to by the INIT
  5742. environment variable or in the current directory. If this file does not
  5743. already exist, %@AB@%CVW%@AE@% automatically creates it. Session information includes:  %@NL@%
  5744.  
  5745.  
  5746.   ■   CodeView display windows that were opened.%@NL@%
  5747.  
  5748.   ■   Breakpoint locations.%@NL@%
  5749.  
  5750.  
  5751. CodeView for Windows saves this information, which becomes the default the
  5752. next time you run a %@AB@%CVW%@AE@% session for that application.%@CR:C6A00070031 @%%@NL@%
  5753.  
  5754. You can disable this feature by placing the following entry in your
  5755. TOOLS.INI file: (The default is "y" ─yes.)  %@NL@%
  5756.  
  5757. %@AS@%  [cvw]
  5758. %@AS@%  StateFileRead: n%@AE@%
  5759.  
  5760. The %@AB@%/TSF%@AE@% option temporarily toggles this setting when you run %@AB@%CVW%@AE@%. That is,
  5761. if TOOLS.INI disables this feature, running %@AB@%CVW%@AE@% with the %@AB@%/TSF%@AE@% option saves
  5762. session information for that session only.  %@NL@%
  5763.  
  5764. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5765. NOTE
  5766.  
  5767. %@AI@%If your Windows session abnormally terminates while %@AB@%CVW%@AE@%%@AI@% is running, the
  5768. %@AI@%CURRENT.STS file may be corrupted. This may cause %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% to fail when it first
  5769. %@AI@%tries to execute the application you are debugging. If this happens, delete
  5770. %@AI@%the CURRENT.STS file before attempting to run %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% again.%@AE@%%@AE@%
  5771. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5772.  
  5773.  
  5774. %@2@%%@CR:C6A00070032 @%%@AB@%7.6  Working with the CVW Screen%@AE@%%@EH@%%@NL@%
  5775.  
  5776. When you start %@AB@%CVW%@AE@%, the %@AB@%CVW%@AE@% menu bar and three display windows─the Local
  5777. window, the Source window, and the Command window─will appear on your
  5778. secondary monitor. Figure 7.1 illustrates how the screen appears during a
  5779. debugging session.  %@NL@%
  5780.  
  5781. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  5782.  
  5783.  
  5784. %@3@%%@CR:C6A00070033 @%%@AB@%7.6.1  Using CVW Display Windows%@AE@%%@EH@%%@NL@%
  5785.  
  5786. %@AB@%CVW%@AE@% divides the screen into logically separate sections called display
  5787. windows, so that a large amount of information can be displayed in an
  5788. organized and easy-to-read fashion. Each %@AB@%CVW%@AE@% display window is a distinct
  5789. area on your monitor that operates independently of the other display
  5790. windows. The name of each display window appears in the top of the window's
  5791. frame. The following list describes the seven types of %@AB@%CVW%@AE@% display windows:%@CR:C6A00070034 @%%@NL@%
  5792.  
  5793. %@AB@%CVW Display Window%@AE@%                %@AB@%Purpose%@AE@%
  5794. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5795. Source window                     Displays the source code. You can open a
  5796.                                   second source window to view an include 
  5797.                                   file, another source file, or the same 
  5798.                                   source file at a different
  5799.                                   location.
  5800.  
  5801. Command window                    Accepts debugging commands.
  5802.  
  5803. Watch window                      Displays the current values of selected 
  5804.                                   variables.
  5805.  
  5806. Local window                      Lists the values of all variables local 
  5807.                                   to the current function or block.
  5808.  
  5809. Memory window                     Shows the contents of memory. You can 
  5810.                                   open a second Memory window to view a 
  5811.                                   different section of memory.
  5812.  
  5813. Register window                   Displays the contents of the 
  5814.                                   microprocessor's registers, as well as 
  5815.                                   the processor flags.
  5816.  
  5817. 8087 window                       Displays the registers of the 
  5818.                                   coprocessor or its software emulator.
  5819.  
  5820. Help window                       Displays the Help options or any Help 
  5821.                                   information that you request. 
  5822.  
  5823.  
  5824. %@4@%%@AB@%Opening Display Windows%@AE@%%@EH@%%@NL@%
  5825.  
  5826. There are two ways to open %@AB@%CVW%@AE@% display windows:%@CR:C6A00070035 @%%@NL@%
  5827.  
  5828.  
  5829.   ■   Choose a window from the View menu. (Note that you can open more than
  5830.       one Source or Memory window.)%@NL@%
  5831.  
  5832.   ■   Perform an operation that automatically opens a window if it is not
  5833.       already open. For example, selecting a Watch variable automatically
  5834.       opens the Watch window.%@NL@%
  5835.  
  5836.  
  5837. CodeView continually and automatically updates the contents of all its
  5838. display windows.  %@NL@%
  5839.  
  5840.  
  5841. %@4@%%@AB@%Selecting Display Windows%@AE@%%@EH@%%@NL@%
  5842.  
  5843. To select a window, click anywhere inside of it. You can also press F6 or
  5844. SHIFT+F6 to move the focus from one window to the next.%@CR:C6A00070036 @%%@NL@%
  5845.  
  5846. The selected window is called the "current" window and is marked in three
  5847. ways:  %@NL@%
  5848.  
  5849.  
  5850.   ■   The window's name is displayed in white.%@NL@%
  5851.  
  5852.   ■   The text cursor appears in the window.%@NL@%
  5853.  
  5854.   ■   The vertical and horizontal scroll bars are moved into the window.%@NL@%
  5855.  
  5856.  
  5857. Typing commands into the Source window causes %@AB@%CVW%@AE@% to temporarily shift its
  5858. focus to the Command window. Whatever you type is appended to the last line
  5859. in the Command window. If the Command window is closed, %@AB@%CVW%@AE@% beeps in
  5860. response to your entry and ignores the input.  %@NL@%
  5861.  
  5862.  
  5863. %@4@%%@AB@%Adjusting Display Windows%@AE@%%@EH@%%@NL@%
  5864.  
  5865. %@AB@%CVW%@AE@% display windows often contain more information than they can display on
  5866. the screen. Although you cannot change the relative positions of the display
  5867. windows, you can manipulate a selected window using the mouse, as follows:%@CR:C6A00070037 @%%@NL@%
  5868.  
  5869.  
  5870.   ■   To scroll the window vertically or horizontally, use the vertical or
  5871.       horizontal scroll bar.%@NL@%
  5872.  
  5873.   ■   To maximize a window so that it fills the screen, click the Up arrow
  5874.       at the right end of the window's top border. To restore the window to
  5875.       its previous size and position, click the Double arrow at the right
  5876.       end of the top border.%@NL@%
  5877.  
  5878.   ■   To change the size of a window:
  5879.  
  5880.       1.  Position the cursor anywhere on the border between two windows.%@NL@%
  5881.  
  5882.       2.  Press and hold down the left mouse button. %@NL@%
  5883.  
  5884. %@STUB@%          Two double arrows will appear on the line.%@NL@%
  5885.  
  5886.       3.  Drag the mouse to enlarge or reduce the window. %@NL@%
  5887. %@NL@%
  5888.  
  5889.   ■   To remove a window, click the small, dotted box at the left end of the
  5890.       top border. %@NL@%
  5891.  
  5892. %@STUB@%      The adjacent windows automatically expand to recover the empty space.%@NL@%
  5893.  
  5894.  
  5895. You can also use the following keyboard commands:%@CR:C6A00070038 @%%@NL@%
  5896.  
  5897. %@AB@%Keyboard Command%@AE@%                  %@AB@%Description%@AE@%
  5898. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5899. PAGE UP or PAGE DOWN              Scrolls through the text vertically.
  5900.  
  5901. CTRL+F10                          Maximizes a selected display window.
  5902.  
  5903. CTRL+F8                           Changes the size of a selected display 
  5904.                                   window.
  5905.  
  5906. CTRL+F4                           Removes a selected display window.
  5907.  
  5908. You can also choose the Maximize, Size, and Close commands from the View
  5909. menu to manipulate a selected display window.  %@NL@%
  5910.  
  5911. The different %@AB@%CVW%@AE@% display windows can help you to conduct a variety of
  5912. debugging activities simultaneously. These activities are initiated and
  5913. controlled with %@AB@%CVW%@AE@% debugging commands, which can be typed in the %@AB@%CVW%@AE@%
  5914. Command window or selected using the %@AB@%CVW%@AE@% menus.  %@NL@%
  5915.  
  5916.  
  5917. %@3@%%@CR:C6A00070039 @%%@AB@%7.6.2  Using the CVW Menu Bar%@AE@%%@EH@%%@NL@%
  5918.  
  5919. In addition to display windows, the %@AB@%CVW%@AE@% screen includes a menu bar, which
  5920. contains the following menus:%@CR:C6A00070040 @%%@NL@%
  5921.  
  5922. %@TH: 154  7674 02 34 42 @%
  5923. Menu                              Command
  5924. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5925. File                              This menu contains the following 
  5926.                                   commands:
  5927.  
  5928.                                   Open Source opens any text file and 
  5929.                                   reads it into the currently active 
  5930.                                   source window.
  5931.  
  5932.                                   Open Module opens the source file of any
  5933.                                   module for which %@AB@%CVW%@AE@% information has 
  5934.                                   been loaded and reads it into the 
  5935.                                   currently active source window.
  5936.  
  5937.                                   Exit ends your %@AB@%CVW%@AE@% session and returns 
  5938.                                   you to Windows.
  5939.  
  5940. Edit                              This menu contains the following 
  5941.                                   commands:
  5942.  
  5943.                                   Copy copies selected text to the paste 
  5944.                                   buffer 
  5945.  
  5946.                                   Paste inserts text from the paste buffer
  5947.                                   into the active window at the present 
  5948.                                   cursor location, if that location is 
  5949.                                   valid (for example, text cannot be 
  5950.                                   pasted into the source window).
  5951.  
  5952. View                              This menu contains the following 
  5953.                                   commands:
  5954.  
  5955.                                   Source opens a new Source window. Memory
  5956.                                   opens a new Memory window.
  5957.  
  5958.                                   Register acts as a switch to open and 
  5959.                                   close the Register window.
  5960.  
  5961.                                   8087 acts as a switch to open and close 
  5962.                                   the 8087 window.
  5963.  
  5964.                                   Local acts as a switch to open and close
  5965.                                   the Local window.
  5966.  
  5967.                                   Watch acts as a switch to open and close
  5968.                                   the Watch window.
  5969.  
  5970.                                   Command acts as a switch to open and 
  5971.                                   close the Command window.
  5972.  
  5973.                                   Help acts as a switch to open and close 
  5974.                                   the Help window.
  5975.  
  5976.                                   Maximize enlarges the current window so 
  5977.                                   that it fills the screen.
  5978.  
  5979.                                   Size changes the size of the current 
  5980.                                   window.
  5981.  
  5982.                                   Close closes the current window.
  5983.  
  5984. Search%@CR:C6A00070041 @%                            This menu contains the following 
  5985.                                   commands:
  5986.  
  5987.                                   Find searches for the next occurrence of
  5988.                                   a string or a regular expression that 
  5989.                                   you supply in the Find dialog box.
  5990.  
  5991.                                   Selected Text searches for the next 
  5992.                                   occurrence of a string of selected text.
  5993.  
  5994.                                   Repeat the Last Find searches for the 
  5995.                                   next occurrence of whatever you 
  5996.                                   specified in the previous Find command.
  5997.  
  5998.                                   Label/Function searches for a function 
  5999.                                   or label definition in the active Source
  6000.                                   window and, if one is found, changes the
  6001.                                   input focus to the active Source window.
  6002.  
  6003. Run                               This menu contains the following 
  6004.                                   command:
  6005.  
  6006.                                   Animate continues the execution of a 
  6007.                                   program while displaying the execution 
  6008.                                   path in the Source window. This type of 
  6009.                                   display is called an "animated trace" 
  6010.                                   display.
  6011.  
  6012. Watch                             This menu contains the following 
  6013.                                   commands:
  6014.  
  6015.                                   Add Watch adds an expression to the 
  6016.                                   Watch window.
  6017.  
  6018.                                   Delete Watch deletes an expression from 
  6019.                                   the Watch window.
  6020.  
  6021.                                   Set Breakpoint tells the program where 
  6022.                                   to halt execution; you can set 
  6023.                                   breakpoints on lines of source code, 
  6024.                                   variables and expressions, and Windows 
  6025.                                   messages.
  6026.  
  6027.                                   Edit Breakpoint performs editing 
  6028.                                   functions on breakpoints; they can be 
  6029.                                   added, removed, modified, enabled or 
  6030.                                   disabled.
  6031.  
  6032.                                   Quick Watch selects one expression for 
  6033.                                   the Quick Watch window.
  6034.  
  6035. Options                           This menu contains the following 
  6036.                                   commands:
  6037.  
  6038.                                   Source Window sets the display 
  6039.                                   characteristics of the active Source 
  6040.                                   window.
  6041.  
  6042.                                   Memory Window sets the display 
  6043.                                   characteristics of the active Memory 
  6044.                                   window.
  6045.  
  6046.                                   Trace Speed sets the speed of program 
  6047.                                   tracing and execution.
  6048.  
  6049.                                   Case Sensitivity, when turned on, treats
  6050.                                   uppercase and lowercase letters as 
  6051.                                   different characters. When turned off, 
  6052.                                   it does not differentiate between 
  6053.                                   uppercase and lowercase letters.
  6054.  
  6055.                                   386 Instructions, when turned on, 
  6056.                                   recognizes all 80386 instructions in 
  6057.                                   32-bit values. When turned off, it reads
  6058.                                   all instructions as 16-bit values 
  6059.  
  6060. Calls                             The contents and size of this menu 
  6061.                                   change as your program executes. It 
  6062.                                   shows the currently executing routine 
  6063.                                   and the trail of routines from which it 
  6064.                                   was called. Your application must 
  6065.                                   execute, at least, the beginning of the 
  6066.                                   WinMain procedure before %@AB@%CVW%@AE@% will 
  6067.                                   display the current routine. When you 
  6068.                                   select one of the lines in the Calls 
  6069.                                   menu, %@AB@%CVW%@AE@% displays the source code 
  6070.                                   corresponding to the calling location in
  6071.                                   the 
  6072.                                   active source window.
  6073.  
  6074. Help                              This menu contains Help information on 
  6075.                                   various CodeView topics.
  6076.  
  6077. %@TE: 154  7674 02 34 42 @%
  6078.  
  6079. For a more detailed description of the %@AB@%CVW%@AE@% menu and commands, refer to %@AB@%CVW%@AE@%
  6080. Help.  %@NL@%
  6081.  
  6082.  
  6083. %@2@%%@CR:C6A00070042 @%%@AB@%7.7  Getting On-line Help in %@AB@%CVW%@AE@%%@AE@%%@EH@%%@NL@%
  6084.  
  6085. %@AB@%CVW%@AE@% on-line Help contains detailed information and examples not found in
  6086. this chapter. You can get on-line help by choosing a command from the Help
  6087. menu described in the previous section, or selecting an item on your screen
  6088. and pressing F1. Help is available on items such as commands, menus%@CR:C6A00070043 @%, dialog
  6089. boxes, and error messages.%@CR:C6A00070044 @%%@NL@%
  6090.  
  6091.  
  6092. %@2@%%@CR:C6A00070045 @%%@AB@%7.8  Displaying Program Data%@AE@%%@EH@%%@NL@%
  6093.  
  6094. %@AB@%CVW%@AE@% offers a variety of ways to display program variables, processor
  6095. registers, and memory. You can also modify the values of all these items as
  6096. the program executes. This section describes how to display:%@CR:C6A00070046 @%%@NL@%
  6097.  
  6098.  
  6099.   ■   Variables in the Watch window.%@NL@%
  6100.  
  6101.   ■   Expressions in the Watch window.%@NL@%
  6102.  
  6103.   ■   Arrays and structures in the Watch window.%@NL@%
  6104.  
  6105.   ■   A single expression in the Quick Watch window.%@NL@%
  6106.  
  6107.   ■   Windows messages in the Command window.%@NL@%
  6108.  
  6109.   ■   Memory in the Memory window.%@NL@%
  6110.  
  6111.   ■   The contents of registers in the Register window.
  6112. %@NL@%
  6113.  
  6114.  
  6115.  
  6116. %@3@%%@CR:C6A00070047 @%%@AB@%7.8.1  Displaying Variables%@AE@%%@EH@%%@NL@%
  6117.  
  6118. You can use the Watch window to monitor the value of a given variable
  6119. throughout the execution of your program. For example, %@AB@%do%@AE@%, %@AB@%for%@AE@%, and %@AB@%while%@AE@%
  6120. loops can cause problems when they don't terminate correctly. By displaying
  6121. loop variables in the Watch window, you can determine if a loop variable
  6122. achieves its proper value.%@CR:C6A00070048 @%%@NL@%
  6123.  
  6124. To add a variable to the Watch window:  %@NL@%
  6125.  
  6126.  
  6127.   1.  In the Source window, use the mouse or the DIRECTION keys to position
  6128.       the cursor on the name of the variable you want to watch.%@NL@%
  6129.  
  6130.   2.  Select the Add Watch command from the Watch menu, or press CONTROL+W.%@NL@%
  6131.  
  6132. %@STUB@%      A dialog box will appear with the selected variable's name displayed
  6133.       in the Expression field.%@NL@%
  6134.  
  6135.   3.  Press ENTER or click the OK button to add the variable to the Watch
  6136.       window.%@NL@%
  6137.  
  6138. %@STUB@%      If you want to add a different variable than the one shown in the
  6139.       dialog box, type its name over the one displayed, and then press
  6140.       ENTER.%@NL@%
  6141.  
  6142.  
  6143. The Watch window appears at the top of the screen. Adding a Watch variable
  6144. opens the Watch window automatically if it is not already open.  %@NL@%
  6145.  
  6146. When you add a local variable, you may get the following message:  %@NL@%
  6147.  
  6148. %@AS@%  Watch Expression Not in Context%@AE@%
  6149.  
  6150. This message appears when program execution has not yet reached the C
  6151. function that defines the local variable. Global variables (those declared
  6152. outside C functions) never cause %@AB@%CVW%@AE@% to display this message; you can watch
  6153. them from anywhere in the program.  %@NL@%
  6154.  
  6155. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6156. NOTE
  6157.  
  6158. %@AI@%If you are debugging more than one application or DLL, and if two or more of
  6159. %@AI@%these contain global variables with the same name, %@AB@%CVW%@AE@%%@AI@% will display the
  6160. %@AI@%variable of only the first application or DLL containing that variable name.
  6161. %@AI@%%@AE@%%@AE@%
  6162.  
  6163. %@AI@%For example, if you are debugging App1 and App2, and both contain a global
  6164. %@AI@%variable named hInst, %@AB@%CVW%@AE@%%@AI@% will always display the value of hInst in App1,
  6165. %@AI@%even if %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% stopped at a breakpoint in App2.%@AE@%%@AE@%
  6166. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6167.  
  6168. The Watch window will hold as many variables as you like; the quantity is
  6169. limited only by available memory. You can scroll through the Watch window to
  6170. position it at those variables you want to view. %@AB@%CVW%@AE@% automatically updates
  6171. all watched variables as the program runs, including those not currently
  6172. visible.  %@NL@%
  6173.  
  6174. To remove a variable from the Watch window:  %@NL@%
  6175.  
  6176.  
  6177.   1.  Choose the Delete Watch command from the Watch menu.%@NL@%
  6178.  
  6179.   2.  Scroll through the dialog box and select the variable you want to
  6180.       remove.%@NL@%
  6181.  
  6182.  
  6183. You can also position the cursor on any line in the Watch window and press
  6184. CONTROL+Y to delete the line.%@CR:C6A00070049 @%%@NL@%
  6185.  
  6186.  
  6187. %@3@%%@CR:C6A00070050 @%%@AB@%7.8.2  Displaying Expressions%@AE@%%@EH@%%@NL@%
  6188.  
  6189. You might have noticed that the Add Watch dialog box prompts for an
  6190. expression, not simply a variable name. You can add any valid combination of
  6191. variables, constants, or operators as an expression for %@AB@%CVW%@AE@% to evaluate and
  6192. display in the Watch window.%@CR:C6A00070051 @%%@NL@%
  6193.  
  6194. The advantage of evaluating expressions is that you can reduce several
  6195. variables to a single value, which can be easier to interpret than the
  6196. components that make it up. For example, imagine a %@AB@%for%@AE@% loop with two
  6197. variables whose ratio is supposed to remain constant. You suspect that one
  6198. of these variables sometimes takes the wrong value. With (var1 / var2)
  6199. displayed as an expression in the Watch window, you can easily see when the
  6200. quotient changes, without having to mentally divide two numbers.  %@NL@%
  6201.  
  6202. You can also display Boolean expressions. For example, if a variable is
  6203. never supposed to be greater than 100 or less than 25, the expression (var >
  6204. 100) evaluates to 1 (true) when var goes out-of-bounds.  %@NL@%
  6205.  
  6206.  
  6207. %@3@%%@CR:C6A00070052 @%%@AB@%7.8.3  Displaying Arrays and Structures%@AE@%%@EH@%%@NL@%
  6208.  
  6209. A program variable is usually a scalar quantity (a single character, integer
  6210. or floating-point value). The variable appears in the Watch window with the
  6211. variable name to the left, followed by an equal sign (%@AB@%=%@AE@%), and the current
  6212. value. The Watch window must provide a different way to display "aggregate"
  6213. data items, such as arrays and structures.%@CR:C6A00070053 @%%@NL@%
  6214.  
  6215. Arrays and structures contain multiple values that can be arranged in one or
  6216. more layers. You can control how these variables appear in the Watch
  6217. window─whether all, part, or none of their internal structure is displayed.
  6218. %@NL@%
  6219.  
  6220. An array initially appears in the Watch window in this form:  %@NL@%
  6221.  
  6222. %@AS@%  +Wordholder[]  = [...]%@AE@%
  6223.  
  6224. The brackets indicate that this variable contains more than one element. The
  6225. plus sign (%@AB@%+%@AE@%) indicates that the variable has more elements than are
  6226. displayed on the screen. You can expand the variable to display any or all
  6227. of its components; this technique is called "dereferencing."  %@NL@%
  6228.  
  6229. To dereference (expand) the array, double-click anywhere on the line. You
  6230. can also position the cursor on the line and press ENTER. For example, if
  6231. Wordholder is a six-character array containing the word "Basic," the Watch
  6232. window display changes to:  %@NL@%
  6233.  
  6234. %@AS@%  -Wordholder[]
  6235. %@AS@%     [0]  =  66 'B'
  6236. %@AS@%     [1]  =  97 'a'
  6237. %@AS@%     [2]  =  115 's'
  6238. %@AS@%     [3]  =  105 'i'
  6239. %@AS@%     [4]  =  99 'c'
  6240. %@AS@%     [5]  =  0 ''%@AE@%
  6241.  
  6242. Note that both the individual character values and their ASCII decimal
  6243. equivalents are listed. The minus sign (-) indicates no further expansion is
  6244. possible. To contract the array, double-click its line again or position the
  6245. cursor on the line and press ENTER.  %@NL@%
  6246.  
  6247.  
  6248. %@4@%%@AB@%Displaying Character Arrays%@AE@%%@EH@%%@NL@%
  6249.  
  6250. If viewing a character array in this form is inconvenient, cast the
  6251. variable's name to a character pointer by placing the following in front of
  6252. the name:  %@NL@%
  6253.  
  6254. %@AS@%  (char *)%@AE@%
  6255.  
  6256. The character array is then displayed as a string delimited by apostrophes.%@CR:C6A00070054 @%%@NL@%
  6257.  
  6258.  
  6259. %@4@%%@AB@%Displaying Multidimensional Arrays%@AE@%%@EH@%%@NL@%
  6260.  
  6261. You can display arrays with more than one dimension. For example, imagine a
  6262. 5-by-5 integer array named Matrix, whose diagonal elements are the numbers 1
  6263. through 5 and whose other elements are zero. Unexpanded, the array is
  6264. displayed like this:%@CR:C6A00070055 @%%@NL@%
  6265.  
  6266. %@AS@%  +Matrix[]  = [...]%@AE@%
  6267.  
  6268. Double-clicking Matrix (or pressing ENTER) changes the display to:  %@NL@%
  6269.  
  6270. %@AS@%  -Matrix[]
  6271. %@AS@%    +[0][]  =  [...]
  6272. %@AS@%    +[1][]  =  [...]
  6273. %@AS@%    +[2][]  =  [...]
  6274. %@AS@%    +[3][]  =  [...]
  6275. %@AS@%    +[4][]  =  [...]%@AE@%
  6276.  
  6277. The actual values of the elements are not shown yet. You have to descend one
  6278. more level to see them. For example, to view the elements of the third row
  6279. of the array, position the cursor anywhere on the +[2] line and press ENTER.
  6280. The following code shows the third row of the array dereferenced:  %@NL@%
  6281.  
  6282. %@AS@%  -Matrix[]
  6283. %@AS@%    +[0][]  =  [...]
  6284. %@AS@%    +[1][]  =  [...]
  6285. %@AS@%    -[2][]
  6286. %@AS@%       [0]  = 0
  6287. %@AS@%       [1]  = 0
  6288. %@AS@%       [2]  = 3
  6289. %@AS@%       [3]  = 0
  6290. %@AS@%       [4]  = 0
  6291. %@AS@%    +[3][]  =  [...]
  6292. %@AS@%    +[4][]  =  [...]%@AE@%
  6293.  
  6294. Dereferencing the fifth row (+[4]) of the array produces this display:  %@NL@%
  6295.  
  6296. %@AS@%  -Matrix[]
  6297. %@AS@%    +[0][]  =  [...]
  6298. %@AS@%    +[1][]  =  [...]
  6299. %@AS@%    -[2][]
  6300. %@AS@%       [0]  = 0
  6301. %@AS@%       [1]  = 0
  6302. %@AS@%       [2]  = 3
  6303. %@AS@%       [3]  = 0
  6304. %@AS@%       [4]  = 0
  6305. %@AS@%    +[3][]  =  [...]
  6306. %@AS@%    -[4][]
  6307. %@AS@%       [0]  = 0
  6308. %@AS@%       [1]  = 0
  6309. %@AS@%       [2]  = 0
  6310. %@AS@%       [3]  = 0
  6311. %@AS@%       [4]  = 5%@AE@%
  6312.  
  6313. Any element of an array or structure can be independently expanded or
  6314. contracted; you need not display every element of the variable. If you only
  6315. want to view one or two elements of a large array, specify the particular
  6316. array or structure elements in the expression field of the Add Watch dialog
  6317. box.  %@NL@%
  6318.  
  6319. You can dereference a pointer in the same way as an array or structure. The
  6320. Watch window will display the pointer address, followed by all the elements
  6321. of the variable to which the pointer currently refers. You can display
  6322. multiple levels of indirection (that is, pointers referencing other
  6323. pointers) simultaneously.  %@NL@%
  6324.  
  6325.  
  6326. %@4@%%@AB@%Displaying Dynamic Array Elements%@AE@%%@EH@%%@NL@%
  6327.  
  6328. An array may have dynamic elements that change as some other variable
  6329. changes. Just as you can display a particular element of an array by
  6330. specifying its subscript, you can also display a dynamic array element, by
  6331. specifying its variable subscript. For example, suppose that the loop
  6332. variable p is a subscript for the array variable Catalogprice. The Watch
  6333. window expression Catalogprice[p] displays only the array element currently
  6334. specified by the variable p, not the entire array.%@CR:C6A00070056 @%%@NL@%
  6335.  
  6336. You can mix constant and variable subscripts. For example, the expression
  6337. BigArray[3][i] displays only the element in the third row of the array to
  6338. which the index variable i points.  %@NL@%
  6339.  
  6340.  
  6341. %@3@%%@CR:C6A00070057 @%%@AB@%7.8.4  Using the Quick Watch Command%@AE@%%@EH@%%@NL@%
  6342.  
  6343. Using the Quick Watch command is a convenient way to take a quick look at a
  6344. variable or expression. Since the Quick Watch window can only display one
  6345. variable at a time, you would not use it for most of the variables you want
  6346. to view.%@CR:C6A00070058 @%%@NL@%
  6347.  
  6348. Selecting the Quick Watch command from the Watch menu (or pressing SHIFT+F9)
  6349. displays the Quick Watch dialog box. If the text cursor is in the Source,
  6350. Local, or Watch window, the variable at the current cursor position appears
  6351. in the dialog box.  %@NL@%
  6352.  
  6353. The Quick Watch display automatically expands arrays and structures to their
  6354. first level. For example, an array with three dimensions will expand to the
  6355. first dimension. You can expand or contract an element just as you would in
  6356. the Watch window; position the cursor on the appropriate line and press
  6357. ENTER. If the array needs more lines than the Quick Watch window can
  6358. display, drag the mouse along the scroll bar, or press DOWN ARROW or PAGE
  6359. DOWN to view the rest of the array.  %@NL@%
  6360.  
  6361. You can add Quick Watch variables to the Watch window. If you decide to add
  6362. a Quick Watch item to the Watch window, select the Add Watch button. Arrays
  6363. and structures appear in the Watch window expanded as they were displayed in
  6364. the Quick Watch box.  %@NL@%
  6365.  
  6366.  
  6367. %@3@%%@CR:C6A00070059 @%%@AB@%7.8.5  Tracing Windows Messages%@AE@%%@EH@%%@NL@%
  6368.  
  6369. You can trace the occurrence of a Windows message or an entire class of
  6370. Windows messages by using the %@AB@%wwm%@AE@% (Watch Windows Message) command. %@AB@%CVW%@AE@% will
  6371. display the messages in the %@AB@%CVW%@AE@% Command window.%@CR:C6A00070060 @%%@NL@%
  6372.  
  6373. To trace a Windows message or message class, type the %@AB@%wwm%@AE@% command in the
  6374. Command window. The syntax for the command is:  %@NL@%
  6375.  
  6376. %@AS@%  wwm winproc msgname | msgclasses%@AE@%
  6377.  
  6378. The %@AI@%winproc%@AE@% parameter is the symbol name or address of an application's
  6379. window function. The %@AI@%msgname%@AE@% parameter is the name of a Windows message,
  6380. such as WM_PAINT. The %@AI@%msgclasses%@AE@% parameter is a string of characters that
  6381. identify one or more classes of messages to be traced. The classes are
  6382. consistent with those defined in the Windows Spy application; they are:  %@NL@%
  6383.  
  6384. %@AB@%Message Class%@AE@%                     %@AB@%Type of Windows Message%@AE@%
  6385. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6386. m                                 mouse 
  6387.  
  6388. w                                 window management
  6389.  
  6390. n                                 input
  6391.  
  6392. s                                 system
  6393.  
  6394. i                                 initialization
  6395.  
  6396. c                                 clipboard
  6397.  
  6398. d                                 DDE
  6399.  
  6400. z                                 nonclient
  6401.  
  6402. For example, the following command traces all mouse and input messages sent
  6403. to MainWndProc:  %@NL@%
  6404.  
  6405. %@AS@%  wwm MainWndProc mn%@AE@%
  6406.  
  6407. The %@AB@%CVW%@AE@% Command window displays Windows messages in the following  format:  %@NL@%
  6408.  
  6409. %@AS@%  HWND:lc00 wParm:0000 lParm:000000 msg:000F WM_PAINT%@AE@%
  6410.  
  6411.  
  6412. %@3@%%@CR:C6A00070061 @%%@AB@%7.8.6  Displaying Memory%@AE@%%@EH@%%@NL@%
  6413.  
  6414. Selecting the Memory command from the View menu opens a Memory window. %@AB@%CVW%@AE@%
  6415. allows you to have two Memory windows open at one time.%@CR:C6A00070062 @%%@NL@%
  6416.  
  6417. By default, memory is displayed as hexadecimal byte values, with 16 bytes
  6418. per line. At the end of each line is a second display of the same memory in
  6419. ASCII form. Values that correspond to printable ASCII characters (decimal 32
  6420. through 127) are displayed in that form. Values outside this range are shown
  6421. as periods ( . ).  %@NL@%
  6422.  
  6423. Byte values are not always the most convenient way to view memory. If the
  6424. area of memory you are examining contains character strings or
  6425. floating-point values, you might prefer to view them in a directly readable
  6426. form. The Memory Window command of the Options menu displays a dialog box
  6427. with a variety of display options:  %@NL@%
  6428.  
  6429.  
  6430.   ■   ASCII characters%@NL@%
  6431.  
  6432.   ■   Byte, word, or double-word binary values%@NL@%
  6433.  
  6434.   ■   Signed or unsigned integer decimal values%@NL@%
  6435.  
  6436.   ■   Short (32-bit), long (64-bit), or 10-byte (80-bit) floating-point
  6437.       values%@NL@%
  6438.  
  6439.  
  6440. You can also directly cycle through these display formats by pressing
  6441. SHIFT+F3.  %@NL@%
  6442.  
  6443. If a section of memory cannot be displayed as a valid floating-point number,
  6444. the number shown includes the characters NAN (not a number).  %@NL@%
  6445.  
  6446.  
  6447. %@4@%%@AB@%Displaying Local and Global Memory Objects%@AE@%%@EH@%%@NL@%
  6448.  
  6449. %@AB@%CVW%@AE@% also allows you to display global and local memory objects in their
  6450. respective Windows heaps. You can display the heap of global memory objects
  6451. with the %@AB@%wdg%@AE@% (Display Global Heap) command, and the heap of local memory
  6452. objects with the %@AB@%wdl%@AE@% (Display Local Heap) command. Both of these commands
  6453. will display the entire heap of global or local memory objects in the
  6454. Command window.%@CR:C6A00070063 @%%@NL@%
  6455.  
  6456. For the %@AB@%wdg%@AE@% command, you can specify the single object parameter to display
  6457. a partial list of the global heap. When you use the single object parameter
  6458. with the %@AB@%wdg%@AE@% command, the Command window will display the first five memory
  6459. objects in the global heap, starting at the handle rather than at the
  6460. beginning of the heap. The following illustrates the output format of the
  6461. %@AB@%wdg%@AE@% (Display Global Heap) command:  %@NL@%
  6462.  
  6463. %@AS@%  "                           
  6464. %@AS@%  047E   (0A7D) 00000020b   MYAPP    PRIV MOVEABLE DISCARDABLE
  6465. %@AS@%                                                
  6466. %@AS@%  0A6D          00000134b   MYAPP    DATA FIXED PGLOCKED=0001
  6467. %@AS@%                                
  6468. %@AS@%  0806  (0805)  00000600b   PDB (0465)
  6469. %@AS@%  
  6470. %@AS@%  FREE          000000A0b%@AE@%
  6471.  
  6472. The following describes the indicated fields:  %@NL@%
  6473.  
  6474. %@TH:  36  1121 01 03 36 37 @%
  6475. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6476. "  A global memory handle value. 
  6477.    Global memory objects are 
  6478.    displayed in the order in which 
  6479.    Windows manages them, which is 
  6480.    typically not in ascending handle 
  6481.    order.
  6482.  
  6483.    A memory selector. This value is 
  6484.    not displayed if the selector 
  6485.    value is the same as the global 
  6486.    handle, as is the case for DATA 
  6487.    objects.
  6488.  
  6489.    The length in bytes of the global 
  6490.    memory object.
  6491.  
  6492.    The name of the application or 
  6493.    library module that allocated the 
  6494.    object. The name "PDB" is for 
  6495.    Process Descriptor Block. 
  6496.  
  6497.    The type of global memory object:
  6498.  
  6499.    Type                                Meaning
  6500.  
  6501.    PRIV                                Application or DLL global data, or 
  6502.                                        system object
  6503.  
  6504.    CODE                                Code segment
  6505.  
  6506.    DATA                                Data segment of application or DLL
  6507.  
  6508.    FREE                                Free memory block in the global 
  6509.                                        heap
  6510.  
  6511. %@TE:  36  1121 01 03 36 37 @%
  6512.  
  6513. %@TH:  30   976 01 02 37 37 @%
  6514. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6515.   One or more of the following 
  6516.   combinations of memory allocation 
  6517.   attributes:
  6518.  
  6519.   %@AB@%MOVEABLE %@AE@%
  6520.  
  6521.   %@AB@%MOVEABLE DISCARDABLE%@AE@%
  6522.  
  6523.   %@AB@%FIXED%@AE@%
  6524.  
  6525.   The disposition of the object if it
  6526.   is moveable:
  6527.  
  6528.   Disposition                          Meaning
  6529.  
  6530.   LOCKED=%@AI@%number%@AE@%                        Number of times the object has been
  6531.                                        locked with the %@AB@%GlobalLock%@AE@% or %@AB@%%@AE@%
  6532.                                        %@AB@%LockData%@AE@% functions
  6533.  
  6534.   PGLOCKED=%@AI@%number%@AE@%                      Number of times Windows has locked 
  6535.                                        the object in its linear address 
  6536.                                        space.
  6537.  
  6538.   The owner handle of the Process 
  6539.   Descriptor Block.
  6540.  
  6541.   A free memory block, followed by 
  6542.   the size of the free block.
  6543.  
  6544. %@TE:  30   976 01 02 37 37 @%
  6545.  
  6546. The following shows the output of the %@AB@%wdl%@AE@% (Display Local Heap) command:  %@NL@%
  6547.  
  6548. %@AS@%  "             
  6549. %@AS@%  190A:  000A   BUSY   (16DA)%@AE@%
  6550.  
  6551. The following describes the indicated fields:  %@NL@%
  6552.  
  6553. %@TH:  16   482 01 03 36 37 @%
  6554. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6555. "  The offset of the local memory 
  6556.    object in the local data segment.
  6557.  
  6558.    The length in bytes of the object.
  6559.  
  6560.    One of the following dispositions:
  6561.  
  6562.    Disposition                         Meaning
  6563.  
  6564.    BUSY                                Currently allocated
  6565.  
  6566.    FREE                                A free block in the local heap
  6567.  
  6568.    A local memory handle
  6569.  
  6570. %@TE:  16   482 01 03 36 37 @%
  6571.  
  6572.  
  6573. %@4@%%@AB@%Displaying Variables with a Live Expression%@AE@%%@EH@%%@NL@%
  6574.  
  6575. Section 7.8.4, "Using the Quick Watch Command," explained how to display a
  6576. specific array element by adding the appropriate expression to the Watch
  6577. window. It is also possible to watch a particular array element or structure
  6578. element in the Memory window. This %@AB@%CVW%@AE@% display feature is called a "live
  6579. expression."%@CR:C6A00070064 @%%@NL@%
  6580.  
  6581. "Live" means that the area of memory displayed changes to reflect the value
  6582. of a pointer or subscript. For example, if Buffer is an array and pBuf is a
  6583. pointer to     that array, then *pBuf points to the array element currently
  6584. referenced. A live expression displays the section of memory beginning with
  6585. this element.  %@NL@%
  6586.  
  6587. %@AB@%CVW%@AE@% displays live expressions in a Memory window. To create a live
  6588. expression:  %@NL@%
  6589.  
  6590.  
  6591.   1.  Select the Memory Window command from the Options menu.%@NL@%
  6592.  
  6593.   2.  Select the live expression check box and type the name of the element
  6594.       you want to view. %@NL@%
  6595.  
  6596. %@STUB@%      For example, if StrgPtr is a pointer to an array of characters, and
  6597.       you want to see what it currently points to, type:%@NL@%
  6598.  
  6599. %@AS@%      *StrgPtr%@AE@%
  6600.  
  6601.   3.  Click the OK button or press ENTER.%@NL@%
  6602.  
  6603.  
  6604. A new Memory window opens. The first memory location in the window is the
  6605. first memory location of the live expression. The section of memory
  6606. displayed changes to the section the pointer currently references.  %@NL@%
  6607.  
  6608. You can use the Memory Window command of the Options menu to display the
  6609. value of the live expression in a readable form. This is especially
  6610. convenient when the live expression represents strings or floating-point
  6611. values, which are difficult to interpret in hexadecimal form.  %@NL@%
  6612.  
  6613. It is usually more convenient to view an item in the Watch window than as a
  6614. live expression. However, you might find some items easier to view as live
  6615. expressions. For example, you can examine what is currently at the top of
  6616. the stack by specifying SS:SP as the live expression.  %@NL@%
  6617.  
  6618.  
  6619. %@4@%%@AB@%Dereferencing Memory Handles%@AE@%%@EH@%%@NL@%
  6620.  
  6621. In a Windows application, the %@AB@%LocalLock%@AE@% and %@AB@%GlobalLock%@AE@% functions are used to
  6622. dereference memory handles into near or far pointers. In a debugging
  6623. session, you may know the handle of the memory object, but might not know
  6624. what near or far address it dereferences to, unless you are debugging in an
  6625. area where the program has just completed a %@AB@%LocalLock%@AE@% and %@AB@%GlobalLock%@AE@%
  6626. function call. To get the near and far pointer addresses for your local and
  6627. global handles, use the %@AB@%(lh)%@AE@% and %@AB@%(gh)%@AE@% type casts. For example, you could use
  6628. %@AB@%(lh)%@AE@% to dereference the array in the following code:%@CR:C6A00070065 @%%@NL@%
  6629.  
  6630. %@AS@%  HANDLE hLocalMem;
  6631. %@AS@%  int near *pnArray;
  6632. %@AS@%  hLocalMem = LocalAlloc(LMEM_MOVEABLE,100);
  6633. %@AS@%  pnArray = LocalLock(hLocalMem);
  6634. %@AS@%       /* load values into the array */
  6635. %@AS@%  LocalUnlock(hLocalMem);%@AE@%
  6636.  
  6637. To properly display this array in %@AB@%CVW%@AE@%, you would use the following command:
  6638. %@NL@%
  6639.  
  6640. %@AS@%  dw (lh)hLocalMem%@AE@%
  6641.  
  6642. If you set a breakpoint immediately after the %@AB@%LocalLock%@AE@% function, you could
  6643. find out where the local object was allocated in the application's data
  6644. segment by looking at the value of the pnArray variable. To display the
  6645. value of pnArray, use the following %@AB@%CVW%@AE@% command:  %@NL@%
  6646.  
  6647. %@AS@%  dw pnArray%@AE@%
  6648.  
  6649. Note that you cannot rely on the value of pnArray anywhere else in the
  6650. program because it may change or the memory object may move.  %@NL@%
  6651.  
  6652. If the memory object is a string, you can display it using double type
  6653. casting, as shown:  %@NL@%
  6654.  
  6655. %@AS@%  HANDLE hGlobalMem;
  6656. %@AS@%  LPSTR  lpstr;
  6657. %@AS@%  
  6658. %@AS@%  hGlobalMem = GlobalAlloc(GMEM_MOVEABLE, 10L)
  6659. %@AS@%  lpstr = GlobalLock(hGlobalMem);
  6660. %@AS@%  lstrcpy(lpstr,"ABCDEF");
  6661. %@AS@%  GlobalUnlock(hGlobalMem);%@AE@%
  6662.  
  6663. You could then display the contents of the string with the following
  6664. statement:  %@NL@%
  6665.  
  6666. %@AS@%  ? *(char far*) (gh)lpstr,s%@AE@%
  6667.  
  6668. The %@AB@%(gh)%@AE@% type cast will return a pointer to the far address of the global
  6669. memory object.  %@NL@%
  6670.  
  6671.  
  6672. %@3@%%@CR:C6A00070066 @%%@AB@%7.8.7  Displaying the Contents of Registers%@AE@%%@EH@%%@NL@%
  6673.  
  6674. Selecting the Register command from the View menu (or pressing F2) opens a
  6675. window on the right side of the screen. The current values of the
  6676. microprocessor's registers appear in this window.%@CR:C6A00070067 @%%@NL@%
  6677.  
  6678. At the bottom of the window are a group of mnemonics representing the
  6679. processor flags. When you first open the Register window, all values are
  6680. shown in normal-intensity video. Any subsequent changes are marked in
  6681. high-intensity video. For example, suppose the overflow flag is not set when
  6682. the Register window is first opened. The corresponding mnemonic is NV and it
  6683. appears in normal-intensity video. If the overflow flag is subsequently set,
  6684. the mnemonic changes to OV and appears in high-intensity video.  %@NL@%
  6685.  
  6686. Selecting the 386 Instructions command from the Options menu displays the
  6687. registers as 32-bit values. This command is valid only if your computer uses
  6688. an 80386 processor. Selecting this command a second time changes the
  6689. registers back to 16-bit values.  %@NL@%
  6690.  
  6691. You can also display the registers of an 8087/287/387 coprocessor in a
  6692. separate window by selecting the 8087 command from the View menu. If your
  6693. program uses the coprocessor emulator, the emulated registers are displayed
  6694. instead.  %@NL@%
  6695.  
  6696.  
  6697. %@3@%%@CR:C6A00070068 @%%@AB@%7.8.8  Displaying Windows Modules%@AE@%%@EH@%%@NL@%
  6698.  
  6699. The %@AB@%wdm%@AE@% (Dump Modules) command displays a list of all the DLL and task
  6700. modules that Windows has loaded. For each module, the list shows the module
  6701. handle, the type of module (DLL or task), the name of the module, and the
  6702. pathname of the module.  %@NL@%
  6703.  
  6704.  
  6705. %@2@%%@CR:C6A00070069 @%%@AB@%7.9  Modifying Program Data%@AE@%%@EH@%%@NL@%
  6706.  
  6707. You can easily change the values of variables, memory locations, or
  6708. registers displayed in the Watch, Local, Memory, Register, or 8087 window.
  6709. Simply position the cursor at the value you want to change and type in the
  6710. appropriate value. If you change your mind, press ALT+BACKSPACE to undo the
  6711. last change you made.  %@NL@%
  6712.  
  6713. The Memory window displays the starting address of each line in
  6714. segment:offset form. Altering the address automatically shifts the display
  6715. to the corresponding section of memory. If that section is not used by your
  6716. program, memory locations are displayed as double question marks (??).%@CR:C6A00070070 @%%@NL@%
  6717.  
  6718. You can also change the values of memory locations by modifying the right
  6719. side of the memory display, which shows memory values in ASCII form. For
  6720. example, to change a byte from decimal 75 to decimal 85, place the cursor
  6721. over the letter K, which corresponds to the position where the memory value
  6722. is 75 (K is ASCII 75), and type in U (U is ASCII 85).  %@NL@%
  6723.  
  6724. To change a processor flag, click its mnemonic; or position the cursor on a
  6725. mnemonic, and then press any key (except TAB or SPACEBAR). Repeat these
  6726. operations to restore the flag to its previous setting.  %@NL@%
  6727.  
  6728. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6729. IMPORTANT
  6730.  
  6731. %@AI@%You should be especially cautious when altering "machine-level" values. The
  6732. %@AI@%effect of changing a register, flag, or memory location may vary from no
  6733. %@AI@%effect at all to crashing the operating system. You can alter most items
  6734. %@AI@%from the Watch window; although sometimes it is useful to modify a register
  6735. %@AI@%or memory directly.%@AE@%
  6736. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6737.  
  6738. One example of altering memory directly would be to replace values in the AX
  6739. register. C functions return their values through this register. By altering
  6740. the AX register directly, you can change a returned value without having to
  6741. execute the function that returns it.%@CR:C6A00070071 @%%@NL@%
  6742.  
  6743.  
  6744. %@2@%%@CR:C6A00070072 @%%@AB@%7.10  Controlling Program Execution%@AE@%%@EH@%%@NL@%
  6745.  
  6746. This section describes how you can use %@AB@%CVW%@AE@% to control the execution of your
  6747. application.%@CR:C6A00070073 @%%@NL@%
  6748.  
  6749. There are two possible forms of program execution in CodeView for Windows:  %@NL@%
  6750.  
  6751. %@AB@%Program Execution%@AE@%                 %@AB@%Description%@AE@%
  6752. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6753. Continuous                        The program executes until either a 
  6754.                                   previously specified "breakpoint" has 
  6755.                                   been reached or the program terminates 
  6756.                                   normally.
  6757.  
  6758. Single-step                       The program pauses after each line of 
  6759.                                   code has been executed. %@CR:C6A00070074 @%
  6760.  
  6761. Sections 7.10.1, "Continuous Execution," and 7.10.2, "Single-Step
  6762. Execution," explain the most effective way to use each form of execution.
  6763. Section 7.10.3, "Jumping to a Particular Location," explains how to force
  6764. the system to jump to a particular location in your program. Section 7.10.4,
  6765. "Interrupting Your Program," tells you how to interrupt your program.  %@NL@%
  6766.  
  6767.  
  6768. %@3@%%@CR:C6A00070075 @%%@AB@%7.10.1  Continuous Execution%@AE@%%@EH@%%@NL@%
  6769.  
  6770. Continuous execution lets you quickly execute bug-free sections of code. The
  6771. simplest way to initiate continuous execution is to click the right mouse
  6772. button on the line of code you want to debug or examine in more detail. The
  6773. program executes at full speed up to the start of this line, then pauses.
  6774. You can do the same thing by positioning the text cursor on this line, then
  6775. pressing F7.%@CR:C6A00070076 @%%@NL@%
  6776.  
  6777. You can also pause execution at a specific line of code with a breakpoint.
  6778. %@AB@%CVW%@AE@% provides you with several types of breakpoints to control your program's
  6779. execution. The sections that follow describe how to use breakpoints.  %@NL@%
  6780.  
  6781.  
  6782. %@4@%%@AB@%Selecting Breakpoint Lines%@AE@%%@EH@%%@NL@%
  6783.  
  6784. You can skip over the parts of the program that you don't want to examine by
  6785. specifying one or more lines as breakpoints. The program executes at full
  6786. speed up to the first breakpoint, then pauses. Pressing F5 continues program
  6787. execution up to the next breakpoint, and so on. You can set as many
  6788. breakpoints as you want, provided that you have available memory.%@CR:C6A00070077 @%%@NL@%
  6789.  
  6790. There are several ways to set breakpoints:  %@NL@%
  6791.  
  6792.  
  6793.   ■   Double-click anywhere on the desired breakpoint line. The selected
  6794.       line is highlighted to show that it is a breakpoint. To remove the
  6795.       breakpoint, double-click on the line a second time.%@NL@%
  6796.  
  6797.   ■   Position the cursor anywhere on the line at which you want execution
  6798.       to pause. Press F9 to select the line as a breakpoint and highlight
  6799.       it. Press F9 a second time to remove the breakpoint and highlighting.%@NL@%
  6800.  
  6801.   ■   Display the Set Breakpoint dialog box by choosing Set Breakpoint from
  6802.       the Watch menu. Choose one of the breakpoint options that permits you
  6803.       to specify a line (location). The line on which the text cursor
  6804.       currently rests is the default breakpoint line in the Location field.
  6805.       If this line is not the location you want, replace it with the line
  6806.       number where you want the breakpoint. When you type in a new line
  6807.       number, make sure that you precede it with a period.%@NL@%
  6808.  
  6809.  
  6810. A breakpoint line must be a program line that represents executable code.
  6811. You cannot select a blank line, a comment line, or a declaration line (such
  6812. as a variable declaration or a preprocessor statement) as a breakpoint.%@CR:C6A00070078 @%%@NL@%
  6813.  
  6814. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6815. NOTE
  6816.  
  6817. %@AI@%By default, Microsoft compilers optimize your code. In the process of
  6818. %@AI@%optimization, some lines of code may be repositioned or reorganized for more
  6819. %@AI@%efficient execution. These changes can prevent CodeView from recognizing the
  6820. %@AI@%corresponding lines of source code as breakpoints. Therefore, it is a good
  6821. %@AI@%idea to disable optimization during development (use the %@AB@%/Od%@AE@%%@AI@% switch). You
  6822. %@AI@%can restore optimization once debugging is completed.%@AE@%%@AE@%
  6823. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6824.  
  6825. A breakpoint can also be set at a function or an explicit address. To set a
  6826. breakpoint at a function, simply enter its name in the Set Breakpoint dialog
  6827. box. To set a breakpoint at an address, enter the address in CS:IP form.  %@NL@%
  6828.  
  6829. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6830. NOTE
  6831.  
  6832. %@AI@%If you are debugging more than one application or DLL that share names for
  6833. %@AI@%certain window procedures (such as MainWndProc), you can only refer by name
  6834. %@AI@%to the procedure that is defined in the first application or DLL.%@AE@%
  6835. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6836.  
  6837. You can remove a breakpoint by selecting it in the Source window and
  6838. pressing F9 or the using the Edit Breakpoints screen of the Watch menu. When
  6839. your program pauses at a breakpoint, you can continue execution by pressing
  6840. F5 or clicking the F5 button in the display. %@CR:C6A00070079 @%  %@NL@%
  6841.  
  6842.  
  6843. %@4@%%@AB@%Setting Breakpoint Values%@AE@%%@EH@%%@NL@%
  6844.  
  6845. Breakpoints are not limited to specific lines of code. %@AB@%CVW%@AE@% can also break
  6846. execution when an expression reaches a particular value, or just changes
  6847. value. Use one of the following methods to set a breakpoint value:%@CR:C6A00070080 @%%@NL@%
  6848.  
  6849.  
  6850.   ■   To pause execution when an expression %@AI@%changes%@AE@% value, type the name of
  6851.       the expression in the expression field.%@NL@%
  6852.  
  6853.   ■   To pause execution when a expression %@AI@%reaches%@AE@% a particular value, type
  6854.       an expression that is usually false in the Expression field of the Set
  6855.       Breakpoint dialog box. %@NL@%
  6856.  
  6857. %@STUB@%      For example, if you want to pause when a variable called looptest
  6858.       equals 17, type:%@NL@%
  6859.  
  6860. %@AS@%      looptest == 17. %@AE@%
  6861.  
  6862. %@STUB@%      Execution will halt when this statement becomes true.%@NL@%
  6863.  
  6864.  
  6865. You can also use the Set Breakpoint dialog box to combine value breakpoints
  6866. with line breakpoints so that execution stops at a specific line only if an
  6867. expression has simultaneously reached a particular value, or changed value.
  6868. %@NL@%
  6869.  
  6870. For large variables (such as arrays or character strings), you can specify
  6871. the number of bytes you want checked (up to 32K) in the length field.  %@NL@%
  6872.  
  6873. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6874. NOTE
  6875.  
  6876. %@AI@%When a breakpoint is tied to a variable, %@AB@%CVW%@AE@%%@AI@% must check the variable's value
  6877. %@AI@%after each machine instruction is executed. This computational overhead
  6878. %@AI@%slows execution greatly. For maximum speed when debugging, either tie value
  6879. %@AI@%breakpoints to specific lines, or only set value breakpoints after you have
  6880. %@AI@%reached the section of code that needs to be debugged.%@AE@%%@AE@%
  6881. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6882.  
  6883.  
  6884. %@4@%%@AB@%Setting Breakpoints on Windows Messages%@AE@%%@EH@%%@NL@%
  6885.  
  6886. In the Windows environment, you can also set a breakpoint on a Windows
  6887. message or an entire class of Windows messages. This feature lets you track
  6888. your application's response to user input and window-management messages.%@CR:C6A00070081 @%%@NL@%
  6889.  
  6890. To set a breakpoint on a Windows message or message class, type the %@AB@%wbm%@AE@%
  6891. (Windows Breakpoint Message) command in the Watch window. The syntax for the
  6892. command is:  %@NL@%
  6893.  
  6894. %@AS@%  wbm winproc msgname | msgclasses%@AE@%
  6895.  
  6896. The %@AI@%winproc%@AE@% parameter is the symbol name or address of an application's
  6897. window function. The %@AI@%msgname%@AE@% parameter is the name of a Windows message,
  6898. such as WM_PAINT. The %@AI@%msgclasses%@AE@% parameter is a string of characters that
  6899. identify one or more classes of messages. The classes are consistent with
  6900. those defined in the Windows Spy application; they are:  %@NL@%
  6901.  
  6902. %@AB@%Message Class%@AE@%                     %@AB@%Type of Windows Message%@AE@%
  6903. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6904. m                                 mouse 
  6905.  
  6906. w                                 window management
  6907.  
  6908. n                                 input
  6909.  
  6910. s                                 system
  6911.  
  6912. %@AB@%Message Class%@AE@%                     %@AB@%Types of Windows Message%@AE@%
  6913. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6914. i                                 initialization
  6915.  
  6916. c                                 clipboard
  6917.  
  6918. d                                 DDE
  6919.  
  6920. z                                 nonclient
  6921.  
  6922. For example, if your application is failing to refresh the client area of a
  6923. window, you might set a breakpoint on the WM_PAINT message so that you can
  6924. watch your program's behavior. The following command will halt execution
  6925. whenever the application's MainWndProc function receives a WM_PAINT message:
  6926. %@NL@%
  6927.  
  6928. %@AS@%  wbm MainWndProc WM_PAINT%@AE@%
  6929.  
  6930.  
  6931. %@4@%%@AB@%Using Breakpoints%@AE@%%@EH@%%@NL@%
  6932.  
  6933. Here are several examples that show how breakpoints can help you find the
  6934. cause of a problem.%@CR:C6A00070082 @%%@NL@%
  6935.  
  6936. One of the most common bugs is a %@AB@%for%@AE@% loop that executes too many or too few
  6937. times. If you set a breakpoint that encloses the loop statements, the
  6938. program pauses after each iteration. With the loop variable or critical
  6939. program variables in the Watch or Local windows, you can easily see what the
  6940. loop is doing wrong.  %@NL@%
  6941.  
  6942. You do not have to pause a program the first time you reach a breakpoint.
  6943. %@AB@%CVW%@AE@% lets you specify the number of times you want to ignore the breakpoint
  6944. condition before pausing. To specify how many times a breakpoint line is
  6945. executed:  %@NL@%
  6946.  
  6947.  
  6948.   1.  Choose the Set Breakpoint command from the Watch menu.%@NL@%
  6949.  
  6950.   2.  Type the decimal number in the Pass Count field of the dialog box.%@NL@%
  6951.  
  6952.  
  6953. For example, suppose your program repeatedly calls a function to create a
  6954. binary tree. You suspect that something goes wrong with the process about
  6955. halfway through. You could mark the line that calls the function as the
  6956. breakpoint, then specify how many times this line is to execute before
  6957. execution pauses. Running the program creates a representative (but
  6958. unfinished) tree structure that can be examined from the Watch window. You
  6959. can then continue your analysis using "single-step" execution, which is
  6960. described in the next section.  %@NL@%
  6961.  
  6962. Another programming error is erroneously assigning a value to a variable. If
  6963. you enter a variable in the expression field of the Set Breakpoint dialog
  6964. box, execution will break every time the variable changes value. By
  6965. evaluating a variable expression, you can halt execution when its value
  6966. changes unintentionally.  %@NL@%
  6967.  
  6968. Breakpoints are a convenient way to pause the program so that you can assign
  6969. new values to variables. For example, if a limit value is set by a variable,
  6970. you can change the value to see if it affects the program's execution.
  6971. Similarly, you can pass a variety of values to a %@AB@%switch%@AE@% statement to see if
  6972. they are correctly processed. This ability to alter variables is an
  6973. especially convenient way to test new functions without having to write a
  6974. stand-alone test program.  %@NL@%
  6975.  
  6976. When your program reaches a breakpoint and you change a variable, you might
  6977. want to watch each step execute while you check the value of that variable.
  6978. You can do this with a %@AB@%CVW%@AE@% technique called "single-stepping."  %@NL@%
  6979.  
  6980.  
  6981. %@3@%%@CR:C6A00070083 @%%@AB@%7.10.2  Single-Step Execution%@AE@%%@EH@%%@NL@%
  6982.  
  6983. When single-stepping, %@AB@%CVW%@AE@% pauses after each line of code is executed. If a
  6984. line contains more than one executable statement, %@AB@%CVW%@AE@% executes all the
  6985. statements on the line before pausing. The next line to be executed is
  6986. highlighted in reverse video.  %@NL@%
  6987.  
  6988. You can use either the Step function or the Trace function to single-step
  6989. through a program. Step does not display each function call as the program
  6990. executes. All the code in the function is executed; but the function appears
  6991. to execute as a single step. To use Step, press F10. Trace displays each
  6992. step of every function for which %@AB@%CVW%@AE@% has symbolic information. Each line of
  6993. the function is executed as a separate step. To use Trace, press F8. (%@AB@%CVW%@AE@%
  6994. has no symbolic information about run-time functions; therefore, they are
  6995. executed as a single step.) You can alternate between Trace and Step as you
  6996. like. The method you use depends on whether you want to see what happens
  6997. within a particular function.%@CR:C6A00070084 @%%@NL@%
  6998.  
  6999. You can trace through the program continuously, without having to press F8,
  7000. by choosing the Animate command from the Run menu. The speed of execution is
  7001. controlled by the Trace Speed command from the Options menu. You can halt
  7002. animated execution at any time by pressing any key.%@CR:C6A00070085 @%%@CR:C6A00070086 @%%@NL@%
  7003.  
  7004. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7005. NOTE
  7006.  
  7007. %@AI@%Attempting to step or trace through Windows start-up code while viewing
  7008. %@AI@%assembly-language listing will cause unpredictable results. To step through
  7009. %@AI@%your program while viewing assembly-language instructions, first set a
  7010. %@AI@%breakpoint at the WinMain function and begin stepping through the program
  7011. %@AI@%only after the breakpoint has been reached.%@AE@%
  7012. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7013.  
  7014.  
  7015. %@3@%%@CR:C6A00070087 @%%@AB@%7.10.3  Jumping to a Particular Location%@AE@%%@EH@%%@NL@%
  7016.  
  7017. At times you may wish to force the system to jump to a particular location
  7018. in your program during execution. For example, you might want to avoid
  7019. executing code that you know has bugs, or you might want to repeatedly
  7020. execute a particularly troublesome portion of your program.  %@NL@%
  7021.  
  7022. To jump to a specific location in your application:  %@NL@%
  7023.  
  7024.  
  7025.   1.  Choose the Source command from the Options menu and select the Mix
  7026.       Source and Assembly and the Show Machine Code options.%@NL@%
  7027.  
  7028.   2.  In the Source window, view the line of source code to which you want
  7029.       to jump.%@NL@%
  7030.  
  7031.   3.  Examine the code offset of the first machine instruction for the
  7032.       assembled statement.%@NL@%
  7033.  
  7034.   4.  Use the %@AB@%rip%@AE@% (Register IP) command to change the IP register to this
  7035.       code offset, supplying the value as a hexadecimal number.%@NL@%
  7036.  
  7037.  
  7038. %@AB@%CVW%@AE@% highlights the line to which you have jumped.  %@NL@%
  7039.  
  7040. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7041. IMPORTANT
  7042.  
  7043. %@AI@%Do not jump from one procedure to another. Jumping from one procedure to
  7044. %@AI@%another disrupts the stack. %@AE@%
  7045.  
  7046. %@AI@%When jumping to a specific point in your application, remember that
  7047. %@AI@%assembled source code for a given statement may rely on memory values and
  7048. %@AI@%registers set in previous instructions that you have skipped. This is
  7049. %@AI@%particularly true if you have not disabled optimization by compiling the
  7050. %@AI@%source module using the %@AB@%-Od%@AE@%%@AI@% option.%@AE@%%@AE@%
  7051. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7052.  
  7053.  
  7054. %@3@%%@CR:C6A00070088 @%%@AB@%7.10.4  Interrupting Your Program%@AE@%%@EH@%%@NL@%
  7055.  
  7056. There may be times when you want to halt your program immediately. You can
  7057. force an immediate interrupt of a %@AB@%CVW%@AE@% session by pressing
  7058. CONTROL+ALT+SYSREQ. You then have the opportunity to change debugging
  7059. options, such as adding breakpoints and modifying variables. To resume
  7060. continuous execution, just press F5; to single-step, press F10.%@CR:C6A00070089 @%  %@NL@%
  7061.  
  7062. You should take care when you interrupt the %@AB@%CVW%@AE@% session. For example, if you
  7063. interrupted the session while Windows code or other system code was
  7064. executing, attempting to use the Step or Trace functions will produce
  7065. unpredictable results. When you interrupt the %@AB@%CVW%@AE@% session, it is usually
  7066. safest to set breakpoints in your code and then resume continuous execution,
  7067. rather than using Step or Trace.  %@NL@%
  7068.  
  7069. An infinite loop in your code presents a special problem. Again, since you
  7070. should avoid using Step or Trace after interrupting your program, you should
  7071. try to locate the loop by setting breakpoints in places you suspect are in
  7072. the loop.  %@NL@%
  7073.  
  7074. Whether or not you locate the infinite loop, you will have to terminate your
  7075. application. The %@AB@%wka%@AE@% (Windows Kill Application) command terminates the
  7076. currently executing task. Since this task is not necessarily your program,
  7077. you should use the %@AB@%wka%@AE@% command only when your application is the currently
  7078. executing task.  %@NL@%
  7079.  
  7080. If your application is the currently executing task and is executing a
  7081. module containing symbol information, the %@AB@%CVW%@AE@% Source window will highlight
  7082. the current instruction. However, if your application contains modules that
  7083. were not compiled with the %@AB@%/Zi%@AE@% option, it will be more difficult to
  7084. determine whether the assembly-language code displayed in the Source window
  7085. belongs to your application or to another task. In this case, use the %@AB@%wdg%@AE@%
  7086. (Windows Dump Global Heap) command, supplying the value in the CS register
  7087. as the parameter. %@AB@%CVW%@AE@% will display a listing that will indicate whether the
  7088. code segment belongs to your application. If it does, you can use the %@AB@%wka%@AE@%
  7089. command without affecting other tasks. However, the %@AB@%wka%@AE@% command does not
  7090. perform all the cleanup tasks associated with the normal termination of a
  7091. Windows application. For example, GDI objects created during the execution
  7092. of the program but not destroyed before you terminated the program will
  7093. remain allocated in the system-wide global heap. This will reduce the amount
  7094. of memory available during your Windows session. Because of this, you should
  7095. use the %@AB@%wka%@AE@% command to terminate the application only if you cannot
  7096. terminate it normally.  %@NL@%
  7097.  
  7098. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7099. NOTE
  7100.  
  7101. %@AI@%The %@AB@%wka%@AE@%%@AI@% command simulates a fatal error in your application. Because of
  7102. %@AI@%this, when you use the %@AE@%%@AI@%%@AB@%wka%@AE@%%@AE@%%@AI@% command, Windows displays an "Unexpected
  7103. %@AI@%Application Error" message box. %@AE@%%@AE@%
  7104.  
  7105. %@AI@%After you close this message box, Windows may not release subsequent mouse
  7106. %@AI@%input messages from the system queue until you press a key. If this happens,
  7107. %@AI@%the cursor will move on the Windows screen, but Windows will not appear to
  7108. %@AI@%respond to the mouse. After you press any key, Windows will then respond to
  7109. %@AI@%all mouse events that occurred before you pressed the key. %@AE@%
  7110. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7111.  
  7112.  
  7113. %@2@%%@CR:C6A00070090 @%%@AB@%7.11  Handling Abnormal Termination of the Application%@AE@%%@EH@%%@NL@%
  7114.  
  7115. Your application can terminate abnormally in one of two ways while you are
  7116. debugging it with %@AB@%CVW%@AE@%. It can cause a fatal exit, or it can cause a GP
  7117. fault. In both cases, %@AB@%CVW%@AE@% regains control, giving you the opportunity to
  7118. examine the state of the system when your application terminated. In
  7119. particular, you can often determine the location in your application's code
  7120. where the error occurred, or which call caused the error. %@AB@%CVW%@AE@% allows you to
  7121. view registers, dump the global heap, display memory, and examine the source
  7122. code.  %@NL@%
  7123.  
  7124. Once you have determined where the error occurred, use the %@AB@%q%@AE@% command to
  7125. terminate %@AB@%CVW%@AE@%. In most cases, control will return to Windows.  %@NL@%
  7126.  
  7127.  
  7128. %@3@%%@CR:C6A00070091 @%%@AB@%7.11.1  Handling a Fatal Exit%@AE@%%@EH@%%@NL@%
  7129.  
  7130. If the abnormal termination was a fatal exit, and the application was
  7131. running with the retail version of Windows, the %@AB@%CVW%@AE@% Command window displays
  7132. the following:  %@NL@%
  7133.  
  7134. %@AS@%  Trap 13 (0DH) -- General Protection Fault.%@AE@%
  7135.  
  7136. The CS:IP register contains an address in the Windows code itself. This
  7137. small amount of information provides little to help you locate the last call
  7138. that your application made before the error was detected.  %@NL@%
  7139.  
  7140. If, however, your application was running with the debugging version of
  7141. Windows, the %@AB@%CVW%@AE@% Command window displays a stack trace that is much more
  7142. useful for finding the error in your source code.  %@NL@%
  7143.  
  7144. After the stack trace appears in the %@AB@%CVW%@AE@% Command window, Windows displays
  7145. this prompt:  %@NL@%
  7146.  
  7147. %@AS@%  Abort, Break, or Ignore?%@AE@%
  7148.  
  7149. To locate the cause of the error, press B. This allows %@AB@%CVW%@AE@% to regain control
  7150. from Windows.  %@NL@%
  7151.  
  7152. In most cases, the stack trace will have scrolled off the top of the %@AB@%CVW%@AE@%
  7153. Command window, but once %@AB@%CVW%@AE@% regains control, you can scroll it back to
  7154. examine the entire stack trace. The following information appears at the top
  7155. of the stack trace:  %@NL@%
  7156.  
  7157.  
  7158.   ■   A fatal exit number. See the %@AI@%Reference, Volume 2%@AE@%, for a listing of the
  7159.       possible fatal exit numbers.%@NL@%
  7160.  
  7161.   ■   The CS:IP address or the name of the Windows function where the error
  7162.       was detected, or the name of the last Windows function called before
  7163.       the error was detected. %@NL@%
  7164.  
  7165.  
  7166. Following this information, additional Windows functions might be listed in
  7167. the stack trace. Somewhere near the top of the stack trace a CS:IP address
  7168. will be listed without a Windows function name. In most cases, this is the
  7169. location in the source code of your application where the call to a Windows
  7170. function occurred that triggered the fatal exit.  %@NL@%
  7171.  
  7172. To examine this location in your source code, open a Source window if
  7173. necessary and use the %@AB@%v%@AE@% command followed by the CS:IP address, being sure to
  7174. precede both the segment and the offset with the "0x" hexadecimal prefix.
  7175. For example, if %@AB@%CVW%@AE@% indicates that the error occurred at 07DA:0543 in your
  7176. application, enter the following command:  %@NL@%
  7177.  
  7178. %@AS@%  v 0x07DA:0x0543%@AE@%
  7179.  
  7180. If you had compiled the module where the error occurred using the C Compiler
  7181. %@AB@% -Zi%@AE@% option, the %@AB@%CVW%@AE@% Source window displays the location in your code where
  7182. the errant call to a Windows function occurred.  %@NL@%
  7183.  
  7184. The first CS:IP address without a name in the stack trace may point to a
  7185. location in your code without symbols. For example, the code might be in a
  7186. DLL you didn't specify with the %@AB@%/L%@AE@% command-line option or at the %@AB@%CVW%@AE@% prompt.
  7187. Or the address might be in a module that you did not compile with the %@AB@%-Zi%@AE@%
  7188. option. In such cases, %@AB@%CVW%@AE@% reports that no source code is available. If this
  7189. happens, continue down the stack trace, using the %@AB@%v%@AE@% command with each
  7190. unnamed CS:IP address. You likely will find a location in a module that was
  7191. compiled with the %@AB@%-Zi%@AE@% option, and this location might have made a call into
  7192. one of your modules which you did not compile using the %@AB@%-Zi%@AE@% option.  %@NL@%
  7193.  
  7194. Section 7.16, "A Sample Session in CVW," shows a sample fatal-exit stack
  7195. trace and how to use that information to locate an error.  %@NL@%
  7196.  
  7197.  
  7198. %@3@%%@CR:C6A00070092 @%%@AB@%7.11.2  Handling a GP Fault%@AE@%%@EH@%%@NL@%
  7199.  
  7200. When a GP fault occurs, %@AB@%CVW%@AE@% displays a message in the Command window to
  7201. notify you of the event. If the GP fault occurred at an instruction in one
  7202. of your modules, %@AB@%CVW%@AE@% displays the corresponding source code if it had been
  7203. compiled using the %@AB@%-Zi%@AE@% option. You can obtain information about the chain of
  7204. calls leading up to the GP fault using the %@AB@%CVW%@AE@% Call menu. This displays a
  7205. backtrace of calls in the form of a series of segments and offsets, starting
  7206. at the most recent call.  %@NL@%
  7207.  
  7208. If your application was running with the debugging version of Windows, the
  7209. backtrace will show window function names next to some of the segment/offset
  7210. pairs. By examining the window function names, you might be able to
  7211. determine where in your code the error occurred.  %@NL@%
  7212.  
  7213.  
  7214. %@2@%%@CR:C6A00070093 @%%@AB@%7.12  Ending a CVW Session%@AE@%%@EH@%%@NL@%
  7215.  
  7216. To terminate a %@AB@%CVW%@AE@% session, use the Exit command in the File menu, or type
  7217. the %@AB@%q%@AE@% (Quit) command in the Command window.%@CR:C6A00070094 @%%@NL@%
  7218.  
  7219.  
  7220. %@2@%%@CR:C6A00070095 @%%@AB@%7.13  Restarting a %@AB@%CVW%@AE@% Debugging Session%@AE@%%@EH@%%@NL@%
  7221.  
  7222. You can terminate your application without terminating %@AB@%CVW.%@AE@% While Windows is
  7223. terminating the application, it will notify %@AB@%CVW%@AE@%, and %@AB@%CVW%@AE@% will display the
  7224. following message:  %@NL@%
  7225.  
  7226. %@AS@%  Program terminated normally (0)%@AE@%
  7227.  
  7228. The value in parentheses is the return value of the WinMain function. This
  7229. value is usually the %@AI@%wParam%@AE@% parameter of the WM_QUIT message, which in turn
  7230. is the value of the %@AI@%nExitCode%@AE@% parameter passed to the %@AB@%PostQuitMessage%@AE@%
  7231. function.  %@NL@%
  7232.  
  7233. If you were debugging more than one application or DLL, you can then use the
  7234. %@AB@%go%@AE@% command to continue the debugging session. You can also restart the
  7235. application you just terminated by using the %@AB@%go%@AE@% command and then restarting
  7236. your application through Windows File Manager or Program Manager.%@CR:C6A00070096 @%%@NL@%
  7237.  
  7238.  
  7239. %@2@%%@CR:C6A00070097 @%%@AB@%7.14  Advanced %@AB@%CVW%@AE@% Techniques%@AE@%%@EH@%%@NL@%
  7240.  
  7241. Once you are comfortable displaying and changing variables, and controlling
  7242. the program's execution, you might want to experiment with the following
  7243. advanced techniques:  %@NL@%
  7244.  
  7245.  
  7246.   ■   Using multiple Source windows%@NL@%
  7247.  
  7248.   ■   Calling functions%@NL@%
  7249.  
  7250.   ■   Checking for undefined pointers%@NL@%
  7251.  
  7252.   ■   Handling register variables%@NL@%
  7253.  
  7254.   ■   Redirecting CodeView input and output
  7255. %@NL@%
  7256.  
  7257.  
  7258.  
  7259. %@3@%%@CR:C6A00070098 @%%@AB@%7.14.1  Using Multiple Source Windows%@AE@%%@EH@%%@NL@%
  7260.  
  7261. You can have two Source windows open at the same time. The windows can
  7262. display two different sections of source code for the same program. They can
  7263. both track CS:IP addresses; or, one can display a high-level listing and one
  7264. can display an assembly-language listing. You can move freely between the
  7265. Source windows, executing a single line of source code or a single assembly
  7266. instruction at a time.%@CR:C6A00070099 @%%@NL@%
  7267.  
  7268.  
  7269. %@3@%%@CR:C6A00070100 @%%@AB@%7.14.2  Calling Functions%@AE@%%@EH@%%@NL@%
  7270.  
  7271. You can call any C function in your program from the Command window or the
  7272. Watch window. The format for calling C functions is:  %@NL@%
  7273.  
  7274. %@AI@%?funcname (varlist)%@AE@%  %@NL@%
  7275.  
  7276. %@AB@%CVW%@AE@% evaluates the function and displays its returned value in the Command
  7277. window.  %@NL@%
  7278.  
  7279. The function does not have to be one that is called by your program. You can
  7280. evaluate any function that is included in the .OBJ parameters specified on
  7281. the %@AB@%LINK%@AE@% command line.%@CR:C6A00070101 @%%@NL@%
  7282.  
  7283. This feature allows you to run functions from within %@AB@%CVW%@AE@% that you would not
  7284. normally include in the final version of your program. For example, you
  7285. could call a function that checks the integrity of the data structure.  %@NL@%
  7286.  
  7287. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7288. NOTE
  7289.  
  7290. %@AI@%Directly calling a Windows application procedure or dialog function might
  7291. %@AI@%have unpredictable results.%@AE@%
  7292. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7293.  
  7294.  
  7295. %@3@%%@CR:C6A00070102 @%%@AB@%7.14.3  Checking for Undefined Pointers%@AE@%%@EH@%%@NL@%
  7296.  
  7297. Until a pointer has been explicitly assigned a value, its value is
  7298. undefined. Its value can be completely random, or it can be some consistent
  7299. value that does not point to a useful data address (such as -1).  %@NL@%
  7300.  
  7301. Accessing a value through an uninitialized pointer address can cause
  7302. inexplicable or erratic program behavior, because the data is not being read
  7303. from or written to the intended location. For example, suppose that var1 is
  7304. mistakenly written to the address specified by an uninitialized pointer,
  7305. then var2 is also written there. When var1 is read back it does not have its
  7306. original value, having been overwritten by var2.  %@NL@%
  7307.  
  7308. At present, all Microsoft C static or global near pointers have an
  7309. uninitialized value of 0. That is, they point to the base address of the
  7310. data segment. (There is no guarantee, however, that future versions of the
  7311. Microsoft C Compiler will be the same; C language specifications do not
  7312. define the value of an uninitialized pointer.)  %@NL@%
  7313.  
  7314. You can take advantage of this consistency. If you specify DS:0 as a
  7315. breakpoint expression, %@AB@%CVW%@AE@% automatically halts execution if your program
  7316. attempts to write a nonzero value to a null pointer address. This is an easy
  7317. way to see whether or not you have initialized all of your pointers.%@CR:C6A00070103 @%%@NL@%
  7318.  
  7319.  
  7320. %@3@%%@CR:C6A00070104 @%%@AB@%7.14.4  Handling Register Variables%@AE@%%@EH@%%@NL@%
  7321.  
  7322. A register variable is stored in one of the microprocessor's registers,
  7323. rather than in RAM. This speeds up access to the variable.  %@NL@%
  7324.  
  7325. There are two ways for a conventional variable to become a register
  7326. variable. One way is declaring the variable as a register variable. If a
  7327. register is free, the compiler will store the variable there. The other way
  7328. occurs during optimization, when the compiler stores an often-used variable
  7329. (such as a loop variable) in a register to speed up execution.%@CR:C6A00070105 @%%@NL@%
  7330.  
  7331. Register variables can cause problems when debugging. As with local
  7332. variables, they are only visible within the function where they are defined.
  7333. In addition, a register variable might not always be displayed with its
  7334. current value.  %@NL@%
  7335.  
  7336. In general, it is a good idea to turn off all optimization (using the %@AB@%/Od%@AE@%
  7337. option when compiling) and to avoid declaring register variables until the
  7338. program has been fully debugged. Any side effects produced by optimization
  7339. or register variables can then be easily isolated.  %@NL@%
  7340.  
  7341.  
  7342. %@3@%%@CR:C6A00070106 @%%@AB@%7.14.5  Redirecting %@AB@%CVW%@AE@% Input and Output%@AE@%%@EH@%%@NL@%
  7343.  
  7344. You can cause %@AB@%CVW%@AE@% to receive input from an input file and generate output to
  7345. an output file. To redirect %@AB@%CVW%@AE@% input and output, use the %@AB@%CVW%@AE@% start-up
  7346. command with the %@AB@%/C%@AE@% option as follows:%@CR:C6A00070107 @%%@NL@%
  7347.  
  7348. %@AS@%  CVW /c "<infile; t >outfile" myprog%@AE@%
  7349.  
  7350. When you redirect input, %@AB@%CVW%@AE@% will execute any commands in %@AI@%infile%@AE@% during
  7351. start-up. When %@AB@%CVW%@AE@% exhausts all commands in the input file, focus
  7352. automatically shifts to the Command window.  %@NL@%
  7353.  
  7354. When you redirect output, it is both sent to %@AI@%outfile%@AE@% and echoed to the
  7355. Command window. The %@AB@%t%@AE@% parameter must precede the %@AB@%>%@AE@% in the command to send
  7356. output to the Command window.  %@NL@%
  7357.  
  7358. Redirection is a useful way to automate %@AB@%CVW%@AE@% start-up. It also lets you keep
  7359. a viewable record of command-line input and output, but no record of mouse
  7360. operations. Some applications (particularly interactive ones) may need
  7361. modification to allow for redirection of input to the application itself.  %@NL@%
  7362.  
  7363.  
  7364. %@2@%%@CR:C6A00070108 @%%@AB@%7.15  Customizing CVW with the TOOLS.INI File%@AE@%%@EH@%%@NL@%
  7365.  
  7366. The TOOLS.INI file customizes the behavior and user interface of several
  7367. Microsoft products. The TOOLS.INI file is a plain ASCII text file. You
  7368. should place it in a directory pointed to the INIT environment variable. (If
  7369. you do not use the INIT environment variable, CodeView for Windows only
  7370. looks for TOOLS.INI in its source directory.)%@CR:C6A00070109 @%%@NL@%
  7371.  
  7372. The CodeView for Windows section of TOOLS.INI is preceded by the following
  7373. line:  %@NL@%
  7374.  
  7375. %@AS@%  [cvw]%@AE@%
  7376.  
  7377. Most of the TOOLS.INI customizations control screen colors, but you can also
  7378. specify start-up commands or the name of the file that receives CodeView for
  7379. Windows output. The Help system contains full information about all of the
  7380. TOOLS.INI switches for %@AB@%CVW%@AE@%.  %@NL@%
  7381.  
  7382.  
  7383. %@2@%%@CR:C6A00070110 @%%@AB@%7.16  A Sample Session in %@AB@%CVW%@AE@%%@AE@%%@EH@%%@NL@%
  7384.  
  7385. The following sample session demonstrates how to use the %@AB@%CVW%@AE@% debugger to
  7386. examine a Windows application. The session will use the SDK sample
  7387. application called Output, which writes text and draws three shapes─a
  7388. rectangle, an ellipse, and a dashed semicircle─on the screen.  %@NL@%
  7389.  
  7390. Before you begin the %@AB@%CVW%@AE@% session, you must prepare the Output application
  7391. for debugging. Compile and link the Output make file after you make the
  7392. following changes to the %@AB@%CL%@AE@% and %@AB@%LINK%@AE@% commands:  %@NL@%
  7393.  
  7394.  
  7395.   1.  Add the %@AB@%-Zi%@AE@% option to %@AB@%CL%@AE@% command by changing %@AB@%-Zpe%@AE@% to %@AB@%-Zpei%@AE@%, and add
  7396.       the %@AB@%-Od%@AE@% option:
  7397.  
  7398. %@AS@%      CL -c -Gsw -Oas -Zpei -Od OUTPUT.C%@AE@%
  7399. %@NL@%
  7400.  
  7401.   2.  Add the %@AB@%-Co%@AE@% option to the %@AB@%LINK%@AE@% command:
  7402.  
  7403. %@AS@%      LINK OUTPUT,,,/NOD /CO SLIBCEW LIBW, OUTPUT.DEF%@AE@%
  7404. %@NL@%
  7405.  
  7406.  
  7407. After you compile with these options, start Windows and then start a %@AB@%CVW%@AE@%
  7408. session for Output. See Section 7.4, "Starting a Debugging Session," for
  7409. more information about starting %@AB@%CVW%@AE@%. To start the %@AB@%CVW%@AE@% session:  %@NL@%
  7410.  
  7411.  
  7412.   1.  Choose Run from the File menu in Windows and type the following
  7413.       command in the Run dialog box:
  7414.  
  7415. %@AS@%      CVW%@AE@%
  7416. %@NL@%
  7417.  
  7418. %@STUB@%      The debugging monitor displays the %@AB@%CVW%@AE@% Start-up dialog box.%@NL@%
  7419.  
  7420.   2.  Type the application name in the %@AB@%CVW%@AE@% Start-up dialog box:
  7421.  
  7422. %@AS@%      OUTPUT%@AE@%
  7423. %@NL@%
  7424.  
  7425. %@STUB@%      Your debugging monitor displays the DLL dialog box.%@NL@%
  7426.  
  7427.   3.  In this session, you will not be debugging additional DLLs, so leave
  7428.       the command line blank and press ENTER.%@NL@%
  7429.  
  7430.  
  7431. The %@AB@%CVW%@AE@% menu, the Source window, the Command window, and the Local window
  7432. appear on the debugging monitor. The Source window displays the source code
  7433. for Output. Notice its title:  %@NL@%
  7434.  
  7435. %@AS@%  source1 CS:IP output.c (ACTIVE)%@AE@%
  7436.  
  7437. The title indicates that the Source window is the active, or selected,
  7438. window.  %@NL@%
  7439.  
  7440. Before you start executing the application, set a breakpoint in your source
  7441. code. For example, you could halt Output after it displays text on the
  7442. user's screen, but before it draws the rectangle. You know that Output will
  7443. draw the rectangle in response to a Windows WM_PAINT message, so use the
  7444. Find command to scan the source code for WM_PAINT. To search for this
  7445. message:  %@NL@%
  7446.  
  7447.  
  7448.   1.  Choose the Find option from the %@AB@%CVW%@AE@% Search menu.%@NL@%
  7449.  
  7450. %@STUB@%      %@AB@%CVW%@AE@% displays the Find dialog box. %@NL@%
  7451.  
  7452.   2.  Type the following on the command line:
  7453.  
  7454. %@AS@%      WM_PAINT%@AE@%
  7455. %@NL@%
  7456.  
  7457. %@STUB@%      Select the Match Upper/Lower Case checkbox; press ENTER. %@NL@%
  7458.  
  7459. %@STUB@%      %@AB@%CVW%@AE@% finds the first occurrence of "WM_PAINT" in a comment. This is not
  7460.       the location you want. To continue the search:%@NL@%
  7461.  
  7462.   3.  Choose the Repeat Last Find option from the Search menu. %@NL@%
  7463.  
  7464. %@STUB@%      This time the Source window displays the %@AB@%case%@AE@% WM_PAINT: statement.
  7465.       This is the location you were looking for.%@NL@%
  7466.  
  7467.  
  7468. Within this %@AB@%case%@AE@% statement, find the %@AB@%Rectangle%@AE@% function. Scroll downward
  7469. through the Source window until you see the following code:  %@NL@%
  7470.  
  7471. %@AS@%  Rectangle (
  7472. %@AS@%                hDC
  7473. %@AS@%               ,nDrawX
  7474. %@AS@%               ,nDrawY
  7475. %@AS@%               ,nDraw + 50
  7476. %@AS@%               ,nDraw + 30
  7477. %@AS@%              );%@AE@%
  7478.  
  7479. Notice that the statement is spread over several lines. To set a breakpoint
  7480. on a multiline statement, you must position the cursor on the last line of
  7481. the statement. If you try to set a breakpoint on any other line, %@AB@%CVW%@AE@% will
  7482. not accept it. To set a breakpoint on this statement:  %@NL@%
  7483.  
  7484.  
  7485.   1.  Click the ");" characters─the last line of the statement. %@NL@%
  7486.  
  7487. %@STUB@%      The blinking cursor is now on this line. %@NL@%
  7488.  
  7489.   2.  Choose the Set Breakpoint command on the Options menu, or press F9.%@NL@%
  7490.  
  7491.  
  7492. %@AB@%CVW%@AE@% displays the line in bold characters to indicate that it is a
  7493. breakpoint. Also, the Command window displays the following message:  %@NL@%
  7494.  
  7495. %@AS@%  Break at: output.c!.297%@AE@%
  7496.  
  7497. You have two ways to display a list of the breakpoints:  %@NL@%
  7498.  
  7499.  
  7500.   ■   You can use the %@AB@%bl%@AE@% command. In the Command window, type:
  7501.  
  7502. %@AS@%      bl%@AE@%
  7503. %@NL@%
  7504.  
  7505. %@STUB@%      The Command window will display a list of the breakpoint messages. %@NL@%
  7506.  
  7507.   ■   You can use the Edit Breakpoints command on the Watch menu. The
  7508.       Breakpoint dialog box will display a list of breakpoint messages.%@NL@%
  7509.  
  7510.  
  7511. The message for the breakpoint you just set is:  %@NL@%
  7512.  
  7513. %@AS@%  0) E output.c!.297%@AE@%
  7514.  
  7515. The following table uses this message to illustrate the format for %@AB@%CVW%@AE@%
  7516. breakpoint messages:  %@NL@%
  7517.  
  7518. %@AB@%Message Content%@AE@%                   %@AB@%What it Means%@AE@%
  7519. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7520. 0)                                Indicates the sequence number of the 
  7521.                                   breakpoint in the Source Code. This is 
  7522.                                   the first breakpoint.
  7523.  
  7524. E                                 Indicates that the breakpoint is 
  7525.                                   Enabled.
  7526.  
  7527. output.c!.297                     Indicates that the breakpoint is set on 
  7528.                                   line number 297 of the OUTPUT.C source 
  7529.                                   code file.
  7530.  
  7531. When you are ready to execute the Output application, click in the Command
  7532. window and type the %@AB@%go%@AE@% command at the prompt:  %@NL@%
  7533.  
  7534. %@AS@%  g%@AE@%
  7535.  
  7536. The Output application will start running and displaying the text on the
  7537. user's screen (the Windows monitor). While the application is running,
  7538. Windows has control of the session. When the application reaches the
  7539. breakpoint line, %@AB@%CVW%@AE@% takes control and halts the application before the line
  7540. is executed. Notice that the %@AB@%CVW%@AE@% Source window displays the breakpoint line
  7541. in reverse video to indicate where the application has stopped.  %@NL@%
  7542.  
  7543. At this point, %@AB@%CVW%@AE@% has control of the session. You can use the %@AB@%CVW%@AE@% menus and
  7544. commands to display values, edit breakpoints, or otherwise modify your
  7545. debugging session.  %@NL@%
  7546.  
  7547. Instead of resuming continuous execution, single-step through the
  7548. application as it draws the rectangle on the Windows screen. To execute a
  7549. single statement, press F10. The Output application draws a rectangle on the
  7550. screen and then stops. The %@AB@%CVW%@AE@% Source window displays the next statement of
  7551. code in reverse video:  %@NL@%
  7552.  
  7553. %@AS@%  SelectObject(hDC, hGreenBrush);%@AE@%
  7554.  
  7555. Single-step through the next several statements by pressing F10. As you
  7556. single-step, the Output application draws each shape on the Windows screen
  7557. and then Windows passes control of the session back to %@AB@%CVW%@AE@%. You can resume
  7558. continuous execution at any time by pressing F5.  %@NL@%
  7559.  
  7560. When the application is finished executing, it passes control back to %@AB@%CVW%@AE@%.
  7561. To terminate %@AB@%CVW%@AE@%, select the Quit option from the File menu.  %@NL@%
  7562.  
  7563. If the application is running and you want to interrupt it and terminate
  7564. execution:  %@NL@%
  7565.  
  7566.  
  7567.   1.  Press CONTROL+ALT+SYSREQ. %@NL@%
  7568.  
  7569.   2.  Select the Quit command from the File menu in %@AB@%CVW%@AE@%.%@NL@%
  7570.  
  7571.  
  7572. You will be returned to Windows. Your application will continue to run.  %@NL@%
  7573.  
  7574. To see how %@AB@%CVW%@AE@% handles a fatal exit, you will need to introduce a severe
  7575. error into the code of Output. Replace the %@AI@%hDC%@AE@% parameter of the %@AB@%DrawText%@AE@%
  7576. function in the WM_PAINT case statement of MainWndProc with (HDC)0.
  7577. Recompile the application and run %@AB@%CVW%@AE@% to debug the application.  %@NL@%
  7578.  
  7579. When the debugging version of Windows reaches the call to %@AB@%DrawText%@AE@%, it
  7580. detects an invalid display-context handle and displays in the %@AB@%CVW%@AE@% Command
  7581. window a stack trace similar to the following:  %@NL@%
  7582.  
  7583. %@AS@%  FatalExit code = 0x0000
  7584. %@AS@%  Stack trace:
  7585. %@AS@%  GDI!_TEXT:VALIDATEHANDLE+0046
  7586. %@AS@%  GDI!_TEXT:GSV+0018
  7587. %@AS@%  USER!_WMG:DRAWTEXT+000D
  7588. %@AS@%  0A35:03E9
  7589. %@AS@%  USER!_FFFE:INTRNALUPDATEWINDOW+0033
  7590. %@AS@%  USER!_FFFE:UPDATEWINDOW+0019
  7591. %@AS@%  0A35:011E
  7592. %@AS@%  0A35:0031
  7593. %@AS@%  0A35:0629
  7594. %@AS@%  
  7595. %@AS@%  Abort, Break, or Ignore?%@AE@%
  7596.  
  7597. The fatal exit code value 0x0000 indicates that an invalid handle was passed
  7598. to a GDI function. See the %@AI@%Reference, Volume 2%@AE@% for a complete list of fatal
  7599. exit codes.  %@NL@%
  7600.  
  7601. To locate the cause of the error in your source code, respond to the prompt
  7602. by pressing B. %@AB@%CVW%@AE@% will then display:  %@NL@%
  7603.  
  7604. %@AS@%  Break caused by INT3 in code%@AE@%
  7605.  
  7606. Find the first CS:IP address without a label. In this case, it is 0A35:03E9.
  7607. Use the %@AB@%v%@AE@% command with this address, remembering to add the 0x hexadecimal
  7608. prefix, as shown:  %@NL@%
  7609.  
  7610. %@AS@%  v 0x0A35:0x03E9%@AE@%
  7611.  
  7612. %@AB@%CVW%@AE@% will display source code similar to the following:  %@NL@%
  7613.  
  7614. %@AS@%  DrawText (
  7615. %@AS@%   (HDC)0
  7616. %@AS@%     , szText
  7617. %@AS@%     , strlen(szText)
  7618. %@AS@%     , &rcTextBox
  7619. %@AS@%    , DT_CENTER |DT_EXTERNALLEADING | DT_NOCLIP
  7620. %@AS@%                   | DT_NOPREFIX | DT_WORDBREAK
  7621. %@AS@%  );%@AE@%
  7622.  
  7623. This is the function call that you changed to cause the fatal exit.  %@NL@%
  7624.  
  7625.  
  7626. %@2@%%@CR:C6A00070111 @%%@AB@%7.17  Summary%@AE@%%@EH@%%@NL@%
  7627.  
  7628. CodeView for Windows is a tool that lets you debug Windows applications in
  7629. protected mode. With %@AB@%CVW%@AE@% running on your secondary monitor, you can view and
  7630. modify program data, and control execution, as you run your Windows
  7631. application.  %@NL@%
  7632.  
  7633. For information related to CodeView for Windows, see the following:  %@NL@%
  7634.  
  7635. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  7636. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7637. Programming Windows applications  %@AI@%Guide to Programming%@AE@%
  7638.  
  7639. System requirements               %@AI@%Installation and Update Guide%@AE@%
  7640.  
  7641. Fatal exit codes                  %@AI@%Reference, Volume 2%@AE@%: Appendix C, 
  7642.                                   "Windows
  7643.                                   Debugging Messages"
  7644.  
  7645. %@AB@%CVW%@AE@% commands                      CVW on-line Help
  7646.  
  7647.  
  7648.  
  7649.  
  7650.  
  7651.  
  7652. %@CR:C6A00080001 @%%@1@%%@AB@%Chapter 8  Debugging in Real Mode: Symbolic Debugger%@AE@%%@EH@%%@NL@%
  7653. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7654.  
  7655. Microsoft Windows Symbolic Debugger (%@AB@%SYMDEB%@AE@%) is a debugging program that
  7656. helps you test executable files for applications that run in real mode. To
  7657. debug applications that run in protected mode, use the Microsoft CodeView
  7658. for Windows (%@AB@%CVW%@AE@%) debugger. %@AB@% %@AE@%For information on%@AB@% CVW%@AE@%, see Chapter 7,%@AB@% %@AE@%
  7659. "Debugging in Protected Mode: CodeView for Windows."%@AB@% %@AE@%%@CR:C6A00080002 @%%@AB@% %@AE@%%@CR:C6A00080003 @%%@NL@%
  7660.  
  7661. %@AB@%SYMDEB%@AE@% lets you refer to data and instructions by name rather than by
  7662. address. The Symbolic Debugger can access program locations through
  7663. addresses, global symbols, or line-number references, making it easy to
  7664. locate and debug specific sections of code. You can debug C programs at the
  7665. source-file level as well as at the machine level. You can display the
  7666. source statements of a program, the disassembled machine code of the
  7667. program, or a combination of source statements and disassembled machine
  7668. code.  %@NL@%
  7669.  
  7670. Using %@AB@%SYMDEB%@AE@%, you can display and execute program code, set breakpoints that
  7671. stop the execution of your program, examine and change values in memory, and
  7672. debug programs that use the floating-point emulation conventions used by
  7673. Microsoft languages.%@CR:C6A00080004 @%%@NL@%
  7674.  
  7675. This chapter describes the following topics:  %@NL@%
  7676.  
  7677.  
  7678.   ■   Preparing symbol files for an application%@NL@%
  7679.  
  7680.   ■   Setting up the debugging terminal%@NL@%
  7681.  
  7682.   ■   Starting %@AB@%SYMDEB%@AE@% with Windows%@NL@%
  7683.  
  7684.   ■   Working with symbol maps%@NL@%
  7685.  
  7686.   ■   Interpreting %@AB@%SYMDEB%@AE@%'s allocation messages%@NL@%
  7687.  
  7688.   ■   Setting breakpoints and interpreting backtraces%@NL@%
  7689.  
  7690.   ■   Displaying the application's code and viewing its source file%@NL@%
  7691.  
  7692.  
  7693. The chapter also provides the syntax and description of each %@AB@%SYMDEB%@AE@% command.
  7694. %@NL@%
  7695.  
  7696. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7697. NOTE
  7698.  
  7699. %@AI@%To use the Symbolic Debugger, you must have an extra monochrome card or a
  7700. %@AI@%serial terminal, or both.%@AE@%
  7701.  
  7702. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7703.  
  7704.  
  7705. %@2@%%@CR:C6A00080005 @%%@AB@%8.1  Preparing Symbol Files%@AE@%%@EH@%%@NL@%
  7706.  
  7707. Windows applications are difficult to debug without symbolic information
  7708. about Windows and the application. To take advantage of the Symbolic
  7709. Debugger's symbolic features, first prepare a symbol file that %@AB@%SYMDEB%@AE@% can
  7710. use.%@CR:C6A00080006 @%%@CR:C6A00080007 @%%@CR:C6A00080008 @%%@NL@%
  7711.  
  7712. The steps for setting up a symbol file depend on the method used to create
  7713. the program. The following sections describe those steps for applications
  7714. written in C or assembly language.  %@NL@%
  7715.  
  7716.  
  7717. %@3@%%@CR:C6A00080009 @%%@AB@%8.1.1  MAPSYM Program%@AE@%%@EH@%%@NL@%
  7718.  
  7719. The %@AB@%MAPSYM%@AE@% program creates symbol files for symbolic debugging. The program
  7720. converts the contents of an application's symbol map (.MAP) file into a form
  7721. suitable for loading with %@AB@%SYMDEB%@AE@%, copying the result to a symbol (.SYM)
  7722. file.%@CR:C6A00080010 @%%@CR:C6A00080011 @%%@CR:C6A00080012 @%%@CR:C6A00080013 @%%@NL@%
  7723.  
  7724.  
  7725. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  7726.  
  7727. %@AS@%  mapsym «{/ | -}l» «{/ | -}n» mapfilename%@AE@%
  7728.  
  7729. %@AB@%Parameter%@AE@%                         %@AB@%Description%@AE@%
  7730. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7731. %@AI@%mapfilename%@AE@%                       Specifies the filename for a symbol map 
  7732.                                   file that was created during linking. If
  7733.                                   you do not give a filename extension, 
  7734.                                   .MAP is assumed. If you do not give a 
  7735.                                   full pathname, the current directory and
  7736.                                   drive are assumed. The %@AB@%MAPSYM%@AE@% program 
  7737.                                   creates a new symbol file having the 
  7738.                                   same name as the map file but with the 
  7739.                                   .SYM extension.%@CR:C6A00080014 @%
  7740.  
  7741. %@AB@%/l%@AE@%                                Directs %@AB@%MAPSYM%@AE@% to display information 
  7742.                                   about the conversion on the screen. The 
  7743.                                   information includes the names of groups
  7744.                                   defined in the program, the program 
  7745.                                   start address, the number of segments, 
  7746.                                   and the number of symbols per segment. 
  7747.  
  7748. %@AB@%/n%@AE@%                                Directs %@AB@%MAPSYM%@AE@% to ignore line-number 
  7749.                                   information in the map file. The 
  7750.                                   resulting symbol file contains no 
  7751.                                   line-number information. 
  7752.  
  7753. In the following example, %@AB@%MAPSYM%@AE@% uses the symbol information in FILE.MAP to
  7754. create FILE.SYM on the current drive and directory:  %@NL@%
  7755.  
  7756. %@AS@%  mapsym /l file.map%@AE@%
  7757.  
  7758. Information about the conversion is sent to the screen.  %@NL@%
  7759.  
  7760. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7761. NOTE
  7762.  
  7763. %@AI@%The %@AB@%MAPSYM%@AE@%%@AI@% program always places the new symbol file in the current drive
  7764. %@AI@%and directory.%@AE@%%@AE@%
  7765.  
  7766. %@AI@%To create a map file for %@AB@%MAPSYM%@AE@%%@AI@% input, you must specify the %@AE@%%@AI@%%@AB@%/map%@AE@%%@AE@%%@AI@% option when
  7767. %@AI@%linking. To add line-number information to the map file, specify the
  7768. %@AI@%appropriate option when compiling, and specify the %@AE@%%@AI@%%@AB@%/linenumbers%@AE@%%@AE@%%@AI@% option when
  7769. %@AI@%linking.%@AE@%%@AE@%
  7770.  
  7771. %@AI@%The %@AB@%MAPSYM%@AE@%%@AI@% program can process up to 10,000 symbols for each segment in the
  7772. %@AI@%application, and up to 1024 segments.%@AE@%%@AE@%
  7773. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7774.  
  7775.  
  7776. %@3@%%@CR:C6A00080015 @%%@AB@%8.1.2  The Incremental Linker%@AE@%%@EH@%%@NL@%
  7777.  
  7778. Microsoft C version 6.0 includes , the incremental linker (%@AB@%ILINK%@AE@%). %@AB@%ILINK%@AE@%
  7779. directly creates .SYM files for use by the Symbolic Debugger (%@AB@%SYMDEB%@AE@%). If
  7780. you use %@AB@%ILINK%@AE@% to link your files and create .SYM files, you do not have to
  7781. use %@AB@%MAPSYM%@AE@%.  %@NL@%
  7782.  
  7783. For more information on %@AB@%ILINK%@AE@%, see the Microsoft C Optimizing Compiler
  7784. version 6.0 documentation.  %@NL@%
  7785.  
  7786.  
  7787. %@3@%%@CR:C6A00080016 @%%@AB@%8.1.3  Symbols with C-Language Applications%@AE@%%@EH@%%@NL@%
  7788.  
  7789. To prepare a symbol file for an application written in the C language,
  7790. follow these steps:%@CR:C6A00080017 @%%@CR:C6A00080018 @%%@NL@%
  7791.  
  7792.  
  7793.   1.  Compile your source file using the %@AB@%-Zd%@AE@% option to produce line numbers
  7794.       in the object file.%@NL@%
  7795.  
  7796. %@STUB@%      Debugging is easier if you disable the compiler's optimization using
  7797.       the %@AB@%-Od%@AE@% option.%@NL@%
  7798.  
  7799.   2.  Link the object file to produce an executable version of the program
  7800.       by specifying a map filename in the linker's command line and giving
  7801.       the %@AB@%/map%@AE@% and %@AB@%/linenumbers%@AE@% options.%@NL@%
  7802.  
  7803. %@STUB@%      Make sure the map filename is the same as the application's module
  7804.       name given in the module-definition file. %@NL@%
  7805.  
  7806.   3.  Use the %@AB@%MAPSYM%@AE@% program to produce a symbol file. For information about
  7807.       using %@AB@%MAPSYM%@AE@%, see Section 8.1.1, "MAPSYM Program."%@CR:C6A00080019 @%%@NL@%
  7808.  
  7809.  
  7810. The following example shows how to use symbols with C-language applications:
  7811. %@NL@%
  7812.  
  7813. %@AS@%  cl -d -c -AS -Gsw -Od -Zdp test.c
  7814. %@AS@%  link test,test,test/map/li,/NOD slibcew slibw, test
  7815. %@AS@%  mapsym test%@AE@%
  7816.  
  7817.  
  7818. %@3@%%@CR:C6A00080020 @%%@AB@%8.1.4  Symbols with Assembly-Language Applications%@AE@%%@EH@%%@NL@%
  7819.  
  7820. To prepare symbol files for Windows applications written in assembly
  7821. language, follow these steps:%@CR:C6A00080021 @%%@CR:C6A00080022 @%%@CR:C6A00080023 @%%@NL@%
  7822.  
  7823.  
  7824.   1.  Make sure that all symbols you might want to use with %@AB@%SYMDEB%@AE@% are
  7825.       declared public.%@NL@%
  7826.  
  7827. %@STUB@%      Segment and group names should not be declared public. They are
  7828.       automatically available for debugging.%@CR:C6A00080024 @%%@CR:C6A00080025 @%%@NL@%
  7829.  
  7830.   2.  Assemble your source file.%@NL@%
  7831.  
  7832.   3.  Link the object file to produce an executable version of the
  7833.       application by specifying a map filename in the linker's command line
  7834.       and giving the %@AB@%/map%@AE@% option.%@NL@%
  7835.  
  7836. %@STUB@%      Make sure the map filename is the same as the application's module
  7837.       name given in the module-definition file. %@NL@%
  7838.  
  7839.   4.  Use the %@AB@%MAPSYM%@AE@% program to create a symbol file. For information about
  7840.       using %@AB@%MAPSYM%@AE@%, see Section 8.1.1, "MAPSYM Program." %@CR:C6A00080026 @%%@NL@%
  7841.  
  7842.  
  7843. The following is an example of the syntax used when preparing symbol files,
  7844. written in assembly language, for debugging:  %@NL@%
  7845.  
  7846. %@AS@%  masm test;
  7847. %@AS@%  link test,test,test/map,slibw slibc libh,test
  7848. %@AS@%  mapsym test%@AE@%
  7849.  
  7850.  
  7851. %@2@%%@CR:C6A00080027 @%%@AB@%8.2  Setting Up the Debugging Terminal%@AE@%%@EH@%%@NL@%
  7852.  
  7853. While it is running, Windows takes complete control of the system console,
  7854. making debugging through the console impossible. To debug Windows
  7855. applications, you can either set up a remote terminal connected through the
  7856. computer's serial port, or set up a secondary monochrome display adapter and
  7857. monitor.%@CR:C6A00080028 @%%@CR:C6A00080029 @%%@NL@%
  7858.  
  7859.  
  7860. %@3@%%@CR:C6A00080030 @%%@AB@%8.2.1  Setting Up a Remote Terminal%@AE@%%@EH@%%@NL@%
  7861.  
  7862. To set up a remote terminal for debugging, follow these steps:%@CR:C6A00080031 @%%@NL@%
  7863.  
  7864.  
  7865.   1.  Select a serial port on your computer and connect a terminal to it. %@NL@%
  7866.  
  7867.   2.  Use the DOS MODE command to set the baud rate and line protocol of the
  7868.       serial port to correct values for use with the terminal.%@NL@%
  7869.  
  7870. %@STUB@%      Line protocol includes the number of stop bits, type of parity
  7871.       checking, and number of transmission bits used by the terminal.%@CR:C6A00080032 @%%@NL@%
  7872.  
  7873.   3.  When you start the Symbolic Debugger, redirect its input and output to
  7874.       the remote terminal using the %@AB@%= =%@AE@% command to specify a communication
  7875.       port.%@NL@%
  7876.  
  7877. %@STUB@%      For example, the following command redirects all subsequent %@AB@%SYMDEB%@AE@%
  7878.       command input and output to COM2:%@NL@%
  7879.  
  7880. %@AS@%      == com2 %@AE@%
  7881. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7882. NOTE
  7883.  
  7884. Debugging through a remote terminal disables the normal function of the
  7885. CONTROL+S%@AI@% key combination. Do not use this key combination while debugging
  7886. %@AI@%Windows
  7887. %@AI@%
  7888. %@AI@%
  7889. %@AI@%
  7890. %@AI@%
  7891. %@AI@%%@3@%%@CR:C6A00080035 @%%@AB@%8.2.2  Setting Up a Secondary Monitor%@AE@%%@EH@%%@NL@%
  7892.  
  7893. To set up a secondary monitor for debugging, follow these steps:%@CR:C6A00080036 @%%@CR:C6A00080037 @%%@CR:C6A00080038 @%%@CR:C6A00080039 @%%@NL@%
  7894.  
  7895.  
  7896.   1.  Install a secondary monochrome display adapter in a free slot of your
  7897.       computer and connect the monochrome monitor to it.%@NL@%
  7898.  
  7899.   2.  Set the secondary display adapter switches to the appropriate
  7900.       settings.%@NL@%
  7901.  
  7902. %@STUB@%      Follow the display adapter and computer manufacturer's
  7903.       recommendations.%@NL@%
  7904.  
  7905.   3.  When you start the Symbolic Debugger, use the %@AB@%/m%@AE@% option to redirect
  7906.       %@AB@%SYMDEB%@AE@% output to the secondary monitor. %@NL@%
  7907.  
  7908. %@STUB@%      %@AI@%NOTE  %@AE@%When the %@AB@%/m%@AE@% option is given, the Symbolic Debugger redirects
  7909.       output to the secondary monitor, but continues to use the system
  7910.       keyboard for input until the application being debugged is started.
  7911.       While the application is running, %@AB@%SYMDEB%@AE@% yields complete control of
  7912.       the keyboard to the application. As soon as the application reaches a
  7913.       breakpoint or terminates, %@AB@%SYMDEB%@AE@% reclaims the keyboard and permits
  7914.       user input again.%@CR:C6A00080040 @%%@NL@%
  7915.  
  7916.  
  7917.  
  7918. %@2@%%@CR:C6A00080041 @%%@AB@%8.3  Starting SYMDEB with Windows%@AE@%%@EH@%%@NL@%
  7919.  
  7920. To start the Symbolic Debugger with Windows, enter the following %@AB@%SYMDEB%@AE@%
  7921. command line at the DOS command prompt:%@CR:C6A00080042 @%%@NL@%
  7922.  
  7923. %@AS@%  SYMDEB «options» «symbolfiles» WIN.COM /R  «arguments»%@AE@%
  7924.  
  7925. The %@AI@%options%@AE@% parameter specifies one or more %@AB@%SYMDEB%@AE@% options. The %@AI@%symbolfiles%@AE@%
  7926. parameter specifies the names of symbol files. The %@AI@%arguments%@AE@% parameter
  7927. specifies arguments that you want to pass to WIN.COM.%@CR:C6A00080043 @%%@CR:C6A00080044 @%%@NL@%
  7928.  
  7929. If you want additional symbolic information about Windows, add the full
  7930. pathname of the debug, the nondebug, or the kernel version of the symbol
  7931. file, as in the following example:  %@NL@%
  7932.  
  7933. %@AS@%  ... ,APP.SYM\WM\DEBUG\GDI.SYM%@AE@%
  7934.  
  7935. Once started, the Symbolic Debugger displays a start-up message followed by
  7936. the %@AB@%SYMDEB%@AE@% command prompt (-). When you see the prompt you can enter %@AB@%SYMDEB%@AE@%
  7937. commands. These commands are described in Section 8.9, "SYMDEB Commands."  %@NL@%
  7938.  
  7939. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7940. NOTE 
  7941.  
  7942. %@AI@%To set breakpoints in discardable library code in a large frame EMS
  7943. %@AI@%environment, add the following entry to the [kernel] section of WIN.INI:%@AE@%
  7944. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7945.  
  7946. %@AS@%  [Kernel]
  7947. %@AS@%  EnableEMSDebug=1%@AE@%
  7948.  
  7949. %@AI@%Adding the entry will slow down debugging.%@AE@%
  7950. The following section describes the elements of the %@AB@%SYMDEB%@AE@% command line.  %@NL@%
  7951.  
  7952.  
  7953. %@3@%%@CR:C6A00080045 @%%@AB@%8.3.1  Specifying SYMDEB Options%@AE@%%@EH@%%@NL@%
  7954.  
  7955. You can specify one or more %@AB@%SYMDEB%@AE@% options in the command line. These
  7956. options control the operation of the Symbolic Debugger. Options must appear
  7957. before WIN.COM on the command line so that %@AB@%SYMDEB%@AE@% will not interpret them as
  7958. program arguments.%@CR:C6A00080046 @%%@NL@%
  7959.  
  7960. The %@AB@%SYMDEB%@AE@% tool has the following command-line options:  %@NL@%
  7961.  
  7962. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@% %@CR:C6A00080047 @% %@CR:C6A00080048 @%
  7963. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7964. %@AB@%/m%@AE@%                                Redirects %@AB@%SYMDEB%@AE@% output to a secondary 
  7965.                                   monochrome monitor and permits debugging
  7966.                                   of Windows applications without 
  7967.                                   redirecting input and output to a remote
  7968.                                   terminal. The %@AB@%SYMDEB%@AE@% utility assumes 
  7969.                                   that the necessary display adapter and 
  7970.                                   monitor are
  7971.                                   installed. %@CR:C6A00080049 @% 
  7972.  
  7973. %@AB@%/x%@AE@%                                Disables the "more" feature. Unless this
  7974.                                   option is specified, the Symbolic 
  7975.                                   Debugger automatically stops lengthy 
  7976.                                   output and does not continue the display
  7977.                                   until the user presses a key. The %@AB@%SYMDEB%@AE@%
  7978.                                   
  7979.                                   utility stops the output after 
  7980.                                   displaying enough lines to fill the 
  7981.                                   screen, then prompts the user to 
  7982.                                   continue by displaying the message 
  7983.                                   "[more]". If this option
  7984.                                   is specified, the Symbolic Debugger 
  7985.                                   continues to
  7986.                                   display output until the command is 
  7987.                                   completely
  7988.                                   executed. %@CR:C6A00080050 @% %@CR:C6A00080051 @%
  7989.  
  7990. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@%
  7991. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7992. %@AB@%/w%@AE@%%@AI@%number%@AE@%                          Sets the memory-allocation reporting 
  7993.                                   level. The reporting level defines what 
  7994.                                   kind of memory allocation and movement 
  7995.                                   messages the Symbolic Debugger will 
  7996.                                   display when Windows loads and moves 
  7997.                                   program segments. The %@AI@%number%@AE@% parameter 
  7998.                                   specifies the reporting level and can be
  7999.                                   0, 1, 2, or 3. Level 0 specifies no 
  8000.                                   reporting. Level 1, the default level if
  8001.                                   the %@AB@%/w%@AE@% option is not given, generates 
  8002.                                   allocation messages only. Level 2 
  8003.                                   generates movement messages only. Level 
  8004.                                   3 generates both allocation and movement
  8005.                                   messages. See Section 8.6, "Displaying 
  8006.                                   Allocation Messages," for more 
  8007.                                   information about allocation messages. %@CR:C6A00080052 @% 
  8008.  
  8009. %@AB@%/@%@AE@%%@AI@%filename%@AE@%                   Directs the Symbolic Debugger to load 
  8010.                                   macro definitions from the file 
  8011.                                   specified by %@AI@%filename%@AE@%. Macro definitions
  8012.                                   define the meaning of the debugger's 10 
  8013.                                   macro commands. The given file must 
  8014.                                   contain one or more macro definitions in
  8015.                                   the following form: %@CR:C6A00080053 @% %@CR:C6A00080054 @%
  8016.  
  8017.                                   %@AB@%m%@AE@%%@AI@%number%@AE@%%@AB@%=%@AE@%%@AI@%command-string%@AE@%
  8018.  
  8019.                                   Specifies the macro and one or more %@AB@%%@AE@%
  8020.                                   %@AB@%SYMDEB%@AE@% commands. The %@AI@%number%@AE@% parameter 
  8021.                                   specifies the macro; the %@AI@%command-string%@AE@% 
  8022.                                   parameter specifies commands.
  8023.  
  8024. %@AB@%/n%@AE@%                                Permits use of nonmaskable interrupts on
  8025.                                   non-IBM computers. To use nonmaskable 
  8026.                                   interrupts, you must have a system that 
  8027.                                   is equipped with the proper hardware, 
  8028.                                   such as the following products: %@CR:C6A00080055 @%
  8029.  
  8030.                                   ■ IBM Professional Debugging Facility
  8031.  
  8032.                                   ■ Software Probe (Atron Corporation)
  8033.  
  8034.                                   The %@AB@%SYMDEB%@AE@% utility requires only the 
  8035.                                   hardware provided with these products; 
  8036.                                   no additional software is needed. If you
  8037.                                   are using one of these products with a 
  8038.                                   non-IBM system, you must use the %@AB@%/n%@AE@% 
  8039.                                   option to take advantage of the break 
  8040.                                   capability. Using a 
  8041.                                   nonmaskable-interrupt break system is 
  8042.                                   more reliable than using the interactive
  8043.                                   break key because you can always stop 
  8044.                                   program execution regardless of the 
  8045.                                   state of interrupts and other conditions.
  8046.                                   %@CR:C6A00080056 @%%@CR:C6A00080057 @%%@CR:C6A00080058 @%
  8047.  
  8048. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@%
  8049. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8050. %@AB@%/i%@AE@%«bm»                            Directs the Symbolic Debugger to use 
  8051.                                   features available on IBM-compatible 
  8052.                                   computers. The option is not necessary 
  8053.                                   if you have an IBM PC, because %@AB@%SYMDEB%@AE@% 
  8054.                                   automatically checks the hardware on 
  8055.                                   start-up. If %@AB@%SYMDEB%@AE@% does not find that 
  8056.                                   the hardware is an IBM PC, it assumes 
  8057.                                   that the hardware is a generic DOS 
  8058.                                   machine. Without this option, the
  8059.                                   Symbolic Debugger cannot take advantage 
  8060.                                   of special hardware features such as the
  8061.                                   IBM 8259
  8062.                                   Interrupt Controller, the IBM-style 
  8063.                                   video display, and other capabilities of
  8064.                                   the IBM basic input and
  8065.                                   output system (BIOS). %@CR:C6A00080059 @%
  8066.  
  8067. %@AB@%/f%@AE@%%@AI@%filename%@AE@%                        Prevents association of the named symbol
  8068.                                   file with the executable file that has 
  8069.                                   the same name. This option is rarely 
  8070.                                   used and is not recommended for 
  8071.                                   debugging Windows applications. 
  8072.  
  8073. %@AB@%/%@AE@%%@AI@%commands%@AE@%                         Directs the Symbolic Debugger to execute
  8074.                                   commands in the %@AI@%commands%@AE@% list 
  8075.                                   immediately after starting. Commands in 
  8076.                                   the list must be separated with 
  8077.                                   semicolons and the entire list must be 
  8078.                                   enclosed in double quotation marks. The 
  8079.                                   slash (/) is required. %@CR:C6A00080060 @% %@CR:C6A00080061 @%%@CR:C6A00080062 @% %@CR:C6A00080063 @%
  8080.  
  8081. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8082. NOTE
  8083.  
  8084. %@AI@%You can specify a hyphen instead of a slash for the option designator. You
  8085. %@AI@%can also use both uppercase and lowercase letters to specify the option.%@CR:C6A00080064 @%%@CR:C6A00080065 @%%@CR:C6A00080066 @%%@CR:C6A00080067 @%%@CR:C6A00080068 @%%@CR:C6A00080069 @%%@AE@%
  8086.  
  8087. %@AI@%Files containing a hyphen in the filename must be renamed before use with
  8088. %@AB@%SYMDEB%@AE@%%@AI@%. Otherwise, %@AE@%%@AI@%%@AB@%SYMDEB%@AE@%%@AE@%%@AI@% will interpret the hyphen as an option designator.%@AE@%%@AE@%
  8089. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8090.  
  8091.  
  8092. %@3@%%@CR:C6A00080070 @%%@AB@%8.3.2  Specifying Symbol Files%@AE@%%@EH@%%@NL@%
  8093.  
  8094. To debug a Windows application symbolically, you should load symbol files
  8095. for the following items:%@CR:C6A00080071 @%%@CR:C6A00080072 @%%@NL@%
  8096.  
  8097.  
  8098.   ■   The application%@NL@%
  8099.  
  8100.   ■   Windows kernel, user, and GDI (graphics device interface) libraries%@NL@%
  8101.  
  8102.   ■   Other Windows libraries used by the application%@NL@%
  8103.  
  8104.  
  8105. The symbol file for the application is not required. The symbol files for
  8106. the Windows libraries are optional, but recommended. They are helpful when
  8107. trying to trace calls made to routines that are not in the application or to
  8108. trace window messages.%@CR:C6A00080073 @%%@CR:C6A00080074 @%%@CR:C6A00080075 @%%@CR:C6A00080076 @%%@CR:C6A00080077 @%%@CR:C6A00080078 @%%@CR:C6A00080079 @%%@CR:C6A00080080 @%%@CR:C6A00080081 @%%@CR:C6A00080082 @%%@NL@%
  8109.  
  8110. You must give the complete filename and extension when naming a symbol file.
  8111. If the symbol file is not in the current directory, you must supply a full
  8112. pathname. All symbol files must be specified before the WIN.COM file.%@CR:C6A00080083 @%%@CR:C6A00080084 @%%@NL@%
  8113.  
  8114. You should always name the application's symbol file before any other symbol
  8115. files.  %@NL@%
  8116.  
  8117. The following example shows how to specify a symbol file:  %@NL@%
  8118.  
  8119. %@AS@%  SYMDEB \APP\TEST.SYM USER.SYM GDI.SYM \APP\TESTLIB.SYM WIN.COM /R%@AE@%
  8120.  
  8121. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8122. NOTE
  8123.  
  8124. %@AI@%The Windows symbol files for the kernel, user, and GDI libraries, WIN.COM,
  8125. %@AI@%USER.SYM, and GDI.SYM, are provided as part of the Microsoft Windows
  8126. %@AI@%Software Development Kit (SDK).%@AE@%
  8127.  
  8128. %@AI@%You can create symbol files for other Windows libraries by using the same
  8129. %@AI@%methods you used to create application symbol files.%@AE@%
  8130. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8131.  
  8132.  
  8133. %@3@%%@CR:C6A00080085 @%%@AB@%8.3.3  Passing the Application to Windows%@AE@%%@EH@%%@NL@%
  8134.  
  8135. You can pass the name of your application to Windows by placing the full
  8136. pathname on the %@AB@%SYMDEB%@AE@% command line immediately after the WIN.COM filename.
  8137. Windows receives the name as an argument when you start WIN.COM from within
  8138. %@AB@%SYMDEB%@AE@%. Windows uses the name to load and run the application.%@CR:C6A00080086 @%%@CR:C6A00080087 @%%@NL@%
  8139.  
  8140. The following example shows how to pass an application to Windows:  %@NL@%
  8141.  
  8142. %@AS@%  SYMDEB \APP\TEST.SYM WIN.COM /R \APP\TEST.EXE%@AE@%
  8143.  
  8144. If you do not supply your application's name as an argument, you can load
  8145. and start your application by starting WIN.COM and using the Windows shell
  8146. to load the application.  %@NL@%
  8147.  
  8148.  
  8149. %@3@%%@CR:C6A00080088 @%%@AB@%8.3.4  Using SYMDEB Keys%@AE@%%@EH@%%@NL@%
  8150.  
  8151. The Symbolic Debugger provides a number of special keys for controlling
  8152. input and output and program execution. The following is a list of these
  8153. keys:%@CR:C6A00080089 @%%@NL@%
  8154.  
  8155. %@AB@%Key%@AE@%                               %@AB@%Action%@AE@%
  8156. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8157. SCROLL LOCK                       Suspends and restores %@AB@%SYMDEB%@AE@% output. The
  8158.                                   key is typically used to temporarily 
  8159.                                   stop the output of lengthy displays. To 
  8160.                                   suspend output, press SCROLL LOCK. To 
  8161.                                   restore output, press the key again. %@CR:C6A00080090 @% %@CR:C6A00080091 @% %@CR:C6A00080092 @% %@CR:C6A00080093 @%
  8162.  
  8163. CONTROL + SYSREQ                  Generates an immediate breakpoint that 
  8164.                                   halts program execution and returns 
  8165.                                   control to the Symbolic Debugger. 
  8166.                                   (Available on the IBM PC/AT(R) only.) %@CR:C6A00080094 @% %@CR:C6A00080095 @% %@CR:C6A00080096 @%
  8167.                                   %@CR:C6A00080097 @%
  8168.  
  8169. %@AB@%Key%@AE@%                               %@AB@%Action%@AE@%
  8170. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8171. CONTROL + C                       Cancels the current %@AB@%SYMDEB%@AE@% command. This
  8172.                                   key combination does not apply to 
  8173.                                   commands that pass execution control to 
  8174.                                   the application being debugged.%@CR:C6A00080098 @%%@CR:C6A00080099 @%%@CR:C6A00080100 @%%@CR:C6A00080101 @%
  8175.  
  8176.  
  8177. %@2@%%@CR:C6A00080102 @%%@AB@%8.4  Working with Symbol Maps%@AE@%%@EH@%%@NL@%
  8178.  
  8179. Symbol files that the Symbolic Debugger has loaded for debugging are called
  8180. symbol maps. The Symbolic Debugger utility lets you examine symbol maps and
  8181. use the symbols in the maps to set breakpoints and display variables and
  8182. functions.%@CR:C6A00080103 @%%@CR:C6A00080104 @%%@NL@%
  8183.  
  8184. Although symbol maps are in memory, %@AB@%SYMDEB%@AE@% allows access to only one symbol
  8185. map at a time. You can display a list of symbol maps at any time, but to
  8186. display or use the symbols in a map, you must first open that map.  %@NL@%
  8187.  
  8188. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8189. NOTE
  8190.  
  8191. %@AI@%The Symbolic Debugger requires that the filename of the application's .SYM
  8192. %@AI@%file be the same as the application's module name (specified in the
  8193. %@AI@%application's module-definition file). If these names are not identical, the
  8194. %@AI@%Symbolic Debugger will not be able to determine the correct segment
  8195. %@AI@%addresses for symbols in the application.%@CR:C6A00080105 @%%@CR:C6A00080106 @%%@AE@%
  8196.  
  8197. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8198.  
  8199.  
  8200. %@3@%%@CR:C6A00080107 @%%@AB@%8.4.1  Listing the Symbol Maps%@AE@%%@EH@%%@NL@%
  8201.  
  8202. You can display a list of the symbol maps by using the %@AB@%x%@AE@% command with the
  8203. asterisk (*) argument. The command displays the names of all maps in memory,
  8204. the name of each segment belonging to a map, and the 16-bit paragraph
  8205. address of each segment. (The %@AB@%x%@AE@% command without an argument displays only
  8206. the open map.)%@CR:C6A00080108 @%%@CR:C6A00080109 @%%@CR:C6A00080110 @%%@NL@%
  8207.  
  8208. For example, type the following to display a list of the symbol maps:  %@NL@%
  8209.  
  8210. %@AS@%  -x *%@AE@%
  8211.  
  8212. The resulting list could look like the following:  %@NL@%
  8213.  
  8214. %@AS@%  [ 0000 TEST ]
  8215. %@AS@%          [ 0001 IGROUP ]
  8216. %@AS@%            0002 DGROUP
  8217. %@AS@%    0000 TESTLIB
  8218. %@AS@%            0001 _TEXT
  8219. %@AS@%            0002 DGROUP%@AE@%
  8220.  
  8221. The open map name is enclosed in brackets ([ ]). The active segment in the
  8222. map is also enclosed in brackets. Segment addresses appear immediately
  8223. before the segment names.%@CR:C6A00080111 @%%@CR:C6A00080112 @%%@CR:C6A00080113 @%%@CR:C6A00080114 @%%@NL@%
  8224.  
  8225. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8226. NOTE
  8227.  
  8228. %@AI@%The Symbolic Debugger does not display a segment's actual address until the
  8229. %@AI@%code or data corresponding to that segment has been loaded. If you list the
  8230. %@AI@%symbol maps before loading an application, %@AB@%SYMDEB%@AE@%%@AI@% displays low-memory
  8231. %@AI@%addresses as a warning that the segments are not yet in memory.%@AE@%%@AE@%
  8232. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8233.  
  8234. Once an application is loaded, %@AB@%SYMDEB%@AE@% appends a number to the end of the
  8235. data-segment name in the symbol map. This number shows which instance of the
  8236. application the data segment belongs to. If you load multiple instances of
  8237. an application, %@AB@%SYMDEB%@AE@% adds a new data-segment name to the symbol map for
  8238. that application.  %@NL@%
  8239.  
  8240. In the following example, %@AB@%SYMDEB%@AE@% places parentheses around the active data
  8241. segment to show which instance of the application is currently running:  %@NL@%
  8242.  
  8243. %@AS@%  [ 0000 TEST ]
  8244. %@AS@%          [ 88F0 IGROUP ]
  8245. %@AS@%          ( 87E0 DGROUP )
  8246. %@AS@%            8944 DGROUP1%@AE@%
  8247.  
  8248.  
  8249. %@3@%%@CR:C6A00080115 @%%@AB@%8.4.2  Opening a Symbol Map%@AE@%%@EH@%%@NL@%
  8250.  
  8251. To access the symbols in a symbol map, you must open the symbol map using
  8252. the %@AB@%xo%@AE@% command. For example, to open the symbol map named TEST, you would
  8253. type the following:%@CR:C6A00080116 @%%@CR:C6A00080117 @%%@NL@%
  8254.  
  8255. %@AS@%  -xo test!%@AE@%
  8256.  
  8257. The Symbolic Debugger opens the symbol map and lets you examine and use
  8258. symbols from the map.%@CR:C6A00080118 @%%@CR:C6A00080119 @%%@NL@%
  8259.  
  8260. You can use the %@AB@%xo%@AE@% command to open a different symbol map at any time.  %@NL@%
  8261.  
  8262.  
  8263. %@3@%%@CR:C6A00080120 @%%@AB@%8.4.3  Displaying Symbols%@AE@%%@EH@%%@NL@%
  8264.  
  8265. You can use the %@AB@%x?%@AE@% command to display the symbols in the open symbol map.
  8266. The command lists each symbol by name and also gives the symbol's address
  8267. offset. For example, to display the symbol TestWndProc%@AB@%,%@AE@% type the following:%@CR:C6A00080121 @%%@CR:C6A00080122 @%%@CR:C6A00080123 @%%@NL@%
  8268.  
  8269. %@AS@%  -x? testwndproc%@AE@%
  8270.  
  8271. The command displays the name and address of the segment to which the symbol
  8272. belongs, as in the following example:  %@NL@%
  8273.  
  8274. %@AS@%  [ 88E0 IGROUP ]
  8275. %@AS@%    005A TESTWNDPROC%@AE@%
  8276.  
  8277. The symbol's absolute address can be computed using the segment's address
  8278. and the symbol's offset. In the preceding example, the function TestWndProc
  8279. is in the segment IGROUP at address 88E0:005A.  %@NL@%
  8280.  
  8281. If the symbol is an external symbol (for example, a function or variable
  8282. defined outside of the application), no group name is given and the offset
  8283. is always zero, as shown in the following example:  %@NL@%
  8284.  
  8285. %@AS@%  0000 SHOWWINDOW%@AE@%
  8286.  
  8287. You can use the asterisk (*) as a wildcard character with the %@AB@%x%@AE@% command to
  8288. display more than one symbol at a time. For example, the following command
  8289. displays all symbols in the IGROUP segment:%@CR:C6A00080124 @%%@CR:C6A00080125 @%%@NL@%
  8290.  
  8291. %@AS@%  -x? igroup:*%@AE@%
  8292.  
  8293. The following command displays all symbols in the DGROUP segment that begin
  8294. with an underscore (_):  %@NL@%
  8295.  
  8296. %@AS@%  -x? dgroup:_*%@AE@%
  8297.  
  8298.  
  8299. %@2@%%@CR:C6A00080126 @%%@AB@%8.5  Starting the Application%@AE@%%@EH@%%@NL@%
  8300.  
  8301. You can start the application by using the %@AB@%g%@AE@% command. The command directs
  8302. the Symbolic Debugger to pass execution control to the program at the
  8303. current code address. (Immediately after starting %@AB@%SYMDEB%@AE@% with Windows, the
  8304. current code address is the start address of the WIN.COM. file.)%@CR:C6A00080127 @%%@CR:C6A00080128 @%%@CR:C6A00080129 @%%@NL@%
  8305.  
  8306. If you have supplied your application's filename as a WIN.COM argument on
  8307. the %@AB@%SYMDEB%@AE@% command line, WIN.COM starts your application automatically.
  8308. Otherwise, it starts the Windows shell, which will load and run your
  8309. application.  %@NL@%
  8310.  
  8311.  
  8312. %@2@%%@CR:C6A00080130 @%%@AB@%8.6  Displaying Allocation Messages%@AE@%%@EH@%%@NL@%
  8313.  
  8314. The Symbolic Debugger displays memory-allocation messages to show that
  8315. Windows has created, freed, or moved memory blocks. The messages are
  8316. intended to help you locate your application's program code and data in
  8317. memory. The messages can also be used to see the effect of the application
  8318. on Windows memory management. The Symbolic Debugger actually displays
  8319. messages only if the memory-allocation reporting level is set to an
  8320. appropriate value (see the %@AB@%/w%@AE@% option in Section 8.3.1, "Specifying SYMDEB
  8321. Options").%@CR:C6A00080131 @%%@CR:C6A00080132 @%%@NL@%
  8322.  
  8323. When Windows allocates a new block of memory and the reporting level is 1 or
  8324. 3, the Symbolic Debugger displays a message of the following form:  %@NL@%
  8325.  
  8326. %@AI@%module-name%@AS@%!%@AE@%segment-name=segment-address%@AS@%  %@AE@%%@AE@%%@NL@%
  8327.  
  8328. The %@AI@%module-name%@AE@% field specifies the name of the application or library to
  8329. receive the allocated memory. The %@AI@%segment-name%@AE@% field specifies the name of
  8330. the code or data segment within the application or library that will occupy
  8331. the memory block. The %@AI@%segment-address%@AE@% field specifies the 16-bit paragraph
  8332. address of the memory block.  %@NL@%
  8333.  
  8334. When Windows moves a block of memory and the reporting level is 2 or 3, the
  8335. Symbolic Debugger displays a message of the following form:  %@NL@%
  8336.  
  8337. %@AI@%old-address%@AE@% %@AS@%moved to%@AE@% %@AI@%new-address%@AE@%  %@NL@%
  8338.  
  8339. The %@AI@%old-address%@AE@% and %@AI@%new-address%@AE@% fields specify the old and new 16-bit
  8340. paragraph addresses of the memory block.  %@NL@%
  8341.  
  8342. When Windows frees a block of memory and the reporting level is 1 or 3, the
  8343. Symbolic Debugger displays a message of the following form:  %@NL@%
  8344.  
  8345. %@AI@%segment-address%@AE@% %@AS@%freed%@AE@%  %@NL@%
  8346.  
  8347. The %@AI@%segment-address%@AE@% field specifies the 16-bit paragraph address of the
  8348. block to be freed.  %@NL@%
  8349.  
  8350. The following is an example of allocation messages that %@AB@%SYMDEB%@AE@% might
  8351. display:  %@NL@%
  8352.  
  8353. %@AS@%  TEST!IGROUP=886F
  8354. %@AS@%  TEST!DGROUP=8799
  8355. %@AS@%  GDI!Code=1C32
  8356. %@AS@%  8344 moved to 8230
  8357. %@AS@%  7C12 freed%@AE@%
  8358.  
  8359.  
  8360. %@3@%%@CR:C6A00080133 @%%@AB@%8.6.1  Setting Breakpoints with Symbols%@AE@%%@EH@%%@NL@%
  8361.  
  8362. You can use the %@AB@%bp%@AE@% command and symbols to set breakpoints in your
  8363. application code even before loading the application. The %@AB@%bp%@AE@% command uses
  8364. the symbol to compute the instruction address at which to break execution.
  8365. If the application has not been loaded, %@AB@%SYMDEB%@AE@% sets a virtual breakpoint. A
  8366. virtual breakpoint has no effect on execution until the application is
  8367. actually loaded. Once an application is loaded, %@AB@%SYMDEB%@AE@% computes the actual
  8368. code addresses of all virtual breakpoints and enables the breakpoints.%@CR:C6A00080134 @%%@CR:C6A00080135 @%%@CR:C6A00080136 @%%@CR:C6A00080137 @%%@NL@%
  8369.  
  8370. For example, to set a breakpoint at the application's WinMain function, you
  8371. would type the following:%@CR:C6A00080138 @%%@CR:C6A00080139 @%%@NL@%
  8372.  
  8373. %@AS@%  -bp winmain%@AE@%
  8374.  
  8375. After you set the breakpoint, the application breaks and returns control to
  8376. %@AB@%SYMDEB%@AE@% when this address is encountered.  %@NL@%
  8377.  
  8378. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8379. NOTE
  8380.  
  8381. %@AI@%If you do not set breakpoints before starting the application, use an
  8382. %@AI@%interrupt key to break execution (see Section 8.3.4, "Using SYMDEB Keys,"
  8383. %@AI@%for more information on %@AB@%SYMDEB%@AE@%%@AI@% keys).%@CR:C6A00080140 @%%@CR:C6A00080141 @%%@AE@%%@AE@%
  8384. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8385.  
  8386.  
  8387. %@3@%%@CR:C6A00080142 @%%@AB@%8.6.2  Displaying Variables%@AE@%%@EH@%%@NL@%
  8388.  
  8389. You can use the %@AB@%d%@AE@% command to display the content of the application's global
  8390. variables. The command frequently takes the variable's symbol as an argument
  8391. and computes the variable's address using the address of the variable's
  8392. segment and its offset. The symbol map containing the symbol must be open.
  8393. See Section 8.9, "SYMDEB Commands," for details of arguments to the %@AB@%d%@AE@%
  8394. command.%@CR:C6A00080143 @%%@CR:C6A00080144 @%%@CR:C6A00080145 @%%@CR:C6A00080146 @%%@CR:C6A00080147 @%%@NL@%
  8395.  
  8396. When there are multiple instances of the application being debugged, %@AB@%SYMDEB%@AE@%
  8397. uses the address of the active data segment to compute a variable's address.
  8398. To display a variable in another instance, supply an absolute segment
  8399. address. For example, to display the value of %@AI@%hInstance%@AE@% in the first
  8400. instance, you must first determine the 16-bit paragraph address of the first
  8401. DGROUP segment by typing the following:  %@NL@%
  8402.  
  8403. %@AS@%  -x %@AE@%
  8404.  
  8405. %@AB@%SYMDEB%@AE@% displays the name and address of each segment in the open map, as in
  8406. the following example:  %@NL@%
  8407.  
  8408. %@AS@%  [ 0000 TEST ]
  8409. %@AS@%   [ 8A12 IGROUP ]
  8410. %@AS@%     89A0 DGROUP
  8411. %@AS@%   ( 8882 DGROUP1 )%@AE@%
  8412.  
  8413. Specify the address when typing the %@AB@%d%@AE@% command, as follows:  %@NL@%
  8414.  
  8415. %@AS@%  -dw 89A0:hinstance%@AE@%
  8416.  
  8417. %@AB@%SYMDEB%@AE@% displays the contents of the specified variable, as follows:  %@NL@%
  8418.  
  8419. %@AS@%  88AO:0010 0235 0000 0000 0000 0000 0000 0000 0000%@AE@%
  8420.  
  8421.  
  8422. %@3@%%@CR:C6A00080148 @%%@AB@%8.6.3  Displaying Application Source Statements%@AE@%%@EH@%%@NL@%
  8423.  
  8424. You can display the source statements of an application by using the %@AB@%v%@AE@%, %@AB@%s+%@AE@%,
  8425. and %@AB@%s&%@AE@% commands. The %@AB@%v%@AE@% command displays the source lines of the application
  8426. beginning with the source line corresponding to the current code address
  8427. (CS:IP). The %@AB@%s+%@AE@% command directs the Symbolic Debugger to display source
  8428. lines whenever you use the %@AB@%u%@AE@% command. The %@AB@%s&%@AE@% command directs the Symbolic
  8429. Debugger to display both source lines and unassembled code whenever you use
  8430. the %@AB@%u%@AE@% command. For more information on these commands, see Section 8.9,
  8431. "SYMDEB Commands."%@CR:C6A00080149 @%%@NL@%
  8432.  
  8433. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8434. NOTE
  8435.  
  8436. %@AI@%If a symbol file does not contain line-number information, the %@AB@%v%@AE@%%@AI@%, %@AE@%%@AI@%%@AB@%s+%@AE@%%@AE@%%@AI@%, and %@AE@%%@AI@%%@AB@%s&%@AE@%%@AE@%%@AI@%
  8437. %@AI@%commands have no effect.%@AE@%%@AE@%
  8438.  
  8439. %@AI@%If the application source file is not in the current directory, or the file
  8440. %@AI@%does not have the same name as the symbol file, %@AB@%SYMDEB%@AE@%%@AI@% prompts for the
  8441. %@AI@%file's correct name and/or pathname.%@AE@%%@AE@%
  8442. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8443.  
  8444.  
  8445. %@2@%%@CR:C6A00080150 @%%@AB@%8.7  Quitting SYMDEB%@AE@%%@EH@%%@NL@%
  8446.  
  8447. You can terminate %@AB@%SYMDEB%@AE@% at any time by using the %@AB@%q%@AE@% command to return to the
  8448. DOS prompt. Before quitting %@AB@%SYMDEB%@AE@%, however, you must end the current
  8449. Windows session and restore the console display to its normal display modes.%@CR:C6A00080151 @%%@CR:C6A00080152 @%%@NL@%
  8450.  
  8451. Follow these general rules:  %@NL@%
  8452.  
  8453.  
  8454.   ■   Use the %@AB@%q%@AE@% command to quit, if you have not started Windows.%@NL@%
  8455.  
  8456.   ■   Open the Windows shell and choose the Close command from its System
  8457.       menu, then use the %@AB@%q%@AE@% command, if you have started Windows and it is
  8458.       still operational. Make sure that all instances of the shell are
  8459.       closed.%@NL@%
  8460.  
  8461. %@STUB@%      %@AI@%IMPORTANT  %@AE@%When Windows terminates as a result of a fatal exit, the
  8462.       Symbolic  Debugger displays a fatal-exit message and returns the
  8463.       %@AB@%SYMDEB%@AE@% prompt. Do not attempt to restart Windows or quit %@AB@%SYMDEB%@AE@%. You
  8464.       must reboot the system to continue.%@CR:C6A00080153 @%%@CR:C6A00080154 @%%@CR:C6A00080155 @%%@CR:C6A00080156 @%%@NL@%
  8465.  
  8466.  
  8467.  
  8468. %@2@%%@CR:C6A00080157 @%%@AB@%8.8  SYMDEB Command Overview and Tables%@AE@%%@EH@%%@NL@%
  8469.  
  8470. This section contains a complete listing of commands that can be used with
  8471. the Symbolic Debugger. It also describes the arguments and expressions used
  8472. with %@AB@%SYMDEB%@AE@% commands, as well as predefined names used as register and
  8473. register-flag names. Table 8.1 is a summary of the syntax and meaning of %@AB@%
  8474. %@AB@%SYMDEB%@AE@% commands:%@CR:C6A00080158 @%%@NL@%
  8475.  
  8476. Table 8.1  SYMDEB Commands
  8477.  
  8478. %@TH:  26  1247 02 38 38 @%
  8479. Syntax                                Meaning
  8480. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8481. %@AB@%a %@AE@%«%@AI@%address%@AE@%»                           Assemble instruction mnemonics
  8482.  
  8483. %@AB@%ba %@AE@%%@AI@%option size%@AE@% address«%@AI@%value%@AE@%»         Set address breakpoint(s) on 80386 
  8484. «%@AI@%command-string%@AE@%»                      machines
  8485.  
  8486. %@AB@%bc %@AE@%%@AI@%id-list%@AE@%                            Clear breakpoint(s) 
  8487.  
  8488. %@AB@%bd %@AE@%%@AI@%id-list%@AE@%                            Disable breakpoint(s)
  8489.  
  8490. %@AB@%be %@AE@%%@AI@%id-list%@AE@%                            Enable breakpoint(s) 
  8491.  
  8492. %@AB@%bl%@AE@%                                    List breakpoint(s) 
  8493.  
  8494. %@AB@%bp%@AE@%«%@AI@%id%@AE@%» %@AI@%address %@AE@%«%@AI@%value%@AE@%»                Set breakpoint(s) 
  8495. «%@AI@%command-string%@AE@%»                      
  8496.  
  8497. %@AB@%c %@AE@%%@AI@%range address%@AE@%                       Compare 
  8498.  
  8499. %@AB@%d %@AE@%«%@AI@%range%@AE@%»                             Dump memory using previous type 
  8500.  
  8501. %@AB@%da %@AE@%«%@AI@%range%@AE@%»                            Dump memory ASCII 
  8502.  
  8503. %@AB@%db %@AE@%«%@AI@%range%@AE@%»                            Dump memory bytes 
  8504.  
  8505. %@TE:  26  1247 02 38 38 @%
  8506.  
  8507. Table 8.1  SYMDEB Commands (continued)
  8508.  
  8509. %@TH: 121  5466 02 38 38 @%
  8510. Syntax                                Meaning
  8511. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8512. %@AB@%dd %@AE@%«%@AI@%range%@AE@%»                            Dump memory doublewords  
  8513.  
  8514. %@AB@%df%@AE@%                                    Display list of global free blocks
  8515.  
  8516. %@AB@%dg%@AE@%                                    Display global heap 
  8517.  
  8518. %@AB@%dh%@AE@%                                    Display local heap for current data 
  8519.                                       segment register%@AB@%%@AE@%
  8520.  
  8521. %@AB@%dl %@AE@%«%@AI@%range%@AE@%»                            Dump memory, long floating point 
  8522.  
  8523. %@AB@%dm%@AE@%                                    Display list of loaded modules
  8524.  
  8525. %@AB@%dq%@AE@%                                    Dump list of current tasks, their 
  8526.                                       SS:BP, CS:IP, nEvents, priority, 
  8527.                                       module name, and queue handle
  8528.  
  8529. %@AB@%ds %@AE@%«%@AI@%range%@AE@%»                            Dump memory, short floating point 
  8530.  
  8531. %@AB@%dt %@AE@%«%@AI@%range%@AE@%»                            Dump memory 10-byte reals  
  8532.  
  8533. %@AB@%du%@AE@%                                    Display LRU list
  8534.  
  8535. %@AB@%dw %@AE@%«%@AI@%range%@AE@%»                            Dump memory words 
  8536.  
  8537. %@AB@%e %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                     Enter using previous type 
  8538.  
  8539. %@AB@%ea %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter ASCII 
  8540.  
  8541. %@AB@%eb %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter bytes 
  8542.  
  8543. %@AB@%ed %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter doublewords 
  8544.  
  8545. %@AB@%el %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter long floating point 
  8546.  
  8547. %@AB@%es %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter short floating point 
  8548.  
  8549. %@AB@%et %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter 10-byte reals 
  8550.  
  8551. %@AB@%ew %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter words 
  8552.  
  8553. %@AB@%f %@AE@%%@AI@%range list%@AE@%                          Fill 
  8554.  
  8555. %@AB@%g %@AE@%«= %@AI@%startaddress %@AE@%» «%@AI@%breakaddress%@AE@%»...  Go 
  8556.  
  8557. %@AB@%h %@AE@%%@AI@%value1 value2%@AE@%                       Add hexadecimal command
  8558.  
  8559. %@AB@%i %@AE@%%@AI@%value%@AE@%                               Input from port 
  8560.  
  8561. %@AB@%k %@AE@%«%@AI@%value%@AE@%»                             Backtrace stack  
  8562.  
  8563. %@AB@%kt %@AE@%%@AI@%pdb %@AE@%«%@AI@%value%@AE@%»                        Backtrace task  
  8564.  
  8565. %@AB@%kv %@AE@%«%@AI@%value%@AE@%»                            Annotate each stack frame with the 
  8566.                                       associated frame pointer value
  8567.  
  8568. %@AB@%l %@AE@%«%@AI@%address %@AE@%«%@AI@%drive record count%@AE@%» »     Load 
  8569.  
  8570. %@AB@%m %@AE@%%@AI@%range address%@AE@%                       Move 
  8571.  
  8572. %@AB@%m%@AE@%%@AI@%id%@AE@%«= %@AI@%command-string%@AE@%»                 Define or execute macro 
  8573.  
  8574. %@AB@%n %@AE@%«%@AI@%filename%@AE@%»«%@AI@%arguments%@AE@%»               Set name 
  8575.  
  8576. %@AB@%o %@AE@%%@AI@%value byte%@AE@%                          Output to port 
  8577.  
  8578. %@AB@%p %@AE@%«= %@AI@%startaddress%@AE@%» «%@AI@%value%@AE@%»            Trace program instruction or call
  8579.  
  8580. %@AB@%q%@AE@%                                     Quit 
  8581.  
  8582. %@AB@%r %@AE@%«%@AI@%register%@AE@%» « «= » %@AI@%value%@AE@%»            Register 
  8583.  
  8584. %@AB@%s %@AE@%%@AI@%range list%@AE@%                          Search 
  8585.  
  8586. %@AB@%s-%@AE@%                                    Set machine debugging only 
  8587.  
  8588. %@AB@%s&%@AE@%                                    Set machine and source debugging 
  8589.  
  8590. %@AB@%s+%@AE@%                                    Set source debugging only 
  8591.  
  8592. %@AB@%t %@AE@%«= %@AI@%startaddress%@AE@%» «%@AI@%value%@AE@%»            Trace program instruction 
  8593.  
  8594. %@AB@%u %@AE@%«%@AI@%range%@AE@%»                             Display unassembled instructions 
  8595.  
  8596. %@AB@%v %@AE@%%@AI@%range%@AE@%                               View source lines  
  8597.  
  8598. %@AB@%w %@AE@%«%@AI@%address %@AE@%«%@AI@%drive record count%@AE@%» »     Write to disk or file 
  8599.  
  8600. %@AB@%x %@AE@%«*| ?» %@AI@%symbol%@AE@%                       Examine symbol(s) 
  8601.  
  8602. %@AB@%xo %@AE@%«%@AI@%symbol%@AE@%!»                          Open symbol map/segment 
  8603.  
  8604. %@AB@%z %@AE@%%@AI@%symbol value%@AE@%                        Set symbol value 
  8605.  
  8606. %@AB@%?%@AE@%                                     Display list of %@AB@%SYMDEB%@AE@% commands and 
  8607.                                       operators
  8608.  
  8609. %@AB@%? %@AE@%%@AI@%expression%@AE@%                          Compute and display expression 
  8610.  
  8611. %@AB@%.%@AE@%                                     Display current source line 
  8612.  
  8613. %@AB@%< %@AE@%%@AI@%filename%@AE@%                            Redirect %@AB@%SYMDEB%@AE@% input 
  8614.  
  8615. %@AB@%> %@AE@%%@AI@%filename%@AE@%                            Redirect %@AB@%SYMDEB%@AE@% output 
  8616.  
  8617. %@AB@%= = f%@AE@%%@AI@%ilename%@AE@%                          Redirect %@AB@%SYMDEB%@AE@% input and output 
  8618.  
  8619. { %@AI@%filename%@AE@%                            Redirect program input 
  8620.  
  8621. } %@AI@%filename%@AE@%                            Redirect program output  
  8622.  
  8623. %@AB@%~ %@AE@%%@AI@%filename%@AE@%                            Redirect program input and output 
  8624.  
  8625. %@AB@%! %@AE@%«%@AI@%dos-command%@AE@%»                       Shell escape 
  8626.  
  8627. %@AB@%* %@AE@%%@AI@%comment%@AE@%                             Comment 
  8628.  
  8629. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8630.  
  8631. %@TE: 121  5466 02 38 38 @%
  8632.  
  8633. Any combination of uppercase and lowercase letters may be used in commands
  8634. and arguments. If a command uses two or more parameters, separate them with
  8635. a single comma (,) or one or more spaces.%@CR:C6A00080159 @%%@NL@%
  8636.  
  8637. The following provides examples of %@AB@%SYMDEB%@AE@% commands:  %@NL@%
  8638.  
  8639. %@AS@%  ds _avg L 10
  8640. %@AS@%  U .22
  8641. %@AS@%  f DS:100,110 ff,fe,01,00%@AE@%
  8642.  
  8643. For complete information about command syntax, see Section 8.9, "SYMDEB
  8644. Commands."  %@NL@%
  8645.  
  8646.  
  8647. %@3@%%@CR:C6A00080160 @%%@AB@%8.8.1  Command Arguments%@AE@%%@EH@%%@NL@%
  8648.  
  8649. Command arguments are numbers, symbols, line numbers, or expressions used to
  8650. specify addresses or values to be used by %@AB@%SYMDEB%@AE@% commands. The following is
  8651. a list of argument syntax and meaning:%@CR:C6A00080161 @%%@CR:C6A00080162 @%%@CR:C6A00080163 @%%@NL@%
  8652.  
  8653. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  8654. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8655. %@AI@%address%@AE@%                           Specifies absolute, relative, or 
  8656.                                   symbolic address of
  8657.                                   a variable or function. The Symbolic 
  8658.                                   Debugger permits a wide variety of 
  8659.                                   address types. See Section
  8660.                                    8.8.2, "Address Arguments," for a 
  8661.                                   complete description of address 
  8662.                                   arguments. 
  8663.  
  8664. %@AI@%byte%@AE@%                              Specifies a %@AI@%value%@AE@% argument representing 
  8665.                                   a byte value. It must be within the 
  8666.                                   range 0 to 255. 
  8667.  
  8668. %@AI@%command-string%@AE@%                    Specifies one or more %@AB@%SYMDEB%@AE@% commands. 
  8669.                                   If more than one command is given, they 
  8670.                                   must be separated by semicolons (;).
  8671.  
  8672. %@AI@%count%@AE@%                             Specifies a %@AI@%value%@AE@% argument representing 
  8673.                                   the number of disk records to read or 
  8674.                                   write. 
  8675.  
  8676. %@AI@%dos-command%@AE@%                       Specifies a DOS command. 
  8677.  
  8678. %@AI@%drive%@AE@%                             Specifies a %@AI@%value%@AE@% argument representing 
  8679.                                   a disk drive. Drives are numbered 0 for 
  8680.                                   A, 1 for B, 2 for C, and so on.
  8681.  
  8682. %@AI@%expression%@AE@%                        Specifies a combination of arguments and
  8683.                                   operators that represents a single value
  8684.                                   or address. See Section 8.8.3, 
  8685.                                   "Expressions," for a list and 
  8686.                                   explanation of expression operators. 
  8687.  
  8688. %@AI@%filename%@AE@%                          Specifies the name of a file or a device.
  8689.                                   The filename must follow the DOS 
  8690.                                   filenaming
  8691.                                   conventions. 
  8692.  
  8693. %@AI@%id%@AE@%                                Specifies a decimal number representing 
  8694.                                   a breakpoint or macro identifier. The 
  8695.                                   number must be within the range 0 to 9. 
  8696.  
  8697. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  8698. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8699. %@AI@%id-list%@AE@%                           Specifies one or more unique decimal 
  8700.                                   numbers representing a list of 
  8701.                                   breakpoint identifiers. The numbers must
  8702.                                   be within the range 0 to 9. If more than
  8703.                                   one number is given, they must be 
  8704.                                   separated using spaces or commas. The 
  8705.                                   wildcard character (*) can be used to 
  8706.                                   specify all breakpoints. %@CR:C6A00080164 @%
  8707.  
  8708. %@AI@%list%@AE@%                              Specifies one or more %@AI@%value%@AE@% arguments. 
  8709.                                   The values must be within the range 0 to
  8710.                                   65,535. If more than one value is given,
  8711.                                   they must be separated using spaces or 
  8712.                                   commas. 
  8713.  
  8714.                                   A %@AI@%list%@AE@% can also be specified as a list 
  8715.                                   of ASCII values. The list can contain 
  8716.                                   any combination of characters and must 
  8717.                                   be enclosed in either single or double 
  8718.                                   quotation marks. If the enclosing mark 
  8719.                                   appears within the list, it must be 
  8720.                                   given twice.
  8721.  
  8722. %@AI@%range%@AE@%                             Specifies an address range. Address 
  8723.                                   ranges have two forms: a start and end 
  8724.                                   address pair, and a start address and 
  8725.                                   object count. The first form consists of
  8726.                                   two %@AI@%address%@AE@% arguments, the first 
  8727.                                   specifying the start address and the 
  8728.                                   second specifying the end address. The 
  8729.                                   second form consists of an %@AI@%address%@AE@% 
  8730.                                   argument, the letter %@AB@%l%@AE@%, and a %@AI@%value%@AE@% 
  8731.                                   argument. The %@AI@%address%@AE@% specifies the 
  8732.                                   starting address; the %@AI@%value%@AE@% specifies 
  8733.                                   the number of objects after the address 
  8734.                                   to examine or display. The size of an 
  8735.                                   object depends on the command. If a 
  8736.                                   command requires a %@AI@%range%@AE@% but only a 
  8737.                                   start address is given in the command, 
  8738.                                   the command assumes the range has an 
  8739.                                   object count of 128. This default count 
  8740.                                   does not apply to commands that require 
  8741.                                   a range followed immediately by a %@AI@%value%@AE@% 
  8742.                                   or an address argument. 
  8743.  
  8744. %@AI@%record%@AE@%                            Specifies a %@AI@%value%@AE@% argument representing 
  8745.                                   the first disk record to be read or 
  8746.                                   written to. %@CR:C6A00080165 @% %@CR:C6A00080166 @%%@CR:C6A00080167 @%
  8747.  
  8748. %@AI@%register%@AE@%                          Specifies the name of a CPU register. It
  8749.                                   can be any one of the following: 
  8750.  
  8751. %@TH:   5   185 01 04 04 04 64 @%
  8752. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8753. AX  CX  ES  SI
  8754. BP  DI  F   SP
  8755. BX  DS  IP  SS
  8756. CS  DX  PC
  8757. %@TE:   5   185 01 04 04 04 64 @%
  8758.  
  8759. The names IP and PC refer to the same register: the instruction pointer. The
  8760. name F is a special name for the flags register. Each flag within the flags
  8761. register has a unique name based on its value. These names can be used to
  8762. set or clear the flag. Table 8.2 lists the flag names:  %@NL@%
  8763.  
  8764. Table 8.2  Flag Values
  8765.  
  8766. %@TH:  12   730 02 17 16 43 @%
  8767. Flag             Set             Clear
  8768. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8769. Overflow         ov              nv
  8770. Direction        dn (decrement)%@AB@%%@AE@%  up (increment)%@AB@%%@AE@%
  8771.                  %@AB@%%@AE@%                
  8772. Interrupt        ei (enabled)%@AB@%%@AE@%    di (disabled)%@AB@%%@AE@%
  8773. Sign             ng (negative)%@AB@%%@AE@%   pl (positive)%@AB@%%@AE@%
  8774. Zero             zr              nz
  8775. Auxiliary Carry  ac              na
  8776. Parity           pe (even)%@AB@%%@AE@%       po (odd)%@AB@%%@AE@%
  8777. Carry            cy              nc
  8778. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8779. %@TE:  12   730 02 17 16 43 @%
  8780.  
  8781. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  8782. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8783. %@AI@%symbol%@AE@%                            Identifies the address of a variable, 
  8784.                                   function, or segment. A symbol consists 
  8785.                                   of one or more characters, but always 
  8786.                                   begins with a letter, underscore (_), 
  8787.                                   question mark (?), at symbol (@), or 
  8788.                                   dollar sign ($). Symbols are available 
  8789.                                   only when the .SYM file that defines 
  8790.                                   their names and values has been loaded. 
  8791.                                   Any combination of uppercase and 
  8792.                                   lowercase letters can be used; %@AB@%SYMDEB%@AE@% is
  8793.                                   not case-sensitive. For some commands, 
  8794.                                   the wildcard character (*) may be used 
  8795.                                   as part of a symbol to represent any 
  8796.                                   combination of characters. %@CR:C6A00080168 @%%@CR:C6A00080169 @%%@CR:C6A00080170 @%%@CR:C6A00080171 @%%@CR:C6A00080172 @%%@CR:C6A00080173 @%%@CR:C6A00080174 @%%@CR:C6A00080175 @%%@CR:C6A00080176 @%
  8797. %@CR:C6A00080177 @%%@CR:C6A00080178 @%%@CR:C6A00080179 @%%@CR:C6A00080180 @%
  8798. %@AI@%pdb%@AE@%                               Specifies a %@AI@%value%@AE@% argument representing 
  8799.                                   the segment address of a program 
  8800.                                   descriptor block. 
  8801.  
  8802. %@AI@%value%@AE@%                             Specifies an integer number in binary, 
  8803.                                   octal, decimal, or hexadecimal format. A
  8804.                                   value consists of one or more digits 
  8805.                                   optionally followed by a radix: Y for 
  8806.                                   binary, O or Q for octal, T for decimal,
  8807.                                   or H for hexadecimal. If no radix is 
  8808.                                   given, hexadecimal is assumed. %@AB@%SYMDEB%@AE@% 
  8809.                                   truncates leading digits if the number 
  8810.                                   is greater than 65,535. Leading zeros 
  8811.                                   are ignored. Hexadecimal numbers have 
  8812.                                   precedence over symbols, thus FAA is a 
  8813.                                   number. 
  8814.  
  8815.  
  8816. %@3@%%@CR:C6A00080181 @%%@AB@%8.8.2  Address Arguments%@AE@%%@EH@%%@NL@%
  8817.  
  8818. Address arguments specify the location of variables and functions. The
  8819. following list explains the syntax and meaning of the various addresses used
  8820. in %@AB@%SYMDEB%@AE@%: %@CR:C6A00080182 @% %@CR:C6A00080183 @% %@CR:C6A00080184 @%%@NL@%
  8821.  
  8822. %@AB@%Syntax%@AE@%                            %@AB@%Meaning%@AE@%
  8823. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8824. %@AI@%segment%@AE@%%@AB@%:%@AE@%%@AI@%offset%@AE@%                    Specifies an absolute address. A full 
  8825.                                   address has both a %@AI@%segment%@AE@% address and 
  8826.                                   an %@AI@%offset%@AE@%, separated by a colon (:). A 
  8827.                                   partial address is just an %@AI@%offset%@AE@%. In 
  8828.                                   both cases, the %@AI@%segment%@AE@% or %@AI@%offset%@AE@% can be
  8829.                                   any number, register name, or symbol. If
  8830.                                   no %@AI@%segment%@AE@% is given, the %@AB@%a%@AE@%, %@AB@%g%@AE@%, %@AB@%l%@AE@%, %@AB@%p%@AE@%, %@AB@%t%@AE@%, %@AB@%%@AE@%
  8831.                                   %@AB@%u%@AE@%, and %@AB@%w%@AE@% commands use the CS register 
  8832.                                   for the default segment address. All 
  8833.                                   other commands use DS. 
  8834.  
  8835. %@AI@%name%@AE@%{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%offset%@AE@%                 Specifies a symbol-relative address. The
  8836.                                   %@AI@%name%@AE@% can be any symbol. The %@AI@%offset%@AE@% 
  8837.                                   specifies the offset in bytes. The 
  8838.                                   address can be specified as a positive 
  8839.                                   (+) or negative (-) offset. 
  8840.  
  8841. %@AB@%.%@AE@%{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%number%@AE@%                    Specifies a relative line number. The %@AI@%%@AE@%
  8842.                                   %@AI@%number%@AE@% is an offset (in lines) from the 
  8843.                                   current source line to the new line. If 
  8844.                                   + is given, the new line is closer to 
  8845.                                   the end of the source file. If - is 
  8846.                                   given, the new line is closer to the 
  8847.                                   beginning. 
  8848.  
  8849. %@AB@%.%@AE@%«%@AI@%filename%@AE@%%@AB@%:%@AE@%»%@AI@%number%@AE@%                Specifies an absolute line number. If %@AI@%%@AE@%
  8850.                                   %@AI@%filename%@AE@% is given, the specified line is
  8851.                                   assumed to be in the source file 
  8852.                                   corresponding to the symbol file 
  8853.                                   identified by %@AI@%filename%@AE@%. If no filename 
  8854.                                   is given, the current instruction 
  8855.                                   address (the current values of the CS 
  8856.                                   and IP registers) determines which 
  8857.                                   source file contains the line.
  8858.  
  8859. %@AI@%symbol%@AE@%«{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%number%@AE@%»             Specifies a symbolic line number. The %@AI@%%@AE@%
  8860.                                   %@AI@%symbol%@AE@% can be any instruction or 
  8861.                                   procedure label. If %@AI@%number%@AE@% is given, the
  8862.                                   %@AI@%number%@AE@% is an offset (in lines) from the 
  8863.                                   given label or procedure name to the new
  8864.                                   line. If + is given, the new line is 
  8865.                                   closer to the end of the source file. If
  8866.                                   - is given, the new line is closer to 
  8867.                                   the beginning.%@CR:C6A00080185 @% %@CR:C6A00080186 @% %@CR:C6A00080187 @%
  8868.  
  8869. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8870. NOTE
  8871.  
  8872. %@AI@%Line numbers can be used only with programs developed with compilers that
  8873. %@AI@%copy line-number data to the object file.%@AE@%
  8874. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8875.  
  8876.  
  8877. %@3@%%@CR:C6A00080188 @%%@AB@%8.8.3  Expressions%@AE@%%@EH@%%@NL@%
  8878.  
  8879. An expression is a combination of arguments and operators that evaluates to
  8880. an 8-bit, 16-bit, or 32-bit value. Expressions can be used as values in any
  8881. command.%@CR:C6A00080189 @%%@CR:C6A00080190 @%%@NL@%
  8882.  
  8883. An expression can combine any symbol, number, or address with any of the
  8884. unary and binary operators in Tables 8.3 and 8.4.  %@NL@%
  8885.  
  8886. Table 8.3  Unary Operators
  8887.  
  8888. %@TH:  14   745 02 10 41 25 @%
  8889. Operator  Meaning                                  Precedence
  8890. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8891. ++        Unary plus                               Highest
  8892. -         Unary minus
  8893. not       1's complement
  8894. seg       Segment address of operand
  8895. off       Address offset of operand
  8896. by        Low-order byte from given address
  8897. wo        Low-order word from given address
  8898. dw        Doubleword from given address
  8899. poi       Pointer from given address (same as %@AB@%dw%@AE@%)
  8900. port      One byte from given port
  8901. wport     Word from given port                     Lowest
  8902. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8903. %@TE:  14   745 02 10 41 25 @%
  8904.  
  8905. Table 8.4  Binary Operators
  8906.  
  8907. %@TH:  12   549 02 10 30 36 @%
  8908. Operator  Meaning                       Precedence
  8909. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8910. *         Multiplication                Highest
  8911. /         Integer division
  8912. mod       Modulus
  8913. :         Segment override
  8914. ++        Addition
  8915. -         Subtraction
  8916. and       Bitwise Boolean AND
  8917. xor       Bitwise Boolean exclusive OR
  8918. or        Bitwise Boolean OR            Lowest
  8919. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8920. %@TE:  12   549 02 10 30 36 @%
  8921.  
  8922. Unary address operators assume DS as the default segment for addresses.
  8923. Expressions are evaluated in order of operator precedence. If adjacent
  8924. operators have equal precedence, the expression is evaluated from left to
  8925. right. Use parentheses to override this order.  %@NL@%
  8926.  
  8927. The following exemplifies the use of Unary expressions:  %@NL@%
  8928.  
  8929. %@AS@%  SEG 0001:0002           ; Equals 1
  8930. %@AS@%  OFF 0001:0002           ; Equals 2
  8931. %@AS@%  4+2*3                   ; Equals 10 (0Ah)
  8932. %@AS@%  4+(2*3)                 ; Equals 10 (0Ah)
  8933. %@AS@%  (4+2)*3                 ; Equals 18 (12h)%@AE@%
  8934.  
  8935.  
  8936. %@2@%%@CR:C6A00080191 @%%@AB@%8.9  SYMDEB Commands%@AE@%%@EH@%%@NL@%
  8937.  
  8938. The first part of this chapter described how to use the Symbolic Debugger, a
  8939. debugger that helps you test executable files for Windows applications that
  8940. run in real mode.  %@NL@%
  8941.  
  8942. For more information about debugging Windows applications, see Chapter 7,
  8943. "Debugging in Protected Mode: CodeView for Windows," and Chapter 9,
  8944. "Advanced Debugging in Protected Mode: 80386 Debugger."  %@NL@%
  8945.  
  8946. This section provides information on %@AB@%SYMDEB%@AE@% commands. Most notably, it
  8947. provides the syntax for each command.  %@NL@%
  8948.  
  8949. %@2@%%@CR:C6A00080192 @%%@AB@%a ─ Assemble%@AE@%%@EH@%%@NL@%
  8950. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8951.  
  8952.  
  8953. %@3@%%@AB@%Syntax%@CR:C6A00080193 @%%@AE@%%@EH@%%@NL@%
  8954.  
  8955. %@AS@%  a«address»%@AE@%
  8956.  
  8957. This command assembles instruction mnemonics and places the resulting
  8958. instruction codes into memory at %@AI@%address%@AE@%. If no %@AI@%address%@AE@% is given, the
  8959. asssembly starts at the address given by the current values of the CS and IP
  8960. registers. To assemble a new instruction, type the desired mnemonic and
  8961. press ENTER. To terminate assembly, press ENTER. There are the following
  8962. assembly rules:%@CR:C6A00080194 @%%@NL@%
  8963.  
  8964.  
  8965.   ■   Use %@AB@%retf%@AE@% for the far return mnemonic.%@NL@%
  8966.  
  8967.   ■   Use %@AB@%movsb%@AE@% or %@AB@%movsw%@AE@% for string-manipulation mnemonics.%@NL@%
  8968.  
  8969.   ■   Use the %@AB@%near%@AE@% or %@AB@%far%@AE@% prefix with labels to override default distance.
  8970.       The %@AB@%ne%@AE@% abbreviation stands for %@AB@%near%@AE@%.%@NL@%
  8971.  
  8972.   ■   Use the %@AB@%word ptr%@AE@% or %@AB@%byte ptr%@AE@% prefix with destination operands to
  8973.       specify size. The %@AB@%wo%@AE@% abbreviation stands for %@AB@%word ptr%@AE@%; %@AB@%by%@AE@% for %@AB@%byte
  8974. %@AB@%      ptr%@AE@%.%@NL@%
  8975.  
  8976.   ■   Use square brackets around constant operands to specify absolute
  8977.       memory addresses. Constants without brackets are treated as constants.%@NL@%
  8978.  
  8979.   ■   Use the %@AB@%db%@AE@% mnemonics to assemble byte values or ASCII strings directly
  8980.       into memory.%@NL@%
  8981.  
  8982.   ■   Use 8087, 80287, or 80387 instructions only if your system has these
  8983.       math coprocessors.%@NL@%
  8984.  
  8985.  
  8986. The 80286 protected-mode mnemonics cannot be assembled.  %@NL@%
  8987.  
  8988. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8989. NOTE
  8990.  
  8991. %@AI@%Assembling over code can destroy checksum and cause a fatal exit.%@AE@%
  8992. ────────────────────────────────────────────────────────────────────────────%@NL@%
  8993.  
  8994.  
  8995. %@2@%%@CR:C6A00080195 @%%@AB@%ba ─ Breakpoint Address%@AE@%%@EH@%%@NL@%
  8996. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8997.  
  8998.  
  8999. %@3@%%@AB@%Syntax%@CR:C6A00080196 @%%@AE@%%@EH@%%@NL@%
  9000.  
  9001. %@AS@%  ba option size address «value» «command-string»%@AE@%
  9002.  
  9003. This command, available only on 80386 machines, sets an address breakpoint
  9004. at a given address. If your program accesses memory at this address, %@AB@%SYMDEB%@AE@%
  9005. will stop execution and display the current values of all registers and
  9006. flags.  %@NL@%
  9007.  
  9008. There are three types of breakpoints you can set with the %@AI@%option%@AE@% parameter.
  9009. If %@AB@%I%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a breakpoint when the CPU fetches an
  9010. instruction from the given %@AI@%address%@AE@%. If %@AB@%R%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a
  9011. breakpoint when the CPU reads or writes a byte, word, or doubleword to the
  9012. given %@AI@%address%@AE@%. If %@AB@%U%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a breakpoint when the CPU
  9013. writes a byte, word, or doubleword to the given address.  %@NL@%
  9014.  
  9015. The %@AI@%size%@AE@% parameter specifies the size of the data that %@AB@%SYMDEB%@AE@% expects to
  9016. find read or written at the given %@AI@%address%@AE@%. If %@AB@%B%@AE@% is specified (8-bit byte),
  9017. the command will break only at one address (for example, 0:10). If %@AB@%W%@AE@% is
  9018. specified (16-bit word), the command will break at one of two addresses
  9019. within that range (for example, 0:10 or 0:11 will cause a break within that
  9020. word). If %@AB@%D%@AE@% is specified (32-bit doubleword), the command will break at one
  9021. of four addresses within that range (for example, 0:08, 0:09, 0:10, or 0:11
  9022. will cause a break within that doubleword).  %@NL@%
  9023.  
  9024. The %@AI@%address%@AE@% parameter can specify any valid address. The address value is
  9025. rounded down if necessary to the nearest byte, word, or doubleword boundary
  9026. (for example, if a doubleword address of 0:14 was requested, the command
  9027. would access the address of the nearest doubleword boundary below the
  9028. address, in this case 0:12).  %@NL@%
  9029.  
  9030. The optional %@AI@%value%@AE@% parameter specifies the number of times the breakpoint is
  9031. to be ignored before being taken. It can be any 16-bit value.  %@NL@%
  9032.  
  9033. The %@AI@%command-string%@AE@% parameter specifies an optional list of commands to be
  9034. executed each time the breakpoint is taken. Each %@AB@%SYMDEB%@AE@% command in the list
  9035. can include parameters and is separated from the next command by a
  9036. semicolon.  %@NL@%
  9037.  
  9038. The %@AB@%bc%@AE@%, %@AB@%bd%@AE@%, %@AB@%be%@AE@%, and %@AB@%bl%@AE@% commands can all be used on these breakpoints.  %@NL@%
  9039.  
  9040.  
  9041. %@2@%%@CR:C6A00080197 @%%@AB@%bc ─ Breakpoint Clear%@AE@%%@EH@%%@NL@%
  9042. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9043.  
  9044.  
  9045. %@3@%%@AB@%Syntax%@CR:C6A00080198 @%%@CR:C6A00080199 @%%@AE@%%@EH@%%@NL@%
  9046.  
  9047. %@AS@%  bc id-list%@AE@%
  9048.  
  9049. This command permanently removes one or more previously set breakpoints. If
  9050. %@AI@%id-list%@AE@% is given, the command removes the breakpoints named in the list. The
  9051. %@AI@%id-list%@AE@% can be any combination of integer values from 0 to 9. If the
  9052. wildcard character (*) is given, the command removes all breakpoints.  %@NL@%
  9053.  
  9054.  
  9055. %@2@%%@CR:C6A00080200 @%%@AB@%bd ─ Breakpoint Disable%@AE@%%@EH@%%@NL@%
  9056. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9057.  
  9058.  
  9059. %@3@%%@AB@%Syntax%@CR:C6A00080201 @%%@AE@%%@EH@%%@NL@%
  9060.  
  9061. %@AS@%  bd id-list%@AE@%
  9062.  
  9063. This command disables, but does not delete, one or more breakpoints. If
  9064. %@AI@%id-list%@AE@% is given, the command disables the breakpoints named in the list.
  9065. The %@AI@%id-list%@AE@% can be any combination of integer values from 0 to 9. If the
  9066. wildcard character (*) is given, the command disables all breakpoints.%@CR:C6A00080202 @%%@NL@%
  9067.  
  9068.  
  9069. %@2@%%@CR:C6A00080203 @%%@AB@%be ─ Breakpoint Enable%@AE@%%@EH@%%@NL@%
  9070. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9071.  
  9072.  
  9073. %@3@%%@AB@%Syntax%@CR:C6A00080204 @%%@CR:C6A00080205 @%%@AE@%%@EH@%%@NL@%
  9074.  
  9075. %@AS@%  be id-list%@AE@%
  9076.  
  9077. This command restores one or more breakpoints that were temporarily disabled
  9078. by a %@AB@%bd%@AE@% command. If %@AI@%id-list%@AE@% is given, the command enables the breakpoints
  9079. named in the list. The %@AI@%id-list%@AE@% can be any combination of integer values from
  9080. 0 to 9. If the wildcard character (*) is given, the command enables all
  9081. breakpoints.  %@NL@%
  9082.  
  9083.  
  9084. %@2@%%@CR:C6A00080206 @%%@AB@%bl ─ Breakpoint List%@AE@%%@EH@%%@NL@%
  9085. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9086.  
  9087.  
  9088. %@3@%%@AB@%Syntax%@CR:C6A00080207 @%%@AE@%%@EH@%%@NL@%
  9089.  
  9090. %@AS@%  bl%@AE@%
  9091.  
  9092. This command lists current information about all breakpoints. The command
  9093. displays the breakpoint number, the enabled status, the address of the
  9094. breakpoint, the number of passes remaining, and the initial number of passes
  9095. (in parentheses). The enabled status can be enabled (e), disabled (d), or
  9096. virtual (v). A virtual breakpoint is a breakpoint set at a symbol whose .EXE
  9097. file has not yet been loaded.%@CR:C6A00080208 @%%@NL@%
  9098.  
  9099.  
  9100. %@2@%%@CR:C6A00080209 @%%@AB@%bp ─ Breakpoint Set%@AE@%%@EH@%%@NL@%
  9101. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9102.  
  9103.  
  9104. %@3@%%@AB@%Syntax%@CR:C6A00080210 @%%@CR:C6A00080211 @%%@CR:C6A00080212 @%%@AE@%%@EH@%%@NL@%
  9105.  
  9106. %@AS@%  bp«id» address «value» «command-string»%@AE@%
  9107.  
  9108. This command creates a "sticky" breakpoint at the given %@AI@%address%@AE@%. Sticky
  9109. breakpoints stop execution and display the current values of all registers
  9110. and flags. Sticky breakpoints remain in the program until removed using the
  9111. %@AB@%bc%@AE@% command, or temporarily disabled using the %@AB@%bd%@AE@% command. The Symbolic
  9112. Debugger allows up to 10 sticky breakpoints (0 through 9). The optional %@AI@%id%@AE@%
  9113. parameter specifies which breakpoint is to be created. If no %@AI@%id%@AE@% is given,
  9114. the first available breakpoint number is used. The %@AI@%address%@AE@% parameter can be
  9115. any valid instruction address (it must be the first byte of an instruction).
  9116. The optional %@AI@%value%@AE@% parameter specifies the number of times the breakpoint is
  9117. to be ignored before being taken. It can be any 16-bit value. The optional
  9118. %@AI@%command-string%@AE@% parameter specifies a list of commands to be executed each
  9119. time the breakpoint is taken. Each %@AB@%SYMDEB%@AE@% command in the list can include
  9120. parameters and is separated from the next command by a semicolon (;).%@CR:C6A00080213 @%%@NL@%
  9121.  
  9122.  
  9123. %@2@%%@CR:C6A00080214 @%%@AB@%c ─ Compare%@AE@%%@EH@%%@NL@%
  9124. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9125.  
  9126.  
  9127. %@3@%%@AB@%Syntax%@CR:C6A00080215 @%%@CR:C6A00080216 @%%@AE@%%@EH@%%@NL@%
  9128.  
  9129. %@AS@%  c range address%@AE@%
  9130.  
  9131. This command compares the bytes in the memory locations specified by %@AI@%range%@AE@%
  9132. with the corresponding bytes in the memory locations beginning at %@AI@%address%@AE@%.
  9133. If all corresponding bytes match, the command displays its prompt and waits
  9134. for the next command. If one or more pairs of corresponding bytes do not
  9135. match, the command displays each pair of mismatched bytes.  %@NL@%
  9136.  
  9137.  
  9138. %@2@%%@CR:C6A00080217 @%%@AB@%d ─ Dump%@AE@%%@EH@%%@NL@%
  9139. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9140.  
  9141. %@CR:C6A00080218 @%%@CR:C6A00080219 @%Syntax  %@NL@%
  9142.  
  9143. %@AS@%  d «range»%@AE@%
  9144.  
  9145. This command displays the contents of memory in the given %@AI@%range%@AE@%. The command
  9146. displays data in the same format as the most recent dump command. (Dump
  9147. commands include %@AB@%d%@AE@%, %@AB@%da%@AE@%, %@AB@%db%@AE@%, %@AB@%dd%@AE@%, %@AB@%dg%@AE@%, %@AB@%dh%@AE@%, %@AB@%dl%@AE@%, %@AB@%dq%@AE@%, %@AB@%ds%@AE@%, %@AB@%dt%@AE@%, and %@AB@%dw%@AE@%.) If no range
  9148. is given and no previous dump command has been used, the command displays
  9149. bytes starting from DS:IP.  %@NL@%
  9150.  
  9151.  
  9152. %@2@%%@CR:C6A00080220 @%%@AB@%da ─ Dump ASCII%@AE@%%@EH@%%@NL@%
  9153. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9154.  
  9155.  
  9156. %@3@%%@AB@%Syntax%@CR:C6A00080221 @% %@CR:C6A00080222 @%%@CR:C6A00080223 @%%@AE@%%@EH@%%@NL@%
  9157.  
  9158. %@AS@%  da «range»%@AE@%
  9159.  
  9160. This command displays the ASCII characters in the given %@AI@%range%@AE@%. Each line
  9161. displays up to 48 characters. The display continues until the first null
  9162. byte or until all characters in the range have been shown. Nonprintable
  9163. characters, such as carriage returns and line feeds, are displayed as
  9164. periods (.).  %@NL@%
  9165.  
  9166.  
  9167. %@2@%%@CR:C6A00080224 @%%@AB@%db ─ Dump Bytes%@AE@%%@EH@%%@NL@%
  9168. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9169.  
  9170.  
  9171. %@3@%%@AB@%Syntax%@CR:C6A00080225 @% %@CR:C6A00080226 @%%@CR:C6A00080227 @%%@AE@%%@EH@%%@NL@%
  9172.  
  9173. %@AS@%  db «range»%@AE@%
  9174.  
  9175. This command displays the hexadecimal and ASCII values of the bytes in the
  9176. given %@AI@%range%@AE@%. Each display line shows the address of the first byte in the
  9177. line, followed by up to 16 hexadecimal byte values. The byte values are
  9178. immediately followed by the corresponding ASCII values. The eighth and ninth
  9179. hexadecimal values are separated by a hyphen (-). Nonprintable ASCII values
  9180. are displayed as periods (.).%@CR:C6A00080228 @%%@CR:C6A00080229 @%%@NL@%
  9181.  
  9182.  
  9183. %@2@%%@CR:C6A00080230 @%%@AB@%dd ─ Dump Doublewords%@AE@%%@EH@%%@NL@%
  9184. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9185.  
  9186.  
  9187. %@3@%%@AB@%Syntax%@CR:C6A00080231 @%%@CR:C6A00080232 @%%@CR:C6A00080233 @%%@AE@%%@EH@%%@NL@%
  9188.  
  9189. %@AS@%  dd «range»%@AE@%
  9190.  
  9191. This command displays the hexadecimal values of the doublewords (4-byte
  9192. values) in the given %@AI@%range%@AE@%. Each display line shows the address of the first
  9193. doubleword in the line and up to four hexadecimal doubleword values.  %@NL@%
  9194.  
  9195.  
  9196. %@2@%%@CR:C6A00080234 @%%@AB@%df ─ Display Global Free List%@AE@%%@EH@%%@NL@%
  9197. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9198.  
  9199.  
  9200. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9201.  
  9202. %@AS@%  df%@AE@%
  9203.  
  9204. This command displays a list of the free global memory objects in the global
  9205. heap. The list has the following form:%@CR:C6A00080235 @%%@CR:C6A00080236 @%%@NL@%
  9206.  
  9207. %@AS@%  segment-address: size owner%@AE@%
  9208.  
  9209. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  9210. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  9211. (multiples of 16 bytes) of the object.  %@NL@%
  9212.  
  9213. The %@AI@%owner%@AE@% field always specifies that the module is free.  %@NL@%
  9214.  
  9215.  
  9216. %@2@%%@CR:C6A00080237 @%%@AB@%dg ─ Display Global Heap%@AE@%%@EH@%%@NL@%
  9217. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9218.  
  9219.  
  9220. %@3@%%@AB@%Syntax%@CR:C6A00080238 @%%@AE@%%@EH@%%@NL@%
  9221.  
  9222. %@AS@%  dg%@AE@%
  9223.  
  9224. This command displays a list of the global memory objects in the global
  9225. heap. The list has the following form:%@CR:C6A00080239 @%%@NL@%
  9226.  
  9227. %@AS@%  segment-address: size segment-type owner «handle flags chain»%@AE@%
  9228.  
  9229. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  9230. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  9231. (multiples of 16 bytes) of the object. The %@AI@%segment-type%@AE@% field specifies the
  9232. type of object. The type can be any one of the following:  %@NL@%
  9233.  
  9234. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  9235. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9236. %@AB@%CODE%@AE@%                              Segment contains program code.
  9237.  
  9238. %@AB@%DATA%@AE@%                              Segment contains program data and 
  9239.                                   possible stack and local heap data.
  9240.  
  9241. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  9242.                                   objects ready for allocation by an 
  9243.                                   application.
  9244.  
  9245. %@AB@%PRIV%@AE@%                              Segment contains private data.
  9246.  
  9247. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  9248.                                   the global heap.
  9249.  
  9250. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  9251. allocated the memory object. The name "pdb" is used for memory objects that
  9252. represent program descriptor blocks. These blocks contain execution
  9253. information about applications.%@CR:C6A00080240 @%%@NL@%
  9254.  
  9255. The %@AI@%handle%@AE@% field specifies the handle of the global memory object. If %@AB@%SYMDEB%@AE@%
  9256. displays no handle, the segment is fixed.  %@NL@%
  9257.  
  9258. The %@AI@%flags%@AE@% field specifies the following:  %@NL@%
  9259.  
  9260. %@AB@%Flag%@AE@%                              %@AB@%Meaning%@AE@%
  9261. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9262. D                                 The segment is moveable and discardable.
  9263.  
  9264. L                                 The segment is locked. If the segment is
  9265.                                   locked, the lock count appears to the 
  9266.                                   right of the flag.
  9267.  
  9268. If %@AB@%SYMDEB%@AE@% displays a handle, but no flag, the segment is moveable but
  9269. nondiscardable.  %@NL@%
  9270.  
  9271. The chain field specifies the previous and next segment addresses in the LRU
  9272. list. %@AB@%SYMDEB%@AE@% displays the addresses only if the segment is moveable and
  9273. discardable (the D flag).  %@NL@%
  9274.  
  9275.  
  9276. %@2@%%@CR:C6A00080241 @%%@AB@%dh ─ Display Local Heap%@AE@%%@EH@%%@NL@%
  9277. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9278.  
  9279.  
  9280. %@3@%%@AB@%Syntax%@CR:C6A00080242 @%%@AE@%%@EH@%%@NL@%
  9281.  
  9282. %@AS@%  dh%@AE@%
  9283.  
  9284. This command displays a list of the local memory objects in the local heap
  9285. (if any) belonging to the current data segment. The command uses the current
  9286. value of the DS register to locate the data segment and check for a local
  9287. heap. The list of memory objects has the following form:%@CR:C6A00080243 @%%@NL@%
  9288.  
  9289. %@AS@%  offset: size { BUSY | FREE }%@AE@%
  9290.  
  9291. The %@AI@%offset%@AE@% field specifies the address offset from the beginning of the data
  9292. segment to the local memory object. The %@AI@%size%@AE@% field specifies the size of the
  9293. memory object in bytes. If %@AB@%BUSY%@AE@% is given, the object has been allocated and
  9294. is currently in use. If %@AB@%FREE%@AE@% is given, the object is in the pool of free
  9295. objects ready to be allocated by the application. A special memory object,
  9296. %@AB@%SENTINAL%@AE@%, may also be displayed.  %@NL@%
  9297.  
  9298.  
  9299. %@2@%%@CR:C6A00080244 @%%@AB@%dl ─ Dump Long Reals%@AE@%%@EH@%%@NL@%
  9300. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9301.  
  9302.  
  9303. %@3@%%@AB@%Syntax%@CR:C6A00080245 @%%@AE@%%@EH@%%@NL@%
  9304.  
  9305. %@AS@%  dl «range»%@AE@%
  9306.  
  9307. This command displays the hexadecimal and decimal values of the long
  9308. (8-byte) floating-point numbers within the given %@AI@%range%@AE@%. Each display line
  9309. shows the address of the floating-point number, the hexadecimal values of
  9310. the bytes in the number, and the decimal value of the number.%@CR:C6A00080246 @%%@CR:C6A00080247 @%%@NL@%
  9311.  
  9312.  
  9313. %@2@%%@CR:C6A00080248 @%%@AB@%dm ─ Display Global Module List%@AE@%%@EH@%%@NL@%
  9314. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9315.  
  9316.  
  9317. %@3@%%@AB@%Syntax%@CR:C6A00080249 @%%@AE@%%@EH@%%@NL@%
  9318.  
  9319. %@AS@%  dm%@AE@%
  9320.  
  9321. This command displays a list of the global modules in the global heap. The
  9322. list has the following form:%@CR:C6A00080250 @%%@NL@%
  9323.  
  9324. %@AS@%  module-handle module-type module-name file-name%@AE@%
  9325.  
  9326. The %@AI@%module-handle%@AE@% field specifies the handle of the module. The %@AI@%module-type%@AE@%
  9327. field specifies either a dynamic-link library (DLL) or the name of the
  9328. application you are debugging. The %@AI@%module-name%@AE@% field specifies the name of
  9329. the module. The %@AI@%file-name%@AE@% field specifies the name of the file from which
  9330. you loaded the application.  %@NL@%
  9331.  
  9332.  
  9333. %@2@%%@CR:C6A00080251 @%%@AB@%dq ─ Dump Task Queue%@AE@%%@EH@%%@NL@%
  9334. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9335.  
  9336.  
  9337. %@3@%%@AB@%Syntax%@CR:C6A00080252 @%%@CR:C6A00080253 @%%@AE@%%@EH@%%@NL@%
  9338.  
  9339. %@AS@%  dq%@AE@%
  9340.  
  9341. This command displays a list containing information about the various task
  9342. queues supported by the system. The list has the following form:  %@NL@%
  9343.  
  9344. %@AS@%  task-descriptor-block  stack-segment:stack-pointer number-of-events
  9345. %@AS@%priority internal-messaging-information module%@AE@%
  9346.  
  9347. The %@AI@%task-descriptor-block%@AE@% field specifies the selector or segment address.
  9348. The task descriptor block is identical to the "pdb."%@CR:C6A00080254 @%%@CR:C6A00080255 @%The
  9349. %@AI@%stack-segment:stack-pointer%@AE@% field specifies the stack segment and pointer.
  9350. The %@AI@%number-of-events%@AE@% field specifies the number of events waiting for the
  9351. segment. The %@AI@%priority%@AE@% field specifies the priority of the segment. The
  9352. %@AI@%internal-messaging-information%@AE@% field specifies information about internal
  9353. messages. The %@AI@%module%@AE@% field specifies the module name.  %@NL@%
  9354.  
  9355.  
  9356. %@2@%%@CR:C6A00080256 @%%@AB@%ds ─ Dump Short Reals%@AE@%%@EH@%%@NL@%
  9357. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9358.  
  9359.  
  9360. %@3@%%@AB@%Syntax%@CR:C6A00080257 @%%@AE@%%@EH@%%@NL@%
  9361.  
  9362. %@AS@%  ds «range»%@AE@%
  9363.  
  9364. This command displays the hexadecimal and decimal values of the short
  9365. (4-byte) floating-point numbers in the given %@AI@%range%@AE@%. Each display line shows
  9366. the address of the floating-point number, the hexadecimal values of the
  9367. bytes in the number, and the decimal value of the number.%@CR:C6A00080258 @%%@CR:C6A00080259 @%%@NL@%
  9368.  
  9369.  
  9370. %@2@%%@CR:C6A00080260 @%%@AB@%dt ─ Dump Ten-Byte Reals%@AE@%%@EH@%%@NL@%
  9371. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9372.  
  9373.  
  9374. %@3@%%@AB@%Syntax%@CR:C6A00080261 @%%@CR:C6A00080262 @%%@AE@%%@EH@%%@NL@%
  9375.  
  9376. %@AS@%  dt «range»%@AE@%
  9377.  
  9378. This command displays the hexadecimal and decimal values of the 10-byte
  9379. floating-point numbers in the given %@AI@%range%@AE@%. Each display line shows the
  9380. address of the floating-point number, the hexadecimal values of the bytes in
  9381. the number, and the decimal value of the number.  %@NL@%
  9382.  
  9383.  
  9384. %@2@%%@CR:C6A00080263 @%%@AB@%du ─ Display Global LRU List%@AE@%%@EH@%%@NL@%
  9385. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9386.  
  9387.  
  9388. %@3@%%@AB@%Syntax%@CR:C6A00080264 @%%@CR:C6A00080265 @%%@AE@%%@EH@%%@NL@%
  9389.  
  9390. %@AS@%  du%@AE@%
  9391.  
  9392. This command displays a list of the least-recently-used (LRU) global memory
  9393. objects in the global heap. The list has the following form:  %@NL@%
  9394.  
  9395. %@AS@%  segment-address: size segment-type owner «handle flags chain»%@AE@%
  9396.  
  9397. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  9398. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  9399. (multiples of 16 bytes) of the object. The %@AI@%segment-type%@AE@% field specifies the
  9400. type of object. The type can be any one of the following:  %@NL@%
  9401.  
  9402. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  9403. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9404. %@AB@%CODE%@AE@%                              Segment contains program code.
  9405.  
  9406. %@AB@%DATA%@AE@%                              Segment contains program data and 
  9407.                                   possible stack and local heap data.
  9408.  
  9409. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  9410.                                   objects ready for allocation by an 
  9411.                                   application.
  9412.  
  9413. %@AB@%PRIV%@AE@%                              Segment contains private data.
  9414.  
  9415. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  9416.                                   the global heap.
  9417.  
  9418. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  9419. allocated the memory object. The name "pdb" is used for memory objects that
  9420. represent program descriptor blocks. These blocks contain execution
  9421. information about applications.%@CR:C6A00080266 @%%@NL@%
  9422.  
  9423. The %@AI@%handle%@AE@% field specifies the handle of the global memory object.  %@NL@%
  9424.  
  9425. The %@AI@%flags%@AE@% field specifies D, which means the segment is moveable and
  9426. discardable.  %@NL@%
  9427.  
  9428. The %@AI@%chain%@AE@% field specifies the previous and next segment addresses in the LRU
  9429. list.  %@NL@%
  9430.  
  9431.  
  9432. %@2@%%@CR:C6A00080267 @%%@AB@%dw ─ Dump Words%@AE@%%@EH@%%@NL@%
  9433. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9434.  
  9435.  
  9436. %@3@%%@AB@%Syntax%@CR:C6A00080268 @%%@AE@%%@EH@%%@NL@%
  9437.  
  9438. %@AS@%  dw «range»%@AE@%
  9439.  
  9440. This command displays the hexadecimal values of the words (2-byte values) in
  9441. the given %@AI@%range%@AE@%. Each display line shows the address of the first word in
  9442. the line and up to eight hexadecimal word values.%@CR:C6A00080269 @%%@NL@%
  9443.  
  9444.  
  9445. %@2@%%@CR:C6A00080270 @%%@AB@%e ─ Enter%@AE@%%@EH@%%@NL@%
  9446. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9447.  
  9448.  
  9449. %@3@%%@AB@%Syntax%@CR:C6A00080271 @%%@AE@%%@EH@%%@NL@%
  9450.  
  9451. %@AS@%  e address «list»%@AE@%
  9452.  
  9453. This command enters one or more values into memory. The size of the value
  9454. entered depends on the most recently used Enter command. (Enter commands are
  9455. %@AB@%e%@AE@%, %@AB@%ea%@AE@%, %@AB@%eb%@AE@%, %@AB@%ed%@AE@%, %@AB@%el%@AE@%, %@AB@%es%@AE@%, %@AB@%et%@AE@%, and %@AB@%ew%@AE@%.) The default is %@AB@%eb%@AE@% (bytes). If no %@AI@%list%@AE@% is
  9456. given, the command displays the value at %@AI@%address%@AE@% and prompts for a new
  9457. value. If %@AI@%list%@AE@% is given, the command replaces the value at %@AI@%address%@AE@% and at
  9458. each subsequent address until all values in the list have been used.  %@NL@%
  9459.  
  9460.  
  9461. %@2@%%@CR:C6A00080272 @%%@AB@%ea ─ Enter Address%@AE@%%@EH@%%@NL@%
  9462. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9463.  
  9464.  
  9465. %@3@%%@AB@%Syntax%@CR:C6A00080273 @%%@CR:C6A00080274 @%%@CR:C6A00080275 @%%@AE@%%@EH@%%@NL@%
  9466.  
  9467. %@AS@%  ea address «list»%@AE@%
  9468.  
  9469. This command enters an ASCII string into memory. If no %@AI@%list%@AE@% is given, the
  9470. command displays the byte at %@AI@%address%@AE@% and prompts for a replacement. If %@AI@%list%@AE@%
  9471. is given, the command replaces the bytes at %@AI@%address%@AE@%, then displays the next
  9472. byte and prompts for a replacement.  %@NL@%
  9473.  
  9474.  
  9475. %@2@%%@CR:C6A00080276 @%%@AB@%eb ─ Enter Bytes%@AE@%%@EH@%%@NL@%
  9476. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9477.  
  9478.  
  9479. %@3@%%@AB@%Syntax%@CR:C6A00080277 @%%@AE@%%@EH@%%@NL@%
  9480.  
  9481. %@AS@%  eb address «list»%@AE@%
  9482.  
  9483. This command enters one or more byte values into memory. If %@AI@%list%@AE@% is given,
  9484. the command replaces the byte at %@AI@%address%@AE@% and bytes at each subsequent
  9485. address until all values in the list have been used. If no %@AI@%list%@AE@% is given,
  9486. the command displays the byte at %@AI@%address%@AE@% and prompts for a new value. To
  9487. skip to the next byte, enter a new value or press the SPACEBAR. To move back
  9488. to the previous byte, type a hyphen (-). To exit from the command, press
  9489. ENTER.  %@NL@%
  9490.  
  9491.  
  9492. %@2@%%@CR:C6A00080278 @%%@AB@%ed ─ Enter Doublewords%@AE@%%@EH@%%@NL@%
  9493. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9494.  
  9495.  
  9496. %@3@%%@AB@%Syntax%@CR:C6A00080279 @%%@AE@%%@EH@%%@NL@%
  9497.  
  9498. %@AS@%  ed address «value»%@AE@%
  9499.  
  9500. This command enters a doubleword value into memory. If no %@AI@%value%@AE@% is given,
  9501. the command displays the doubleword at %@AI@%address%@AE@% and prompts for a
  9502. replacement. If %@AI@%value%@AE@% is given, the  command replaces the doubleword at
  9503. %@AI@%address%@AE@%, then displays the next doubleword and prompts for a replacement.
  9504. Doublewords must be typed as two words separated by a colon.%@CR:C6A00080280 @%%@CR:C6A00080281 @%%@CR:C6A00080282 @%%@NL@%
  9505.  
  9506.  
  9507. %@2@%%@CR:C6A00080283 @%%@AB@%el ─ Enter Long Reals%@AE@%%@EH@%%@NL@%
  9508. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9509.  
  9510.  
  9511. %@3@%%@AB@%Syntax%@CR:C6A00080284 @%%@AE@%%@EH@%%@NL@%
  9512.  
  9513. %@AS@%  el address «value»%@AE@%
  9514.  
  9515. This command enters a long-real value into memory. If no %@AI@%value%@AE@% is given, the
  9516. command displays the long-real value at %@AI@%address%@AE@% and prompts for a
  9517. replacement. If %@AI@%value%@AE@% is given, the command replaces the long-real value at
  9518. %@AI@%address%@AE@%, then displays the next long-real value and prompts for a
  9519. replacement.%@CR:C6A00080285 @%%@NL@%
  9520.  
  9521.  
  9522. %@2@%%@CR:C6A00080286 @%%@AB@%es ─ Enter Short Reals%@AE@%%@EH@%%@NL@%
  9523. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9524.  
  9525.  
  9526. %@3@%%@AB@%Syntax%@CR:C6A00080287 @%%@AE@%%@EH@%%@NL@%
  9527.  
  9528. %@AS@%  es address «value»%@AE@%
  9529.  
  9530. This command enters a short-real value into memory. If no %@AI@%value%@AE@% is given,
  9531. the command displays the short-real value at %@AI@%address%@AE@% and prompts for a
  9532. replacement. If %@AI@%value%@AE@% is given, the command replaces the short-real value at
  9533. %@AI@%address%@AE@%, then displays the next short-real value and prompts for a
  9534. replacement.%@CR:C6A00080288 @%%@NL@%
  9535.  
  9536.  
  9537. %@2@%%@CR:C6A00080289 @%%@AB@%et ─ Enter Ten-Byte Reals%@AE@%%@EH@%%@NL@%
  9538. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9539.  
  9540.  
  9541. %@3@%%@AB@%Syntax%@CR:C6A00080290 @%%@AE@%%@EH@%%@NL@%
  9542.  
  9543. %@AS@%  et address «value»%@AE@%
  9544.  
  9545. This command enters a 10-byte real value into memory. If no %@AI@%value%@AE@% is given,
  9546. the command displays the 10-byte real value at %@AI@%address%@AE@% and prompts for a
  9547. replacement. If %@AI@%value%@AE@% is given, the command replaces the 10-byte real value
  9548. at %@AI@%address%@AE@%, then displays the next 10-byte real value and prompts for a
  9549. replacement.  %@NL@%
  9550.  
  9551.  
  9552. %@2@%%@CR:C6A00080291 @%%@AB@%ew ─ Enter Words%@AE@%%@EH@%%@NL@%
  9553. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9554.  
  9555.  
  9556. %@3@%%@AB@%Syntax%@CR:C6A00080292 @%%@AE@%%@EH@%%@NL@%
  9557.  
  9558. %@AS@%  ew address «value»%@AE@%
  9559.  
  9560. This command enters a word value into memory. If no %@AI@%value%@AE@% is given, the
  9561. command displays the word at %@AI@%address%@AE@% and prompts for a replacement. If %@AI@%value%@AE@%
  9562. is given, the command replaces the word at %@AI@%address%@AE@%, then displays the next
  9563. word and prompts for a replacement.  %@NL@%
  9564.  
  9565.  
  9566. %@2@%%@CR:C6A00080293 @%%@AB@%f ─ Fill%@AE@%%@EH@%%@NL@%
  9567. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9568.  
  9569.  
  9570. %@3@%%@AB@%Syntax%@CR:C6A00080294 @%%@AE@%%@EH@%%@NL@%
  9571.  
  9572. %@AS@%  f range list%@AE@%
  9573.  
  9574. This command fills the addresses in the given %@AI@%range%@AE@% with the values in %@AI@%list%@AE@%.
  9575. If %@AI@%range%@AE@% specifies more bytes than the number of values in the list, the
  9576. list is repeated until all bytes in the range are filled. If %@AI@%list%@AE@% has more
  9577. values than the number of bytes in the range, the command ignores any extra
  9578. values.  %@NL@%
  9579.  
  9580.  
  9581. %@2@%%@CR:C6A00080295 @%%@AB@%g ─ Go%@AE@%%@EH@%%@NL@%
  9582. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9583.  
  9584.  
  9585. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9586.  
  9587. %@AS@%  g «= startaddress» «breakaddress»...%@AE@%
  9588.  
  9589. This command passes execution control to the program at the given
  9590. %@AI@%startaddress%@AE@%. Execution continues to the end of the program or until %@AI@%break
  9591. %@AI@%address%@AE@% is encountered. The program also stops at any breakpoints set using
  9592. the %@AB@%bp%@AE@% command. If no %@AI@%startaddress%@AE@% is given, the command passes execution to
  9593. the address specified by the current values of the CS and IP registers. If
  9594. %@AI@%breakaddress%@AE@% is given, it must specify an instruction address (that is, the
  9595. address must contain the first byte of an instruction). Up to 10 break
  9596. addresses, in any order, can be given at one time.%@CR:C6A00080296 @%%@NL@%
  9597.  
  9598.  
  9599. %@2@%%@CR:C6A00080297 @%%@AB@%h ─ Hex%@AE@%%@EH@%%@NL@%
  9600. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9601.  
  9602.  
  9603. %@3@%%@AB@%Syntax%@CR:C6A00080298 @%%@AE@%%@EH@%%@NL@%
  9604.  
  9605. %@AS@%  h value1 value2%@AE@%
  9606.  
  9607. This command displays the sum and difference of two hexadecimal numbers,
  9608. %@AI@%value1%@AE@% and %@AI@%value2%@AE@%.  %@NL@%
  9609.  
  9610.  
  9611. %@2@%%@CR:C6A00080299 @%%@AB@%i ─ Input%@AE@%%@EH@%%@NL@%
  9612. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9613.  
  9614.  
  9615. %@3@%%@AB@%Syntax%@CR:C6A00080300 @%%@CR:C6A00080301 @%%@AE@%%@EH@%%@NL@%
  9616.  
  9617. %@AS@%  i value%@AE@%
  9618.  
  9619. This command reads and displays one byte from the input port specified by
  9620. %@AI@%value%@AE@%. The %@AI@%value%@AE@% parameter can specify any 16-bit port address.  %@NL@%
  9621.  
  9622.  
  9623. %@2@%%@CR:C6A00080302 @%%@AB@%k ─ Backtrace Stack%@AE@%%@EH@%%@NL@%
  9624. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9625.  
  9626.  
  9627. %@3@%%@AB@%Syntax%@CR:C6A00080303 @%%@AE@%%@EH@%%@NL@%
  9628.  
  9629. %@AS@%  k «value»%@AE@%
  9630.  
  9631. This command displays the current stack frame. Each line shows the name of a
  9632. procedure, its arguments, and the address of the statement that called it.
  9633. The command displays two 2-byte arguments by default. If %@AI@%value%@AE@% is given, the
  9634. command displays that many 2-byte arguments. Using the %@AB@%k%@AE@% command at the
  9635. beginning of a function (before the function prolog has been executed) will
  9636. give incorrect results. The command uses the BP register to compute the
  9637. current backtrace, and this register is not correctly set for a function
  9638. until its prolog has been executed.%@CR:C6A00080304 @%%@NL@%
  9639.  
  9640.  
  9641. %@2@%%@CR:C6A00080305 @%%@AB@%kt ─ Backtrace Task Stack%@AE@%%@EH@%%@NL@%
  9642. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9643.  
  9644.  
  9645. %@3@%%@AB@%Syntax%@CR:C6A00080306 @%%@CR:C6A00080307 @%%@AE@%%@EH@%%@NL@%
  9646.  
  9647. %@AS@%  kt pdb «value»%@AE@%
  9648.  
  9649. This command displays the stack frame of the program specified by %@AI@%pdb%@AE@%. Each
  9650. line shows the name of a procedure, its arguments, and the address of the
  9651. statement that called it. The command displays two 2-byte arguments by
  9652. default. If %@AI@%value%@AE@% is given, the command displays that many 2-byte arguments.
  9653. The %@AI@%pdb%@AE@% parameter must specify the segment address of the program descriptor
  9654. block for the task to be traced.  %@NL@%
  9655.  
  9656. To obtain the %@AI@%pdb%@AE@% value, use the %@AB@%dq %@AE@%(Dump Task Queue) command.%@CR:C6A00080308 @%%@NL@%
  9657.  
  9658.  
  9659. %@2@%%@CR:C6A00080309 @%%@AB@%kv ─ Verbose Backtrace Stack%@AE@%%@EH@%%@NL@%
  9660. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9661.  
  9662.  
  9663. %@3@%%@AB@%Syntax%@CR:C6A00080310 @%%@AE@%%@EH@%%@NL@%
  9664.  
  9665. %@AS@%  kv «value»%@AE@%
  9666.  
  9667. This command displays information that the %@AB@%k%@AE@% (Backtrace Stack) command
  9668. provides, plus information about stack location and frame pointer values for
  9669. each frame.  %@NL@%
  9670.  
  9671.  
  9672. %@2@%%@CR:C6A00080311 @%%@AB@%l ─ Load%@AE@%%@EH@%%@NL@%
  9673. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9674.  
  9675.  
  9676. %@3@%%@AB@%Syntax%@CR:C6A00080312 @%%@CR:C6A00080313 @%%@AE@%%@EH@%%@NL@%
  9677.  
  9678. %@AS@%  l «address «drive record count» »%@AE@%
  9679.  
  9680. This command copies the contents of a named file or the contents of a given
  9681. number of logical disk records into memory. The contents are copied to
  9682. %@AI@%address%@AE@% or to a default address, and the BX:CX register pair is set to the
  9683. number of bytes loaded.  %@NL@%
  9684.  
  9685. To load a file, set the filename using the %@AB@%n%@AE@% command (otherwise, %@AB@%SYMDEB%@AE@% uses
  9686. whatever name is currently at location DS:5C). If %@AI@%address%@AE@% is not given,
  9687. %@AB@%SYMDEB%@AE@% copies bytes to CS:100. If the named file has an .EXE extension, the
  9688. %@AB@%l%@AE@% command adjusts the load address to the address given in the .EXE file
  9689. header. The command strips any header information from an .EXE file before
  9690. loading. If the named file has an .HEX extension, the %@AB@%l%@AE@% command adds that
  9691. file's start address to %@AI@%address%@AE@% before loading the file.  %@NL@%
  9692.  
  9693. To load logical records from a disk, set %@AI@%drive%@AE@% to 0 (drive A), 1 (drive B),
  9694. or 2 (drive C). Set %@AI@%record%@AE@% to the first logical record to be read (any one-
  9695. to four-digit hexadecimal number). Set %@AI@%count%@AE@% to the number of records to
  9696. read (any one- to four-digit hexadecimal number).%@CR:C6A00080314 @%%@CR:C6A00080315 @%%@CR:C6A00080316 @%%@CR:C6A00080317 @%%@NL@%
  9697.  
  9698.  
  9699. %@2@%%@CR:C6A00080318 @%%@AB@%m ─ Move%@AE@%%@EH@%%@NL@%
  9700. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9701.  
  9702.  
  9703. %@3@%%@AB@%Syntax%@CR:C6A00080319 @%%@CR:C6A00080320 @%%@AE@%%@EH@%%@NL@%
  9704.  
  9705. %@AS@%  m range address%@AE@%
  9706.  
  9707. This command moves the block of memory specified by %@AI@%range%@AE@% to the location
  9708. starting at %@AI@%address%@AE@%. All moves are guaranteed to be performed without data
  9709. loss.  %@NL@%
  9710.  
  9711.  
  9712. %@2@%%@CR:C6A00080321 @%%@AB@%m%@AI@%id%@AE@%%@AB@%%@AE@%─ Macro%@AE@%%@EH@%%@NL@%
  9713. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9714.  
  9715.  
  9716. %@3@%%@AB@%Syntax%@CR:C6A00080322 @%%@CR:C6A00080323 @%%@CR:C6A00080324 @% %@CR:C6A00080325 @%%@AE@%%@EH@%%@NL@%
  9717.  
  9718. %@AS@%  mid«= command-string»%@AE@%
  9719.  
  9720. This command defines or executes a %@AB@%SYMDEB%@AE@% command macro. The %@AI@%id%@AE@% parameter
  9721. identifies the macro to be defined or executed. There are 10 macros,
  9722. numbered 0 through 9. If %@AI@%command-string%@AE@% is specified, the command assigns
  9723. the %@AB@%SYMDEB%@AE@% commands given in the string to the macro. If no string is given,
  9724. the command executes the commands currently assigned to the macro. Macros
  9725. are initially empty unless the %@AB@%/@%@AE@% option is used when the Symbolic Debugger
  9726. is started. This option reads a set of macro definitions from a specified
  9727. file.  %@NL@%
  9728.  
  9729.  
  9730. %@2@%%@CR:C6A00080326 @%%@AB@%n ─ Name%@AE@%%@EH@%%@NL@%
  9731. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9732.  
  9733.  
  9734. %@3@%%@AB@%Syntax%@CR:C6A00080327 @%%@CR:C6A00080328 @%%@CR:C6A00080329 @%%@CR:C6A00080330 @%%@AE@%%@EH@%%@NL@%
  9735.  
  9736. %@AS@%  n «filename» «arguments»%@AE@%
  9737.  
  9738. This command sets the filename for subsequent %@AB@%l%@AE@% and %@AB@%w%@AE@% commands, or sets
  9739. program arguments for subsequent execution of a loaded program. If %@AI@%filename%@AE@%
  9740. is given, all subsequent %@AB@%l%@AE@% and %@AB@%w%@AE@% commands will use this name when accessing
  9741. disk files. If %@AI@%arguments%@AE@% is given, the command copies all arguments,
  9742. including spaces, to the memory location starting at DS:81 and sets the byte
  9743. at DS:80 to a count of the total number of characters copied. If the first
  9744. two arguments are also filenames, the command creates file control blocks at
  9745. addresses DS:5C and DS:6C and copies the names (in proper format) to these
  9746. blocks.  %@NL@%
  9747.  
  9748.  
  9749. %@2@%%@CR:C6A00080331 @%%@AB@%o ─ Output%@AE@%%@EH@%%@NL@%
  9750. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9751.  
  9752.  
  9753. %@3@%%@AB@%Syntax%@CR:C6A00080332 @%%@AE@%%@EH@%%@NL@%
  9754.  
  9755. %@AS@%  o value byte%@AE@%
  9756.  
  9757. This command sends the given %@AI@%byte%@AE@% to the output port specified by %@AI@%value%@AE@%. The
  9758. %@AI@%value%@AE@% parameter can specify any 16-bit port address.  %@NL@%
  9759.  
  9760.  
  9761. %@2@%%@CR:C6A00080333 @%%@AB@%p ─ Program Step%@AE@%%@EH@%%@NL@%
  9762. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9763.  
  9764.  
  9765. %@3@%%@AB@%Syntax%@CR:C6A00080334 @%%@AE@%%@EH@%%@NL@%
  9766.  
  9767. %@AS@%  p «=startaddress» «value»%@AE@%
  9768.  
  9769. This command executes an instruction, then displays the current values of
  9770. all registers and flags. If %@AI@%startaddress%@AE@% is given, the command starts
  9771. execution at the given address. Otherwise, it starts execution at the
  9772. instruction pointed to by the current CS and IP registers. If %@AI@%value%@AE@% is
  9773. given, the command executes %@AI@%value%@AE@% number of instructions before stopping.
  9774. The command automatically executes and returns from any call instructions or
  9775. software interrupts it encounters, leaving execution control at the next
  9776. instruction after the call or interrupt.%@CR:C6A00080335 @%%@CR:C6A00080336 @%%@NL@%
  9777.  
  9778.  
  9779. %@2@%%@CR:C6A00080337 @%%@AB@%q ─ Quit%@AE@%%@EH@%%@NL@%
  9780. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9781.  
  9782.  
  9783. %@3@%%@AB@%Syntax%@CR:C6A00080338 @%%@CR:C6A00080339 @% %@CR:C6A00080340 @%%@AE@%%@EH@%%@NL@%
  9784.  
  9785. %@AS@%  q%@AE@%
  9786.  
  9787. This command terminates %@AB@%SYMDEB%@AE@% execution and returns control to DOS.  %@NL@%
  9788.  
  9789.  
  9790. %@2@%%@CR:C6A00080341 @%%@AB@%r ─ Register%@AE@%%@EH@%%@NL@%
  9791. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9792.  
  9793.  
  9794. %@3@%%@AB@%Syntax%@CR:C6A00080342 @%%@AE@%%@EH@%%@NL@%
  9795.  
  9796. %@AS@%  r «register« «= »value» »%@AE@%
  9797.  
  9798. This command displays the contents of CPU registers and allows the contents
  9799. to be changed to new values.%@CR:C6A00080343 @%%@CR:C6A00080344 @%%@NL@%
  9800.  
  9801. If no %@AI@%register%@AE@% is specified, the command displays all registers, all flags,
  9802. and the instruction at the address pointed to by the current CS and IP
  9803. register values. If %@AI@%register%@AE@% is specified, the command displays the current
  9804. value of the register and prompts for a new value. If both %@AI@%register%@AE@% and
  9805. %@AI@%value%@AE@% are specified, the command changes the register to the specified
  9806. value.  %@NL@%
  9807.  
  9808.  
  9809. %@2@%%@CR:C6A00080345 @%%@AB@%s ─ Search%@AE@%%@EH@%%@NL@%
  9810. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9811.  
  9812.  
  9813. %@3@%%@AB@%Syntax%@CR:C6A00080346 @%%@AE@%%@EH@%%@NL@%
  9814.  
  9815. %@AS@%  s range list%@AE@%
  9816.  
  9817. This command searches the given %@AI@%range%@AE@% of memory locations for the byte
  9818. values given in %@AI@%list%@AE@%. The command displays the address of each byte found.  %@NL@%
  9819.  
  9820.  
  9821. %@2@%%@CR:C6A00080347 @%%@AB@%Set Source Mode%@AE@%%@EH@%%@NL@%
  9822. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9823.  
  9824.  
  9825. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9826.  
  9827. %@AS@%  s-
  9828. %@AS@%  s&
  9829. %@AS@%  s+%@AE@%
  9830.  
  9831. These commands set the display mode for commands that display instruction
  9832. code.%@CR:C6A00080348 @%%@CR:C6A00080349 @%%@NL@%
  9833.  
  9834.  
  9835.   ■   If %@AB@%s-%@AE@% is given, %@AB@%SYMDEB%@AE@% disassembles and displays the instruction code
  9836.       in memory.%@NL@%
  9837.  
  9838.   ■   If %@AB@%s&%@AE@% is given, %@AB@%SYMDEB%@AE@% displays both the actual program source line
  9839.       and the disassembled code.%@NL@%
  9840.  
  9841.   ■   If %@AB@%s+%@AE@% is given, %@AB@%SYMDEB%@AE@% displays the actual program source line
  9842.       corresponding to the instruction to be displayed.%@CR:C6A00080350 @%%@CR:C6A00080351 @%%@CR:C6A00080352 @%%@NL@%
  9843.  
  9844.  
  9845. To access a source file for the first time, %@AB@%SYMDEB%@AE@% might display the
  9846. following prompt:  %@NL@%
  9847.  
  9848. %@AS@%  Source file name for mapname(cr for none)?%@AE@%
  9849.  
  9850. In such cases, type the name, including extension, of the source file
  9851. corresponding to the symbol file %@AI@%mapname%@AE@%.  %@NL@%
  9852.  
  9853.  
  9854. %@2@%%@CR:C6A00080353 @%%@AB@%t ─ Trace%@AE@%%@EH@%%@NL@%
  9855. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9856.  
  9857.  
  9858. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9859.  
  9860. %@AS@%  t «= startaddress» «value»%@AE@%
  9861.  
  9862. This command executes an instruction, then displays the current values of
  9863. all registers and flags. If %@AI@%startaddress%@AE@% is given, the command starts
  9864. execution at the given address. Otherwise, it starts execution at the
  9865. instruction pointed to by the current CS and IP registers. If %@AI@%value%@AE@% is
  9866. given, the command continues to execute %@AI@%value%@AE@% number of instructions before
  9867. stopping. In source-only %@AB@%(s+)%@AE@% mode, %@AB@%t%@AE@% operates directly on source lines. The
  9868. %@AB@%t%@AE@% command can be used to trace instructions in ROM.%@CR:C6A00080354 @%%@CR:C6A00080355 @%%@CR:C6A00080356 @%%@CR:C6A00080357 @%%@CR:C6A00080358 @%%@NL@%
  9869.  
  9870.  
  9871. %@2@%%@CR:C6A00080359 @%%@AB@%u ─ Unassemble%@AE@%%@EH@%%@NL@%
  9872. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9873.  
  9874.  
  9875. %@3@%%@AB@%Syntax%@CR:C6A00080360 @%%@AE@%%@EH@%%@NL@%
  9876.  
  9877. %@AS@%  u «range»%@AE@%
  9878.  
  9879. This command displays the instructions and/or statements of the program
  9880. being debugged. The %@AB@%s%@AE@% command sets the display format. If %@AI@%range%@AE@% is given,
  9881. the command displays instructions generated from code within the given
  9882. range. Otherwise, the command displays the instructions generated from the
  9883. first eight lines of code at the current address. The 80286 protected-mode
  9884. mnemonics cannot be displayed.%@CR:C6A00080361 @%%@NL@%
  9885.  
  9886.  
  9887. %@2@%%@CR:C6A00080362 @%%@AB@%v ─ View%@AE@%%@EH@%%@NL@%
  9888. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9889.  
  9890.  
  9891. %@3@%%@AB@%Syntax%@CR:C6A00080363 @%%@AE@%%@EH@%%@NL@%
  9892.  
  9893. %@AS@%  v range%@AE@%
  9894.  
  9895. This command displays source lines beginning at the specified range. The
  9896. symbol file must contain line-number information.  %@NL@%
  9897.  
  9898.  
  9899. %@2@%%@CR:C6A00080364 @%%@AB@%w ─ Write%@AE@%%@EH@%%@NL@%
  9900. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9901.  
  9902.  
  9903. %@3@%%@AB@%Syntax%@CR:C6A00080365 @%%@CR:C6A00080366 @%%@AE@%%@EH@%%@NL@%
  9904.  
  9905. %@AS@%  w «address «drive record count» »%@AE@%
  9906.  
  9907. This command writes the contents of a given memory location to a named file,
  9908. or to a given logical record on disk. To write to a file, set the filename
  9909. with an %@AB@%n%@AE@% command, and set the BX:CX register pair to the number of bytes to
  9910. be written. If no %@AI@%address%@AE@% is given, the command copies bytes starting from
  9911. the address CS:100, where CS is the current value of the CS register.  %@NL@%
  9912.  
  9913. To write to a logical record on disk, set %@AI@%drive%@AE@% to any number in the range
  9914. zero (drive A) to 2 (drive C), set %@AI@%record%@AE@% to the first logical record to
  9915. receive the data (a one- to four-digit hexadecimal number), and set %@AI@%count%@AE@% to
  9916. the number of records to write to the disk (a one- to four-digit hexadecimal
  9917. number). Do not write data to an absolute disk sector unless you are sure
  9918. the sector is free; otherwise, you may destroy data.  %@NL@%
  9919.  
  9920.  
  9921. %@2@%%@CR:C6A00080367 @%%@AB@%x ─ Examine Symbol Map%@AE@%%@EH@%%@NL@%
  9922. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9923.  
  9924.  
  9925. %@3@%%@AB@%Syntax%@CR:C6A00080368 @%%@AE@%%@EH@%%@NL@%
  9926.  
  9927. %@AS@%  x «* | ? symbol»%@AE@%
  9928.  
  9929. This command displays the name and load-segment addresses of the current
  9930. symbol map, segments in that map, and symbols within those segments.  %@NL@%
  9931.  
  9932. If no parameter is given, the command displays the current symbol map name
  9933. and the segments within that map. If the asterisk (*) is specified, the
  9934. command displays the names and load-segment addresses for all currently
  9935. loaded symbol maps. If %@AB@%?%@AE@% is specified, the command displays all symbols
  9936. within the given symbol map that match the %@AI@%symbol%@AE@% specification. A %@AI@%symbol%@AE@%
  9937. specification has the following form:%@CR:C6A00080369 @%%@CR:C6A00080370 @%%@CR:C6A00080371 @%%@CR:C6A00080372 @%%@NL@%
  9938.  
  9939. %@AS@%  «mapname!» «segmentname:]] «symbolname»%@AE@%
  9940.  
  9941. If %@AI@%mapname%@AE@%%@AB@%!%@AE@% is given, the command displays information for that symbol map.
  9942. The %@AI@%mapname %@AE@%parameter must specify the filename (without extension) of the
  9943. corresponding symbol file.  %@NL@%
  9944.  
  9945. If %@AI@%segmentname%@AE@%%@AB@%:%@AE@% is given, the command displays the name and load-segment
  9946. address for that segment. The %@AI@%segmentname%@AE@% parameter must specify the name of
  9947. a segment named within the specified or currently open symbol map.  %@NL@%
  9948.  
  9949. If %@AI@%symbolname%@AE@% is given, the command displays the segment address and segment
  9950. offset for that symbol. The %@AI@%symbolname%@AE@% parameter must specify the name of a
  9951. symbol in the given segment.  %@NL@%
  9952.  
  9953. To display information about more than one segment or symbol, enter a
  9954. partial segmentname or %@AI@%symbolname%@AE@% ending with an asterisk (*). The asterisk
  9955. acts as a wildcard character.%@CR:C6A00080373 @%%@CR:C6A00080374 @%%@CR:C6A00080375 @%%@NL@%
  9956.  
  9957.  
  9958. %@2@%%@CR:C6A00080376 @%%@AB@%xo ─ Open Symbol Map%@AE@%%@EH@%%@NL@%
  9959. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9960.  
  9961.  
  9962. %@3@%%@AB@%Syntax%@CR:C6A00080377 @%%@AE@%%@EH@%%@NL@%
  9963.  
  9964. %@AS@%  xo «symbol!»%@AE@%
  9965.  
  9966. This command sets the active symbol map and/or segment. If %@AI@%symbol%@AE@%%@AB@%!%@AE@% is given,
  9967. the command sets the active symbol map to the given map. The %@AI@%symbol%@AE@%
  9968. parameter must specify the filename (without extension) of one of the symbol
  9969. files specified in the %@AB@%SYMDEB%@AE@% command line.  A map file can be opened only
  9970. if it was loaded by providing its name in the %@AB@%SYMDEB%@AE@% command line.  %@NL@%
  9971.  
  9972.  
  9973. %@2@%%@CR:C6A00080378 @%%@AB@%z ─ Set Symbol Value%@AE@%%@EH@%%@NL@%
  9974. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9975.  
  9976.  
  9977. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9978.  
  9979. %@AS@%  z symbol value  %@AE@%
  9980.  
  9981. This command sets the address of %@AI@%symbol%@AE@% to %@AI@%value%@AE@%.  %@NL@%
  9982.  
  9983.  
  9984. %@2@%%@CR:C6A00080379 @%%@AB@%? ─ Display Help%@AE@%%@EH@%%@NL@%
  9985. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9986.  
  9987.  
  9988. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9989.  
  9990. %@AS@%  ?%@AE@%
  9991.  
  9992. This command displays a list of all %@AB@%SYMDEB%@AE@% commands and operators.%@CR:C6A00080380 @%%@NL@%
  9993.  
  9994.  
  9995. %@2@%%@CR:C6A00080381 @%%@AB@%? ─ Display Expression%@AE@%%@EH@%%@NL@%
  9996. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9997.  
  9998.  
  9999. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10000.  
  10001. %@AS@%  ? expression%@AE@%
  10002.  
  10003. This command displays the value of %@AI@%expression%@AE@%. The display includes a full
  10004. address, a 16-bit hexadecimal value, a full 32-bit hexadecimal value, a
  10005. decimal value (enclosed in parentheses), and a string value (enclosed in
  10006. double quotation marks). The %@AI@%expression%@AE@% parameter can specify any
  10007. combination of numbers, symbols, addresses, and operators.%@CR:C6A00080382 @%%@CR:C6A00080383 @%%@NL@%
  10008.  
  10009.  
  10010. %@2@%%@CR:C6A00080384 @%%@AB@%. ─ Source-Line Display%@AE@%%@EH@%%@NL@%
  10011. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10012.  
  10013.  
  10014. %@3@%%@AB@%Syntax%@CR:C6A00080385 @%%@AE@%%@EH@%%@NL@%
  10015.  
  10016. %@AS@%  .%@AE@%
  10017.  
  10018. This command displays the current source line.  %@NL@%
  10019.  
  10020.  
  10021. %@2@%%@CR:C6A00080386 @%%@AB@%Redirect Input%@AE@%%@EH@%%@NL@%
  10022. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10023.  
  10024.  
  10025. %@3@%%@AB@%Syntax%@CR:C6A00080387 @%%@CR:C6A00080388 @%%@CR:C6A00080389 @%%@AE@%%@EH@%%@NL@%
  10026.  
  10027. %@AS@%  <filename
  10028. %@AS@%  { filename%@AE@%
  10029.  
  10030. The %@AB@%%@AE@% command causes %@AB@%SYMDEB%@AE@% to read all subsequent command input from the
  10031. specified file. The %@AB@%{%@AE@% command reads all input for the debugged program from
  10032. the specified file.  %@NL@%
  10033.  
  10034.  
  10035. %@2@%%@CR:C6A00080390 @%%@AB@%Redirect Output%@AE@%%@EH@%%@NL@%
  10036. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10037.  
  10038.  
  10039. %@3@%%@AB@%Syntax%@CR:C6A00080391 @%%@AE@%%@EH@%%@NL@%
  10040.  
  10041. %@AS@%  >filename
  10042. %@AS@%  }filename%@AE@%
  10043.  
  10044. The %@AB@%>%@AE@% command causes %@AB@%SYMDEB%@AE@% to write all subsequent command output to the
  10045. specified file. The %@AB@%}%@AE@% command writes all output from the debugged program to
  10046. the specified file.  %@NL@%
  10047.  
  10048.  
  10049. %@2@%%@CR:C6A00080392 @%%@AB@%Redirect Input and Output%@AE@%%@EH@%%@NL@%
  10050. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10051.  
  10052.  
  10053. %@3@%%@AB@%Syntax%@CR:C6A00080393 @%%@CR:C6A00080394 @%%@AE@%%@EH@%%@NL@%
  10054.  
  10055. %@AS@%  = =filename
  10056. %@AS@%  ~ filename%@AE@%
  10057.  
  10058. The %@AB@%= = %@AE@%command causes %@AB@%SYMDEB%@AE@% to both read from and write to the device
  10059. specified in the filename. The %@AB@%~%@AE@% command causes the debugged program to both
  10060. read from and write to the given device.  %@NL@%
  10061.  
  10062.  
  10063. %@2@%%@CR:C6A00080395 @%%@AB@%! ─ Shell Escape%@AE@%%@EH@%%@NL@%
  10064. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10065.  
  10066.  
  10067. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10068.  
  10069. %@AS@%  ! «dos-command»%@AE@%
  10070.  
  10071. This command passes control to COMMAND.COM, the DOS command processor,
  10072. letting the user carry out DOS commands. The DOS EXIT command returns
  10073. control to %@AB@%SYMDEB%@AE@%. If %@AI@%dos-command%@AE@% is given, %@AB@%SYMDEB%@AE@% passes the command to
  10074. COMMAND.COM for execution, then receives control back as soon as the command
  10075. is completed.%@CR:C6A00080396 @%%@CR:C6A00080397 @%%@CR:C6A00080398 @%%@CR:C6A00080399 @%%@CR:C6A00080400 @%%@NL@%
  10076.  
  10077.  
  10078. %@2@%%@CR:C6A00080401 @%%@AB@%* ─ Comment%@AE@%%@EH@%%@NL@%
  10079. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10080.  
  10081.  
  10082. %@3@%%@AB@%Syntax%@CR:C6A00080402 @%%@AE@%%@EH@%%@NL@%
  10083.  
  10084. %@AS@%  *comment%@AE@%
  10085.  
  10086. This command echoes %@AI@%comment%@AE@% on the screen (or other output device).  %@NL@%
  10087.  
  10088.  
  10089.  
  10090.  
  10091.  
  10092.  
  10093. %@CR:C6A00090001 @%%@1@%%@AB@%Chapter 9  Advanced Debugging in Protected Mode: 80386 Debugger%@AE@%%@EH@%%@NL@%
  10094. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10095.  
  10096. Microsoft Windows 80386 Debugger (%@AB@%WDEB386%@AE@%) is used to test and debug Windows
  10097. applications and dynamic-link libraries (DLLs) running in standard or 386
  10098. enhanced mode, but not in real mode. It runs only on systems with an Intel
  10099. 80386 CPU. The debugger provides commands that allow the operator to inspect
  10100. and manipulate test code and environment status, install breakpoints, and
  10101. perform other debugging operations.  %@NL@%
  10102.  
  10103. %@AB@%WDEB386%@AE@% offers debugging features not available in CodeView for Windows
  10104. (%@AB@%CVW%@AE@%), but lacks the the convenient character-oriented window interface of
  10105. %@AB@%CVW%@AE@%.  %@NL@%
  10106.  
  10107. To use the debugger, a serial terminal must be connected to the system
  10108. running the debugger and test program. The terminal connection requirements
  10109. are described in Section 9.2, "Starting the Debugger."  %@NL@%
  10110.  
  10111. This chapter describes the following:  %@NL@%
  10112.  
  10113.  
  10114.   ■   Preparing symbol files%@NL@%
  10115.  
  10116.   ■   Starting the 80386 Debugger%@NL@%
  10117.  
  10118.   ■   How the 80386 Debugger traps a failed application%@NL@%
  10119.  
  10120.   ■   Debugger command format%@NL@%
  10121.  
  10122.   ■   Common %@AB@%WDEB386%@AE@% commands%@NL@%
  10123.  
  10124.   ■   %@AB@%WDEB386%@AE@% commands used with Windows in 386 enhanced mode%@NL@%
  10125.  
  10126.  
  10127.  
  10128. %@2@%%@CR:C6A00090002 @%%@AB@%9.1  Preparing Symbol Files for the 80386 Debugger%@AE@%%@EH@%%@NL@%
  10129.  
  10130. Application symbol files should be prepared for the debugger in the same way
  10131. as the files are prepared for the Symbolic Debugger (%@AB@%SYMDEB%@AE@%).  %@NL@%
  10132.  
  10133.  
  10134.   1.  Compile your C source files with the %@AB@%-Zd%@AE@% option.%@NL@%
  10135.  
  10136. %@STUB@%      This will prepare the object files for use by the 80386 Debugger.%@NL@%
  10137.  
  10138.   2.  Run %@AB@%LINK%@AE@% to link these object files.%@NL@%
  10139.  
  10140. %@STUB@%      %@AB@%WDEB386%@AE@% does not use line number information, so you need not use the
  10141.       %@AB@%/linenumbers%@AE@% option.%@NL@%
  10142.  
  10143.   3.  Run the %@AB@%MAPSYM%@AE@% program to create an application symbol file for the
  10144.       debugger.%@NL@%
  10145.  
  10146.  
  10147.  
  10148. %@2@%%@CR:C6A00090003 @%%@AB@%9.2  Starting the Debugger%@AE@%%@EH@%%@NL@%
  10149.  
  10150. The command line options are:  %@NL@%
  10151.  
  10152. %@AS@%  WDEB386 «/C: {1 | 2 | 3 | 4}» «/V«P»» «/S: symfilespec»... winfilespec
  10153. %@AS@%«parameters»%@AE@%
  10154.  
  10155. For example, the following typical commands are valid:  %@NL@%
  10156.  
  10157. %@AS@%  WDEB386 /V /S:\windows\system\krnl286.sym /S:myapp.sym \windows\win.com /s
  10158. %@AS@%myapp
  10159. %@AS@%  
  10160. %@AS@%  WDEB386 /C:1 /S:krnl386.sym /s:user.sym /S:\myapp\myapp.sym
  10161. %@AS@%\windows\win.com /3 myapp%@AE@%
  10162.  
  10163. Use the %@AB@%/C:%@AE@% option to specify a COM port for debugger output. If no COM port
  10164. option is specified, then the debugger checks first for COM2, and if not
  10165. found, then checks for COM1. If neither COM1 nor COM2 exists, the debugger
  10166. will look for any other COM port in the ROM data area (40:0). A three-wire
  10167. null modem cable is all that is needed for terminal connection (no DTR/CTS
  10168. handshaking is used).  %@NL@%
  10169.  
  10170. The %@AB@%/V%@AE@% and %@AB@%/VP%@AE@% options enable Verbose mode, which displays messages
  10171. indicating which segments are loading. %@AB@%/V%@AE@% displays the messages for both
  10172. Windows in 386 enhanced mode and for Windows applications; %@AB@%/VP%@AE@% displays the
  10173. messages for applications only.  %@NL@%
  10174.  
  10175. Use the %@AB@%/S:%@AE@% option to specify a symbol file to be loaded. These switches are
  10176. optional and can be repeated. If the symbol files are not in your current
  10177. directory, you must supply a full pathname for the symbol files. %@AB@%WDEB386%@AE@%
  10178. does not use the PATH environment variable to locate any of the files
  10179. supplied on the command line.  %@NL@%
  10180.  
  10181. When memory is low, you can use more symbol files by running the 80386
  10182. Debugger in the Windows directory and specifying the full pathname of
  10183. WIN386.EXE (such as \WINDOWS\SYSTEM\WIN386.EXE) instead of WIN.COM.  %@NL@%
  10184.  
  10185. A program specification is required, and any characters after the program
  10186. specification are passed to the program as parameters.  %@NL@%
  10187.  
  10188. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10189. NOTE
  10190.  
  10191. %@AI@%The 80386 Debugger does not display your source lines. %@AE@%
  10192. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10193.  
  10194.  
  10195. %@2@%%@CR:C6A00090004 @%%@AB@%9.3  When an Application Fails%@AE@%%@EH@%%@NL@%
  10196.  
  10197. If a Windows application running in standard or 386 enhanced mode attempts
  10198. to read or write memory using a bad selector, beyond a selector limit, or
  10199. with a selector set to 0, then a general protection (GP) fault occurs.  %@NL@%
  10200.  
  10201. Windows in 386 enhanced mode traps this fault and causes the debugger to
  10202. display something like the following:  %@NL@%
  10203.  
  10204. %@AS@%  GENERAL PROTECTION VIOLATION
  10205. %@AS@%  AX=xxxxxxxx BX=xxxxxxxx CX=xxxxxxxx DX=xxxxxxxx SI=xxxxxxxx DI=xxxxxxxx
  10206. %@AS@%  IP=00000FA0  SP=xxxxxxxx  BP=xxxxxxxx  CR2=xxxxxxxx  CR3=xxxx  IOPL=3  F=─
  10207. %@AS@%─
  10208. %@AS@%  CS=00AD SS=xxxx DS=xxxx ES=xxxx FS=xxxx GS=xxxx ─ NV UP EI PL ZR NA PE NC 
  10209. %@AS@%  00AD:00000FA0  MOV BX, WORD PTR ES:[BX]
  10210. %@AS@%
  10211. %@AS@%You can determine the cause of the fault by looking at the value and the
  10212. %@AS@%limit of the selector by dumping the LDT entry with the command:  %@NL@%
  10213. %@AS@%
  10214. %@AS@%%@AS@%  DL selector%@AE@%
  10215.  
  10216. The ability to continue execution depends on the cause of the fault. If the
  10217. fault was caused by reading or writing beyond the selector limit, then
  10218. sometimes it is possible to skip the instruction by incrementing the IP,
  10219. using:  %@NL@%
  10220.  
  10221. %@AS@%  R IP
  10222. %@AS@%  IP=xxxx
  10223. %@AS@%  :%@AE@%
  10224.  
  10225. You might have to disassemble the instruction with code bytes shown to
  10226. determine how many bytes it contains. To do this, use the following
  10227. commands:  %@NL@%
  10228.  
  10229. %@AS@%  Y CODEBYTES
  10230. %@AS@%  R%@AE@%
  10231.  
  10232. If the fault is caused by a critical logic error, such as trying to use a
  10233. selector for a temporary variable, then there probably is no way to continue
  10234. execution of the application. Rebooting the machine may be the only option.
  10235. %@NL@%
  10236.  
  10237.  
  10238. %@2@%%@CR:C6A00090005 @%%@AB@%9.4  Debugger Command Format%@AE@%%@EH@%%@NL@%
  10239.  
  10240. Each debugger command consists of one or two letters, usually followed by
  10241. one or more parameters. These commands and parameters are not
  10242. case-sensitive.  %@NL@%
  10243.  
  10244. If a syntax error occurs in a debugger command, the debugger redisplays the
  10245. command line and indicates the error with a caret (^) and the word "Error,"
  10246. as in the following example:  %@NL@%
  10247.  
  10248. %@AS@%  A100
  10249. %@AS@%   ^ Error%@AE@%
  10250.  
  10251.  
  10252. %@3@%%@CR:C6A00090006 @%%@AB@%9.4.1  Command Keys%@AE@%%@EH@%%@NL@%
  10253.  
  10254. The following is a list of command keys:  %@NL@%
  10255.  
  10256. %@TH:   5   292 02 12 64 @%
  10257. Key         Action
  10258. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10259. CONTROL+C   Halts debugger output and returns to the debugger prompt.
  10260. CONTROL+S   Freezes a 80386 Debugger display.
  10261. CONTROL+Q   Restarts the display.
  10262. %@TE:   5   292 02 12 64 @%
  10263.  
  10264. CONTROL+S and CONTROL+Q are ignored if the target system is executing code.
  10265. %@NL@%
  10266.  
  10267.  
  10268. %@3@%%@CR:C6A00090007 @%%@AB@%9.4.2  Command Parameters%@AE@%%@EH@%%@NL@%
  10269.  
  10270. You can separate 80386 Debugger command parameters with delimiters (spaces
  10271. or commas), but the only required delimiter is between two consecutive
  10272. hexadecimal values. The following commands are equivalent:  %@NL@%
  10273.  
  10274. %@AS@%  dCS:100 110
  10275. %@AS@%  d CS:100 110
  10276. %@AS@%  d,CS:100,110%@AE@%
  10277.  
  10278. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10279. NOTE 
  10280.  
  10281. %@AI@%Selector is the term used to indicate the value in a segment register while
  10282. %@AI@%in protected mode. Segment is the equivalent in real mode. Although the
  10283. %@AI@%following discussion uses selector, the discussion applies to segments as
  10284. %@AI@%well.%@AE@%
  10285. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10286.  
  10287. The following describes the parameters you can use with the 80386 Debugger
  10288. commands:  %@NL@%
  10289.  
  10290. %@TH: 105  6149 02 34 42 @%
  10291. Parameter                         Description
  10292. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10293. %@AI@%addr%@AE@%                              Represents an address parameter in one 
  10294.                                   of two forms. The first form contains 
  10295.                                   either an alphabetic selector register 
  10296.                                   or a four-digit selector address, and an
  10297.                                   offset value. The second form is a 
  10298.                                   physical address using the % operator. 
  10299.                                   You can omit the selector name or 
  10300.                                   selector address, in which case the 
  10301.                                   default selector is DS. This default 
  10302.                                   selector is used for all commands except
  10303.                                   %@AB@%g%@AE@%, %@AB@%p%@AE@%,%@AB@% t%@AE@%, and %@AB@%u%@AE@%. The default selector for
  10304.                                   these commands is CS. All numeric values
  10305.                                   are hexadecimal. Example addresses 
  10306.                                   include: 
  10307.  
  10308.                                   %@AS@%CS:0100%@AE@%
  10309.                                   %@AS@%04BA:0100%@AE@%
  10310.  
  10311.                                   A colon is required between the selector
  10312.                                   name (whether numeric or alphabetic) and
  10313.                                   the offset value. The selector portion 
  10314.                                   is treated as a selector or segment as 
  10315.                                   appropriate for the current processor 
  10316.                                   mode (protected or real) unless 
  10317.                                   specifically overridden by the # or & 
  10318.                                   operator.
  10319.  
  10320. %@AI@%byte%@AE@%                              Specifies a 2-digit hexadecimal value.
  10321.  
  10322. %@AI@%cmds%@AE@%                              Specifies an optional set of debugger 
  10323.                                   commands to be executed with the %@AB@%bp%@AE@% (Set
  10324.                                   Breakpoints) or %@AB@%j%@AE@% (Conditional Execute) 
  10325.                                   commands. 
  10326.  
  10327. %@AI@%dword%@AE@%                             Represents an 8-digit (4-byte) 
  10328.                                   hexadecimal value. A %@AB@%DWORD%@AE@% is most 
  10329.                                   commonly used as a physical address.
  10330.  
  10331. %@AI@%expr%@AE@%                              Represents a combination of parameters 
  10332.                                   and operators that evaluates to an 8, 16,
  10333.                                   or 32-bit value. An %@AI@%expr%@AE@% parameter can 
  10334.                                   be used as a value in any command. An %@AI@%%@AE@%
  10335.                                   %@AI@%expr%@AE@% parameter can combine any symbol, 
  10336.                                   number, or address with any of the 
  10337.                                   binary and unary operators. 
  10338.  
  10339. %@AI@%group-name%@AE@%                        Specifies the name of a group that 
  10340.                                   contains the map symbols you want to 
  10341.                                   display. 
  10342.  
  10343. %@AI@%list%@AE@%                              Specifies a series of byte values or a 
  10344.                                   string. The %@AI@%list%@AE@% parameter must be the 
  10345.                                   last parameter on the command line. 
  10346.                                   Following is an example of the %@AB@%f%@AE@% (Fill) 
  10347.                                   command using a %@AI@%list%@AE@% parameter: 
  10348.  
  10349.                                   %@AS@%fCS:100 42 45 52 54 41%@AE@%
  10350.  
  10351. %@AI@%map-name%@AE@%                          Specifies the name of a symbol map file.
  10352.  
  10353. %@AI@%range%@AE@%                             Contains two addresses (%@AI@%addr addr%@AE@%) or 
  10354.                                   one address, an %@AB@%L%@AE@%, and a value (%@AI@%addr %@AE@%%@AB@%L%@AE@%%@AI@% %@AE@%
  10355.                                   %@AI@%word%@AE@%, where %@AI@%word%@AE@% is the number of items 
  10356.                                   on which the command should operate; %@AB@%L %@AE@%
  10357.                                   80 is the default). Sample %@AI@%ranges%@AE@% 
  10358.                                   include: 
  10359.  
  10360.                                   %@AS@%CS:100 110%@AE@%
  10361.                                   %@AS@%CS:100 L 10%@AE@%
  10362.                                   %@AS@%CS:100%@AE@%
  10363.  
  10364.                                   The limit for %@AI@%range%@AE@% is 10000 
  10365.                                   (hexadecimal). To specify a word of 
  10366.                                   10000 using only four digits, use 0000 
  10367.                                   or 0. 
  10368.  
  10369. %@AI@%reg%@AE@%                               Specifies the name of a microprocessor 
  10370.                                   register.
  10371.  
  10372. %@AI@%string%@AE@%                            Represents any number of characters 
  10373.                                   enclosed in single (") or double ("") 
  10374.                                   quotation marks. If the quotation marks 
  10375.                                   must appear within a %@AI@%string%@AE@%, you must 
  10376.                                   use two sets of quotation marks. For 
  10377.                                   example, the following strings are 
  10378.                                   legal: 
  10379.  
  10380.                                   %@AS@%'This ''string'' is OK.' %@AE@%
  10381.                                   %@AS@%"This ""string"" is OK."%@AE@%
  10382.  
  10383.                                   However, the following strings are 
  10384.                                   illegal:
  10385.  
  10386.                                   %@AS@%"This "string" is not OK."%@AE@%
  10387.                                   %@AS@%"This 'string' is not OK."%@AE@%
  10388.  
  10389.                                   The ASCII values of the characters in 
  10390.                                   the string are used as a list of byte 
  10391.                                   values. 
  10392.  
  10393. %@AI@%word%@AE@%                              Specifies a 4-digit (2-byte) hexadecimal
  10394.                                   value.
  10395.  
  10396. %@TE: 105  6149 02 34 42 @%
  10397.  
  10398.  
  10399. %@3@%%@CR:C6A00090008 @%%@AB@%9.4.3  Binary and Unary Operators%@AE@%%@EH@%%@NL@%
  10400.  
  10401. The following list contains, in descending order of precedence, the binary
  10402. operators that can be used in 80386 Debugger commands.  %@NL@%
  10403.  
  10404. %@TH:  20   847 02 16 60 @%
  10405. Operator        Meaning
  10406. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10407. ( )             Parentheses
  10408. :               Address binder 
  10409. *               Multiplication 
  10410. /               Integer division 
  10411. MOD             Modulus (remainder) 
  10412. ++              Addition 
  10413. -               Subtraction 
  10414. >               Greater-than relational operator
  10415. <               Less-than relational operator 
  10416. >=              Greater-than/equal-to relational operator 
  10417. <=              Less-than/equal-to relational operator 
  10418. ==              Equal-to relational operator 
  10419. !=              Not-equal-to relational operator 
  10420. AND             Bitwise Boolean AND 
  10421. XOR             Bitwise Boolean exclusive OR 
  10422. OR              Bitwise Boolean OR 
  10423. &&              Logical AND 
  10424. |- |-||         Logical OR
  10425. %@TE:  20   847 02 16 60 @%
  10426.  
  10427. The following list contains, in descending order of precedence, the unary
  10428. operators that can be used in 80386 Debugger commands.  %@NL@%
  10429.  
  10430. %@TH:  34  1256 02 34 42 @%
  10431. Operator                          Meaning
  10432. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10433. &(seg)                            Interpret address using segment value
  10434.  
  10435. #(sel)                            Interpret address using selector value 
  10436.  
  10437. %%(phy)                           Interpret address as a physical value 
  10438.  
  10439. %(lin)                            Interpret address as a linear value 
  10440.  
  10441. -                                 Two's complement 
  10442.  
  10443. !                                 Logical NOT operator 
  10444.  
  10445. NOT                               One's complement 
  10446.  
  10447. SEG                               Segment address of operand 
  10448.  
  10449. OFF                               Address offset of operand 
  10450.  
  10451. BY                                Low-order byte from given address 
  10452.  
  10453. WO                                Low-order word from given address 
  10454.  
  10455. DW                                Doubleword from given address 
  10456.  
  10457. POI                               Pointer (4 bytes) from given 
  10458.                                   address─this operator only works with 
  10459.                                   16:16 addresses
  10460.  
  10461. PORT                              1 byte from given port 
  10462.  
  10463. WPORT                             Word from given port
  10464.  
  10465. %@TE:  34  1256 02 34 42 @%
  10466.  
  10467.  
  10468. %@2@%%@CR:C6A00090009 @%%@AB@%9.5  Common Command Directory%@AE@%%@EH@%%@NL@%
  10469.  
  10470. This section documents the commands available in all environments using the
  10471. 80386 Debugger. These commands are usually one or two alphabetical
  10472. characters, though some are characters preceded by a period (called "dot"
  10473. commands).  %@NL@%
  10474.  
  10475. This section consists of a listing of commands and brief descriptions
  10476. followed by detailed descriptions of the commands, including syntax,
  10477. purpose, input parameters and examples.  %@NL@%
  10478.  
  10479. %@TH:  57  2725 02 16 60 @%
  10480. Command         Description
  10481. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10482. %@AB@%?%@AE@%               Display expression
  10483. %@AB@%?%@AE@%               Display help
  10484. %@AB@%.?%@AE@%              Display external commands
  10485. %@AB@%.b%@AE@%              Set COM port baud rate
  10486. %@AB@%.df%@AE@%             Display global free list
  10487. %@AB@%.dg%@AE@%             Display global heap
  10488. %@AB@%.dh%@AE@%             Display local heap
  10489. %@AB@%.dm%@AE@%             Display global module list
  10490. %@AB@%.dq%@AE@%             Dump task queue
  10491. %@AB@%.du%@AE@%             Display global LRU list
  10492. %@AB@%.reboot%@AE@%         Reboot target system
  10493. %@AB@%bc%@AE@%              Clear breakpoints
  10494. %@AB@%bd%@AE@%              Disable breakpoints
  10495. %@AB@%be%@AE@%              Enable breakpoints
  10496. %@AB@%bl%@AE@%              List breakpoints
  10497. %@AB@%bp%@AE@%              Set breakpoints
  10498. %@AB@%c%@AE@%               Compare memory 
  10499. %@AB@%d%@AE@%               Display memory
  10500. %@AB@%db%@AE@%              Display bytes
  10501. %@AB@%dd%@AE@%              Display doublewords
  10502. %@AB@%dg%@AE@%              Display GDT
  10503. %@AB@%di%@AE@%              Display IDT
  10504. %@AB@%dl%@AE@%              Display LDT
  10505. %@AB@%dt%@AE@%              Display TSS
  10506. %@AB@%dw%@AE@%              Display words
  10507. %@AB@%e%@AE@%               Enter byte
  10508. %@AB@%f%@AE@%               Fill memory
  10509. %@AB@%g%@AE@%               Go
  10510. %@AB@%h%@AE@%               Hexadecimal arithmetic
  10511. %@AB@%i%@AE@%               Input byte
  10512. %@AB@%j%@AE@%               Conditional execute
  10513. %@AB@%k%@AE@%               Backtrace stack
  10514. %@AB@%ka%@AE@%              Set backtrace arguments
  10515. %@AB@%kt%@AE@%              Backtrace task stack
  10516. %@AB@%kv%@AE@%              Verbose backtrace stack
  10517. %@AB@%la%@AE@%              List absolute symbols
  10518. %@AB@%lg%@AE@%              List groups
  10519. %@AB@%lm%@AE@%              List map
  10520. %@AB@%ln%@AE@%              List near
  10521. %@AB@%ls%@AE@%              List symbols
  10522. %@AB@%m%@AE@%               Move memory
  10523. %@AB@%o%@AE@%               Output to port
  10524. %@AB@%p%@AE@%               Program trace
  10525. %@AB@%r%@AE@%               Display registers
  10526. %@AB@%s%@AE@%               Search bytes
  10527. %@AB@%t%@AE@%               Trace instructions
  10528. %@AB@%u%@AE@%               Unassemble bytes
  10529. %@AB@%v%@AE@%               Set interrupt vector trapping
  10530. %@AB@%vl%@AE@%              Display interrupt trapping information
  10531. %@AB@%w%@AE@%               Change map
  10532. %@AB@%y%@AE@%               Debugger configuration options
  10533. %@AB@%z%@AE@%               Zap embedded INT 1 and INT 3 instructions
  10534. %@AB@%zd%@AE@%              Execute default command string
  10535. %@AB@%zl%@AE@%              Display default command string
  10536. %@AB@%zs%@AE@%              Change default command string
  10537. %@TE:  57  2725 02 16 60 @%
  10538.  
  10539.  
  10540.  
  10541.  
  10542.  
  10543. %@2@%%@CR:C6A00090010 @%%@AB@%? ─ Display Expression%@AE@%%@EH@%%@NL@%
  10544. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10545.  
  10546.  
  10547. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10548.  
  10549. %@AS@%  ? expr | "string"%@AE@%
  10550.  
  10551. The %@AB@%?%@AE@% command displays the value of a specified expression or string. An
  10552. expression is first evaluated and then displayed in hexadecimal, decimal,
  10553. octal, and binary format. The debugger also displays an ASCII character
  10554. representation of the evaluated expression, a physical address
  10555. interpretation, and whether the expression is TRUE or FALSE.  %@NL@%
  10556.  
  10557. Strings enclosed in quotation marks are echoed to the screen.  %@NL@%
  10558.  
  10559. The expression evaluator provides support for three types of addresses: real
  10560. mode (%selector:offset), protected mode (#selector:offset), and physical
  10561. address (%@AB@%DWORD)%@AE@%. The %@AB@%&%@AE@%, %@AB@%#%@AE@%, and %@AB@%%%@AE@% characters override the current address
  10562. type, allowing selectors to be used in real mode, segments to be used in
  10563. protected mode, and so on. The %@AB@%%%@AE@% character converts other addresses to
  10564. physical addresses.  %@NL@%
  10565.  
  10566. %@TH:  53  2269 02 11 32 33 @%
  10567. Parameter  Description
  10568. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10569. %@AI@%expr%@AE@%       Specifies any combination of 
  10570.            numbers, addresses, and 
  10571.            operators. If %@AI@%expr%@AE@% is not 
  10572.            specified, this command will 
  10573.            print help messages. The 
  10574.            following key words can be 
  10575.            used with the expression:
  10576.  
  10577.            Key Word                        Description
  10578.  
  10579.            %@AI@%reg%@AE@%                             Returns the value of %@AI@%reg%@AE@%, where
  10580.                                            %@AI@%reg%@AE@% is one of the following 
  10581.                                            registers: AX, BX, CX, DX, SI, 
  10582.                                            DI, BP, DS, ES, SS, CS, SP, or 
  10583.                                            IP
  10584.  
  10585.            FLG                             Returns the value of the flags
  10586.  
  10587.            GDTB                            Returns the value of the GDT 
  10588.                                            base as a physical address
  10589.  
  10590.            GDTL                            Returns the value of the GDT 
  10591.                                            limit
  10592.  
  10593.            IDTB                            Returns the value of the IDT 
  10594.                                            base as a physical address
  10595.  
  10596.            IDTL                            Returns the value of the IDT 
  10597.                                            limit
  10598.  
  10599.            TR                              Returns the value of the TR 
  10600.                                            register
  10601.  
  10602.            LDTR                            Returns the value of the LDTR 
  10603.                                            register
  10604.  
  10605.            MSW                             Returns the value of the MSW 
  10606.                                            register
  10607.  
  10608.            The @ character can be used 
  10609.            with any of the register names
  10610.            to ensure that the expression 
  10611.            evaluator interprets the name 
  10612.            as a register instead of a 
  10613.            symbol (for example, @AX is 
  10614.            the same as AX).
  10615.  
  10616. %@AI@%string%@AE@%     Specifies a sequence of 
  10617.            characters enclosed in single 
  10618.            or double quotation marks.
  10619.  
  10620. %@TE:  53  2269 02 11 32 33 @%
  10621.  
  10622.  
  10623. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10624.  
  10625. %@AS@%  ?%(#001F:0220) %@AE@%
  10626.  
  10627. This example looks up selector 1F's physical address in the current LDT and
  10628. adds 220 to it.  %@NL@%
  10629.  
  10630. %@AS@%  ? ds:si+bx%@AE@%
  10631.  
  10632. This example displays the value of the expression DS:SI + BX. The debugger
  10633. returns a display similar to the following:  %@NL@%
  10634.  
  10635. %@AS@%  2038:4278 540557944T 40160411700Q 0100001001111000Y 'X' %0245F8 TRUE%@AE@%
  10636.  
  10637. %@AS@%  ? 3*4%@AE@%
  10638.  
  10639. This example displays the value of the arithmetic expression 3*4. The
  10640. debugger returns the following display:  %@NL@%
  10641.  
  10642. %@AS@%  0CH 12T 14Q 00001100Y '.' %00000C TRUE%@AE@%
  10643.  
  10644. %@AS@%  bp1 100 "r;d 200;? 'BP 1 REACHED'"%@AE@%
  10645.  
  10646. This example is used in a %@AB@%bp%@AE@% (Set Breakpoint) command to announce a
  10647. breakpoint number.  %@NL@%
  10648.  
  10649.  
  10650. %@2@%%@CR:C6A00090011 @%%@AB@%? ─ Display Help Menu%@AE@%%@EH@%%@NL@%
  10651. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10652.  
  10653.  
  10654. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10655.  
  10656. %@AS@%  ?%@AE@%
  10657.  
  10658. The %@AB@%?%@AE@% command displays a list of commands and syntax recognized by the
  10659. debugger.  %@NL@%
  10660.  
  10661.  
  10662. %@2@%%@CR:C6A00090012 @%%@AB@%.? ─ Display External Commands%@AE@%%@EH@%%@NL@%
  10663. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10664.  
  10665.  
  10666. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10667.  
  10668. %@AS@%  .?%@AE@%
  10669.  
  10670. The %@AB@%.?%@AE@% command displays a list of external commands. These commands are part
  10671. of the debugger, but are specific to the environment in which the debugger
  10672. is running.  %@NL@%
  10673.  
  10674.  
  10675. %@2@%%@CR:C6A00090013 @%%@AB@%.b ─ Set COM Port Baud Rate%@AE@%%@EH@%%@NL@%
  10676. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10677.  
  10678.  
  10679. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10680.  
  10681. %@AS@%  .b baud-rate «port-addr»%@AE@%
  10682.  
  10683. The %@AB@%.b%@AE@% command sets the baud rate for the debugging port (COM2).  %@NL@%
  10684.  
  10685. %@TH:  17  1090 02 34 42 @%
  10686. Parameter                         Description
  10687. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10688. %@AI@%baud-rate%@AE@%                         Specifies one of the following values: 
  10689.                                   150, 300, 600, 1200, 2400, 4800, 9600, 
  10690.                                   or 19200. Since the default radix for 
  10691.                                   the debugger is 16, you must include a 
  10692.                                   "t" after the number to indicate decimal
  10693.                                   values. 
  10694.  
  10695. %@AI@%port-addr%@AE@%                         Can be 1 for COM1, 2 for COM2; anything 
  10696.                                   else is taken as a base port address. 
  10697.                                   During initialization, if there is no 
  10698.                                   COM2, the debugger checks for COM1 and 
  10699.                                   then any other COM port address in the 
  10700.                                   ROM data area, and uses it as the 
  10701.                                   console. 
  10702.  
  10703. %@TE:  17  1090 02 34 42 @%
  10704.  
  10705.  
  10706. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10707.  
  10708. %@AS@%  #.b 1200t%@AE@%
  10709.  
  10710. This example sets the baud rate to 1200.  %@NL@%
  10711.  
  10712.  
  10713. %@2@%%@CR:C6A00090014 @%%@AB@%.df ─ Display Global Free List%@AE@%%@EH@%%@NL@%
  10714. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10715.  
  10716.  
  10717. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10718.  
  10719. %@AS@%  .df%@AE@%
  10720.  
  10721. The %@AB@%.df%@AE@% command displays a list of the free global memory objects in the
  10722. global heap. The list has the following form:%@CR:C6A00090015 @%%@CR:C6A00090016 @%%@NL@%
  10723.  
  10724. %@AS@%  address: size owner «chain»%@AE@%
  10725.  
  10726. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  10727. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  10728. %@NL@%
  10729.  
  10730. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  10731. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  10732. the size of the object in bytes.  %@NL@%
  10733.  
  10734. The %@AI@%owner%@AE@% field always specifies that the module is free.  %@NL@%
  10735.  
  10736. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.
  10737. %@AB@%WDEB386%@AE@% displays the addresses only if the segment is moveable and
  10738. discardable.  %@NL@%
  10739.  
  10740.  
  10741. %@2@%%@CR:C6A00090017 @%%@AB@%.dg ─ Display Global Heap%@AE@%%@EH@%%@NL@%
  10742. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10743.  
  10744.  
  10745. %@3@%%@AB@%Syntax%@CR:C6A00090018 @%%@AE@%%@EH@%%@NL@%
  10746.  
  10747. %@AS@%  .dg «object»%@AE@%
  10748.  
  10749. The %@AB@%.dg%@AE@% command displays a list of the global memory objects in the global
  10750. heap.  %@NL@%
  10751.  
  10752. %@TH:   7   463 02 34 42 @%
  10753. Parameter                         Description
  10754. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10755. %@AI@%object%@AE@%                            Specifies the first object to be listed.
  10756.                                   The %@AI@%object%@AE@% parameter can be a handle, 
  10757.                                   selector, or (in 386 enhanced mode) a 
  10758.                                   heap address.
  10759.  
  10760. %@TE:   7   463 02 34 42 @%
  10761.  
  10762. The list has the following form:%@CR:C6A00090019 @%%@NL@%
  10763.  
  10764. %@AS@%  address: size segment-type owner «handle flags chain»%@AE@%
  10765.  
  10766. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  10767. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  10768. %@NL@%
  10769.  
  10770. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  10771. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  10772. the size of the object in bytes.  %@NL@%
  10773.  
  10774. The %@AI@%segment-type%@AE@% field specifies the type of object. The type can be any one
  10775. of the following:  %@NL@%
  10776.  
  10777. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  10778. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10779. %@AB@%CODE%@AE@%                              Segment contains program code.
  10780.  
  10781. %@AB@%DATA%@AE@%                              Segment contains program data and 
  10782.                                   possible stack and local heap data.
  10783.  
  10784. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  10785.                                   objects ready for allocation by an 
  10786.                                   application.
  10787.  
  10788. %@AB@%PRIV%@AE@%                              Segment contains private data.
  10789.  
  10790. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  10791.                                   the global heap.
  10792.  
  10793. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  10794. allocated the memory object. The name "pdb" is used for memory objects that
  10795. represent program descriptor blocks. These blocks contain execution
  10796. information about applications.%@CR:C6A00090020 @%%@NL@%
  10797.  
  10798. The %@AI@%handle%@AE@% field specifies the handle of the global memory object. If
  10799. %@AB@%WDEB386%@AE@% displays no handle, the segment is fixed.  %@NL@%
  10800.  
  10801. The %@AI@%flags%@AE@% field specifies the following:  %@NL@%
  10802.  
  10803. %@AB@%Flag%@AE@%                              %@AB@%Meaning%@AE@%
  10804. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10805. D                                 The segment is moveable and discardable.
  10806.  
  10807. L                                 The segment is locked. If the segment is
  10808.                                   locked, the lock count appears to the 
  10809.                                   right of the flag.
  10810.  
  10811. If %@AB@%WDEB386%@AE@% displays a handle, but no flag, the segment is moveable but
  10812. nondiscardable.  %@NL@%
  10813.  
  10814. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.
  10815. %@AB@%WDEB386%@AE@% displays the addresses only if the segment is moveable and
  10816. discardable (the D flag).  %@NL@%
  10817.  
  10818.  
  10819. %@2@%%@CR:C6A00090021 @%%@AB@%.dh ─ Display Local Heap%@AE@%%@EH@%%@NL@%
  10820. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10821.  
  10822.  
  10823. %@3@%%@AB@%Syntax%@CR:C6A00090022 @%%@AE@%%@EH@%%@NL@%
  10824.  
  10825. %@AS@%  .dh%@AE@%
  10826.  
  10827. The %@AB@%.dh%@AE@% command displays a list of the local memory objects in the local
  10828. heap (if any) belonging to the current data segment. The command uses the
  10829. current value of the DS register to locate the data segment and check for a
  10830. local heap. The list of memory objects has the following form:%@CR:C6A00090023 @%%@NL@%
  10831.  
  10832. %@AS@%  offset: size { BUSY | FREE }%@AE@%
  10833.  
  10834. The %@AI@%offset%@AE@% field specifies the address offset from the beginning of the data
  10835. segment to the local memory object.  %@NL@%
  10836.  
  10837. The %@AI@%size%@AE@% field specifies the size of the object in bytes.  %@NL@%
  10838.  
  10839. If %@AB@%BUSY%@AE@% is given, the object has been allocated and is currently in use. If
  10840. %@AB@%FREE%@AE@% is given, the object is in the pool of free objects ready to be
  10841. allocated by the application. A special memory object, %@AB@%SENTINAL%@AE@%, may also be
  10842. displayed.  %@NL@%
  10843.  
  10844.  
  10845. %@2@%%@CR:C6A00090024 @%%@AB@%.dm ─ Display Global Module List%@AE@%%@EH@%%@NL@%
  10846. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10847.  
  10848.  
  10849. %@3@%%@AB@%Syntax%@CR:C6A00090025 @%%@AE@%%@EH@%%@NL@%
  10850.  
  10851. %@AS@%  .dm%@AE@%
  10852.  
  10853. The %@AB@%.dm%@AE@% command displays a list of the global modules in the global heap.
  10854. The list has the following form:%@CR:C6A00090026 @%%@NL@%
  10855.  
  10856. %@AS@%  module-handle module-type module-name file-name%@AE@%
  10857.  
  10858. The %@AI@%module-handle%@AE@% field specifies the handle of the module. The %@AI@%module-type%@AE@%
  10859. field specifies either a dynamic-link library (DLL) or the name of the
  10860. application you are debugging. The %@AI@%module-name%@AE@% field specifies the name of
  10861. the module. The %@AI@%file-name%@AE@% field specifies the name of the file from which
  10862. you loaded the application.  %@NL@%
  10863.  
  10864.  
  10865. %@2@%%@CR:C6A00090027 @%%@AB@%.dq ─ Dump Task Queue%@AE@%%@EH@%%@NL@%
  10866. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10867.  
  10868.  
  10869. %@3@%%@AB@%Syntax%@CR:C6A00090028 @%%@CR:C6A00090029 @%%@AE@%%@EH@%%@NL@%
  10870.  
  10871. %@AS@%  .dq%@AE@%
  10872.  
  10873. The %@AB@%.dq%@AE@% command displays a list containing information about the various
  10874. task queues supported by the system. The list has the following form:  %@NL@%
  10875.  
  10876. %@AS@%  task-descriptor-block  stack-segment:stack-pointer number-of-events
  10877. %@AS@%priority internal-messaging-information module%@AE@%
  10878.  
  10879. The %@AI@%task-descriptor-block%@AE@% field specifies the selector or segment address.
  10880. The task descriptor block is identical to the "pdb."%@CR:C6A00090030 @%%@CR:C6A00090031 @%The
  10881. %@AI@%stack-segment:stack-pointer%@AE@% field specifies the stack segment and pointer.
  10882. The %@AI@%number-of-events%@AE@% field specifies the number of events waiting for the
  10883. segment. The %@AI@%priority%@AE@% field specifies the priority of the segment. The
  10884. %@AI@%internal-messaging-information%@AE@% field specifies information about internal
  10885. messages. The %@AI@%module%@AE@% field specifies the module name.  %@NL@%
  10886.  
  10887.  
  10888. %@2@%%@CR:C6A00090032 @%%@AB@%.du ─ Display Global LRU List%@AE@%%@EH@%%@NL@%
  10889. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10890.  
  10891.  
  10892. %@3@%%@AB@%Syntax%@CR:C6A00090033 @%%@CR:C6A00090034 @%%@AE@%%@EH@%%@NL@%
  10893.  
  10894. %@AS@%  .du%@AE@%
  10895.  
  10896. The %@AB@%.du%@AE@% command displays a list of the least-recently-used (LRU) global
  10897. memory objects in the global heap. The list has the following form:  %@NL@%
  10898.  
  10899. %@AS@%  address: size segment-type owner «handle flags chain»%@AE@%
  10900.  
  10901. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  10902. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  10903. %@NL@%
  10904.  
  10905. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  10906. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  10907. the size of the object in bytes.  %@NL@%
  10908.  
  10909. The %@AI@%segment-type%@AE@% field specifies the type of object. The type can be any one
  10910. of the following:  %@NL@%
  10911.  
  10912. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  10913. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10914. %@AB@%CODE%@AE@%                              Segment contains program code.
  10915.  
  10916. %@AB@%DATA%@AE@%                              Segment contains program data and 
  10917.                                   possible stack and local heap data.
  10918.  
  10919. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  10920.                                   objects ready for allocation by an 
  10921.                                   application.
  10922.  
  10923. %@AB@%PRIV%@AE@%                              Segment contains private data.
  10924.  
  10925. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  10926.                                   the global heap.
  10927.  
  10928. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  10929. allocated the memory object. The name "pdb" is used for memory objects that
  10930. represent program descriptor blocks. These blocks contain execution
  10931. information about applications.%@CR:C6A00090035 @%%@NL@%
  10932.  
  10933. The %@AI@%handle%@AE@% field specifies the handle of the global memory object.  %@NL@%
  10934.  
  10935. The %@AI@%flags%@AE@% field specifies D, which means the segment is moveable and
  10936. discardable.  %@NL@%
  10937.  
  10938. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.  %@NL@%
  10939.  
  10940.  
  10941. %@2@%%@CR:C6A00090036 @%%@AB@%.reboot ─ Reboot Target System%@AE@%%@EH@%%@NL@%
  10942. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10943.  
  10944.  
  10945. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10946.  
  10947. %@AS@%  .reboot%@AE@%
  10948.  
  10949. The %@AB@%.reboot%@AE@% command causes the target system to reboot.  %@NL@%
  10950.  
  10951.  
  10952. %@2@%%@CR:C6A00090037 @%%@AB@%bc ─ Clear Breakpoints%@AE@%%@EH@%%@NL@%
  10953. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10954.  
  10955.  
  10956. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10957.  
  10958. %@AS@%  bc {list | *}%@AE@%
  10959.  
  10960. The %@AB@%bc%@AE@% command removes one or more defined breakpoints.  %@NL@%
  10961.  
  10962. %@TH:   9   534 02 34 42 @%
  10963. Parameter                         Description
  10964. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10965. %@AI@%list%@AE@%                              Specifies any combination of integer 
  10966.                                   values in the range 0-9. If you specify %@AI@%%@AE@%
  10967.                                   %@AI@%list%@AE@%, the debugger removes the specified
  10968.                                   breakpoints.
  10969.  
  10970. *                                 Clears all breakpoints.
  10971.  
  10972. %@TE:   9   534 02 34 42 @%
  10973.  
  10974.  
  10975. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10976.  
  10977. %@AS@%  bc 0 4 8%@AE@%
  10978.  
  10979. Removes breakpoints 0, 4, and 8.  %@NL@%
  10980.  
  10981. %@AS@%  bc *%@AE@%
  10982.  
  10983. Removes all breakpoints.  %@NL@%
  10984.  
  10985.  
  10986. %@2@%%@CR:C6A00090038 @%%@AB@%bd ─ Disable Breakpoints%@AE@%%@EH@%%@NL@%
  10987. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10988.  
  10989.  
  10990. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10991.  
  10992. %@AS@%  bd {list | *}%@AE@%
  10993.  
  10994. The %@AB@%bd%@AE@% command temporarily disables one or more breakpoints. To restore
  10995. breakpoints disabled by the %@AB@%bd%@AE@% command, use the %@AB@%be%@AE@% (Enable Breakpoints)
  10996. command.  %@NL@%
  10997.  
  10998. %@TH:   9   538 02 34 42 @%
  10999. Parameter                         Description
  11000. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11001. %@AI@%list%@AE@%                              Specifies any combination of integer 
  11002.                                   values in the range 0-9. If you specify %@AI@%%@AE@%
  11003.                                   %@AI@%list%@AE@%, the debugger disables the 
  11004.                                   specified breakpoints.
  11005.  
  11006. *                                 Disables all breakpoints.
  11007.  
  11008. %@TE:   9   538 02 34 42 @%
  11009.  
  11010.  
  11011. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11012.  
  11013. %@AS@%  bd 0 4 8%@AE@%
  11014.  
  11015. Disables breakpoints 0, 4, and 8.  %@NL@%
  11016.  
  11017. %@AS@%  bd *%@AE@%
  11018.  
  11019. Disables all breakpoints.  %@NL@%
  11020.  
  11021.  
  11022. %@2@%%@CR:C6A00090039 @%%@AB@%be ─ Enable Breakpoints%@AE@%%@EH@%%@NL@%
  11023. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11024.  
  11025.  
  11026. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11027.  
  11028. %@AS@%  be {list | *}%@AE@%
  11029.  
  11030. The %@AB@%be%@AE@% command restores (enables) one or more breakpoints that have been
  11031. temporarily disabled by a %@AB@%bd%@AE@% (Disable Breakpoints) command.  %@NL@%
  11032.  
  11033. %@TH:   9   536 02 34 42 @%
  11034. Parameter                         Description
  11035. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11036. %@AI@%list%@AE@%                              Specifies any combination of integer 
  11037.                                   values in the range 0-9. If you specify %@AI@%%@AE@%
  11038.                                   %@AI@%list%@AE@%, the debugger enables the specified
  11039.                                   breakpoints. 
  11040.  
  11041. *                                 Enables all breakpoints.
  11042.  
  11043. %@TE:   9   536 02 34 42 @%
  11044.  
  11045.  
  11046. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11047.  
  11048. %@AS@%  be 0 4 8%@AE@%
  11049.  
  11050. Enables breakpoints 0, 4, and 8.  %@NL@%
  11051.  
  11052. %@AS@%  be *%@AE@%
  11053.  
  11054. Enables all breakpoints.  %@NL@%
  11055.  
  11056.  
  11057. %@2@%%@CR:C6A00090040 @%%@AB@%bl ─ List Breakpoints%@AE@%%@EH@%%@NL@%
  11058. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11059.  
  11060.  
  11061. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11062.  
  11063. %@AS@%  bl%@AE@%
  11064.  
  11065. The %@AB@%bl%@AE@% command lists current information about all breakpoints created by
  11066. the%@AB@% bp %@AE@%(Set Breakpoints) command.  %@NL@%
  11067.  
  11068.  
  11069. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11070.  
  11071. If no breakpoints are currently defined, the debugger displays nothing.
  11072. Otherwise, the breakpoint number, enabled status, breakpoint address, number
  11073. of passes remaining, initial number of passes (in parentheses), and any
  11074. optional debugger commands to be executed when the breakpoint is reached are
  11075. displayed on the screen, as in the following example:  %@NL@%
  11076.  
  11077. %@AS@%  0 e 04BA:0100
  11078. %@AS@%  4 d 04BA:0503 4 (10)
  11079. %@AS@%  8 e 0D2D:0001 3 (3) "R;DB DS:SI"
  11080. %@AS@%  9 e xxxx:0012%@AE@%
  11081.  
  11082. In this example, breakpoints 0 and 8 are enabled (e), while 4 is disabled
  11083. (d). Breakpoint 4 had an initial pass count of 10 and has 4 remaining passes
  11084. to be taken before the breakpoint. Breakpoint 8 had an initial pass count of
  11085. 3 and must make all 3 passes before it halts execution and forces the
  11086. debugger to execute the optional debugger commands enclosed in quotation
  11087. marks. Breakpoint 0 shows no initial pass count, which means it was set to
  11088. 1.  %@NL@%
  11089.  
  11090. Breakpoint 9 shows a virtual breakpoint (a breakpoint set in a segment that
  11091. has not been loaded into memory).  %@NL@%
  11092.  
  11093.  
  11094. %@2@%%@CR:C6A00090041 @%%@AB@%bp ─ Set Breakpoints%@AE@%%@EH@%%@NL@%
  11095. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11096.  
  11097.  
  11098. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11099.  
  11100. %@AS@%  bp«n» addr «passcnt» «"cmds"»%@AE@%
  11101.  
  11102. The %@AB@%bp%@AE@% command creates a software breakpoint at an address. During program
  11103. execution, software breakpoints stop program execution and force the
  11104. debugger to execute the default or optional command string. Unlike
  11105. breakpoints created by the %@AB@%g%@AE@% (Go) command, software breakpoints remain in
  11106. memory until you remove them with the %@AB@%bc %@AE@%(Clear Breakpoints) command or
  11107. temporarily disable them with the%@AB@% bd%@AE@% (Disable Breakpoints) command.  %@NL@%
  11108.  
  11109. The debugger allows up to 10 software breakpoints (0-9). If you specify more
  11110. than 10 breakpoints, the debugger returns a "Too Many Breakpoints" message.
  11111. The %@AI@%addr%@AE@% parameter is required for all new breakpoints.  %@NL@%
  11112.  
  11113. %@TH:  23  1428 02 34 42 @%
  11114. Parameter                         Description
  11115. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11116. %@AI@%n%@AE@%                                 Specifies which breakpoint is being 
  11117.                                   created. No space is allowed between the
  11118.                                   %@AB@%bp%@AE@% and %@AI@%n%@AE@%. If %@AI@%n%@AE@% is omitted, the first 
  11119.                                   available breakpoint number is used. 
  11120.  
  11121. %@AI@%addr%@AE@%                              Specifies any valid instruction address 
  11122.                                   (the first byte of an instruction 
  11123.                                   opcode).
  11124.  
  11125. %@AI@%passcnt%@AE@%                           Specifies the number of times the 
  11126.                                   breakpoint is to be ignored before being
  11127.                                   executed. It can be any 16-bit value.
  11128.  
  11129. %@AI@%cmds%@AE@%                              Specifies an optional list of debugger 
  11130.                                   commands to be executed in place of the 
  11131.                                   default command when the breakpoint is 
  11132.                                   reached. You must enclose optional 
  11133.                                   commands in quotation marks, and 
  11134.                                   separate optional commands with 
  11135.                                   semicolons (;).
  11136.  
  11137. %@TE:  23  1428 02 34 42 @%
  11138.  
  11139.  
  11140. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11141.  
  11142. %@AS@%  bp 123%@AE@%
  11143.  
  11144. The first example creates a breakpoint at address CS:123.  %@NL@%
  11145.  
  11146. %@AS@%  bp8 400:23 "db DS:SI"%@AE@%
  11147.  
  11148. This example creates breakpoint 8 at address 400:23 and executes a %@AB@%db%@AE@%
  11149. (Display Bytes) command.  %@NL@%
  11150.  
  11151. %@AS@%  bp 100 10 "r;c100 L 100 300"%@AE@%
  11152.  
  11153. This example creates a breakpoint at address 100 in the current CS selector
  11154. and displays the registers before comparing a block of memory. The
  11155. breakpoint is ignored 16 (10H) times before being executed.  %@NL@%
  11156.  
  11157.  
  11158. %@2@%%@CR:C6A00090042 @%%@AB@%c ─ Compare Memory%@AE@%%@EH@%%@NL@%
  11159. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11160.  
  11161.  
  11162. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11163.  
  11164. %@AS@%  c range addr%@AE@%
  11165.  
  11166. The %@AB@%c%@AE@% command compares one memory location against another memory location.
  11167. %@NL@%
  11168.  
  11169. If the two memory areas are identical, the debugger displays nothing and
  11170. returns the debugger prompt. Differences, when they exist, are displayed as
  11171. follows:  %@NL@%
  11172.  
  11173. %@AS@%  addr1 byte1 byte2 addr2%@AE@%
  11174.  
  11175. %@TH:   9   536 02 34 42 @%
  11176. Parameter                         Description
  11177. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11178. %@AI@%range%@AE@%                             Specifies the block of memory that is to
  11179.                                   be compared with a block of memory 
  11180.                                   starting at %@AI@%addr%@AE@%. 
  11181.  
  11182. %@AI@%addr%@AE@%                              Specifies the starting address of the 
  11183.                                   second block of memory.
  11184.  
  11185. %@TE:   9   536 02 34 42 @%
  11186.  
  11187.  
  11188. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11189.  
  11190. The following two commands have the same effect. Each compares the block of
  11191. memory from 100H to 1FFH with the block of memory from 300H to 3FFH:  %@NL@%
  11192.  
  11193. %@AS@%  c100 1FF 300%@AE@%
  11194.  
  11195. This first example specifies a %@AI@%range%@AE@% with a starting address of 100H and an
  11196. ending address of 1FFH. This block of memory is compared with a block of
  11197. memory of the same size starting at 300H.  %@NL@%
  11198.  
  11199. %@AS@%  c100 L 100 300%@AE@%
  11200.  
  11201. The second example compares the same block of memory, but specifies the
  11202. %@AI@%range%@AE@% by using the%@AB@% L%@AE@% (length) option.  %@NL@%
  11203.  
  11204.  
  11205. %@2@%%@CR:C6A00090043 @%%@AB@%d ─ Display Memory%@AE@%%@EH@%%@NL@%
  11206. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11207.  
  11208.  
  11209. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11210.  
  11211. %@AS@%  d «range»%@AE@%
  11212.  
  11213. The%@AB@% d%@AE@% command displays the contents of memory at a given address or in a
  11214. range of addresses. The%@AB@% d%@AE@% command displays one or more lines, depending on
  11215. the %@AI@%range%@AE@% given. Each line displays the address of the first item displayed.
  11216. The command always displays at least one value. The memory display is in the
  11217. format defined by a previously executed %@AB@%db%@AE@% (Display Bytes), %@AB@%dd%@AE@% (Display
  11218. Doublewords), or %@AB@%dw%@AE@% (Display Words) command. Each subsequent %@AB@%d%@AE@% (typed
  11219. without parameters) displays the bytes immediately following those last
  11220. displayed.  %@NL@%
  11221.  
  11222. %@TH:   9   656 02 34 42 @%
  11223. Parameter                         Description
  11224. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11225. %@AI@%range%@AE@%                             Specifies the range of addresses to 
  11226.                                   display. If you omit %@AI@%range%@AE@%, the %@AB@%d%@AE@% 
  11227.                                   command displays the next byte of memory
  11228.                                   after the last one displayed. The %@AB@%d%@AE@% 
  11229.                                   command must be separated by at least 
  11230.                                   one space from any %@AI@%range%@AE@% value. 
  11231.  
  11232. %@TE:   9   656 02 34 42 @%
  11233.  
  11234.  
  11235. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11236.  
  11237. %@AS@%  d CS:100 L 20%@AE@%
  11238.  
  11239. This example displays 20H bytes at CS:100.  %@NL@%
  11240.  
  11241. %@AS@%  d CS:100 115%@AE@%
  11242.  
  11243. This example displays all the bytes in the range 100H to 115H in the CS
  11244. selector.  %@NL@%
  11245.  
  11246.  
  11247. %@2@%%@CR:C6A00090044 @%%@AB@%db ─ Display Bytes%@AE@%%@EH@%%@NL@%
  11248. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11249.  
  11250.  
  11251. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11252.  
  11253. %@AS@%  db «range»%@AE@%
  11254.  
  11255. The %@AB@%db%@AE@% command displays the values of the bytes at a given address or in a
  11256. given range.  %@NL@%
  11257.  
  11258. The display is in two portions: a hexadecimal display (each byte is shown in
  11259. hexadecimal value) and an ASCII display (the bytes are shown in ASCII
  11260. characters). Nonprinting characters are denoted by a period (.) in the ASCII
  11261. portion of the display. Each display line shows 16 bytes, with a hyphen
  11262. between the eighth and ninth bytes. Each displayed line begins on a 16-byte
  11263. boundary.  %@NL@%
  11264.  
  11265. %@TH:   8   556 02 34 42 @%
  11266. Parameter                         Description
  11267. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11268. %@AI@%range%@AE@%                             Specifies the range of addresses to 
  11269.                                   display. If you omit %@AI@%range%@AE@%, 128 bytes 
  11270.                                   are displayed beginning at the first 
  11271.                                   address after the address displayed by 
  11272.                                   the previous %@AB@%db%@AE@% command. 
  11273.  
  11274. %@TE:   8   556 02 34 42 @%
  11275.  
  11276.  
  11277. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11278.  
  11279. %@AS@%  db CS:100 0A%@AE@%
  11280.  
  11281. This example displays the lines in the following format:  %@NL@%
  11282.  
  11283. %@AS@%  04BA:0100 54 4F 4D 20 53  . . . 45 52 TOM SAWYER%@AE@%
  11284.  
  11285. Each line of the display begins with an address, incremented by 10H from the
  11286. address on the previous line.  %@NL@%
  11287.  
  11288.  
  11289. %@2@%%@CR:C6A00090045 @%%@AB@%dd ─ Display Doublewords%@AE@%%@EH@%%@NL@%
  11290. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11291.  
  11292.  
  11293. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11294.  
  11295. %@AS@%  dd «range»%@AE@%
  11296.  
  11297. The %@AB@%dd%@AE@% command displays the hexadecimal values of the doublewords at the
  11298. address specified or in the specified range of addresses.  %@NL@%
  11299.  
  11300. The %@AB@%dd%@AE@% command displays one or more lines, depending on the %@AI@%range%@AE@% given.
  11301. Each line displays the address of the first doubleword in the line, followed
  11302. by up to four hexadecimal doubleword values. The hexadecimal values are
  11303. separated by spaces. The%@AB@% dd%@AE@% command displays values until the end of the
  11304. %@AI@%range%@AE@% or until the first 32 doublewords have been displayed.  %@NL@%
  11305.  
  11306. Typing %@AB@%dd%@AE@% displays 32 doublewords at the current dump address. For example,
  11307. if the last byte in the previous%@AB@% dd%@AE@% command was 04BA:0110, the display
  11308. starts at 04BA:0111.  %@NL@%
  11309.  
  11310. %@TH:   8   567 02 34 42 @%
  11311. Parameter                         Description
  11312. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11313. %@AI@%range%@AE@%                             Specifies the range of addresses to 
  11314.                                   display. If you omit %@AI@%range%@AE@%, 32 %@AB@%DWORD%@AE@%s 
  11315.                                   are displayed beginning at the first 
  11316.                                   address after the address displayed by 
  11317.                                   the previous %@AB@%dd%@AE@% command.
  11318.  
  11319. %@TE:   8   567 02 34 42 @%
  11320.  
  11321.  
  11322. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11323.  
  11324. %@AS@%  dd CS:100 110%@AE@%
  11325.  
  11326. This example displays the doubleword values from CS:100 to CS:110. The
  11327. resulting display is similar to the following:  %@NL@%
  11328.  
  11329. %@AS@%  04BA:0100 7473:2041 676E:6972 5405:0104 0A0D:7865
  11330. %@AS@%  04BA:0110 0000:002E%@AE@%
  11331.  
  11332. No more than four values per line are displayed.  %@NL@%
  11333.  
  11334.  
  11335. %@2@%%@CR:C6A00090046 @%%@AB@%dg ─ Display GDT%@AE@%%@EH@%%@NL@%
  11336. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11337.  
  11338.  
  11339. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11340.  
  11341. %@AS@%  dg«a» «range»%@AE@%
  11342.  
  11343. The %@AB@%dg%@AE@% command displays the specified range of entries in the GDT (Global
  11344. Descriptor Table).  %@NL@%
  11345.  
  11346. %@TH:  13   855 02 34 42 @%
  11347. Parameter                         Description
  11348. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11349. %@AI@%range%@AE@%                             Specifies the range of entries in the 
  11350.                                   GDT. If you omit %@AI@%range%@AE@%, the debugger 
  11351.                                   displays the entire contents of the GDT.
  11352.  
  11353. %@AB@%a%@AE@%                                 Causes all entries in the table to be 
  11354.                                   displayed, not just the valid entries. 
  11355.                                   The default is to display just the valid
  11356.                                   GDT entries. If the command is passed an
  11357.                                   LDT selector, it displays LDT and the 
  11358.                                   appropriate LDT entry. 
  11359.  
  11360. %@TE:  13   855 02 34 42 @%
  11361.  
  11362.  
  11363. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11364.  
  11365. %@AS@%  dg 0 40%@AE@%
  11366.  
  11367. This example displays only the valid entries from 0H to 40H in the GDT. The
  11368. resulting display is similar to the following:  %@NL@%
  11369.  
  11370. %@AS@%  0008  Data Seg  Base=01D700 Limit=3677 DPL=0 Present ReadWrite Accessed
  11371. %@AS@%  0010  TSS Desc  Base=007688 Limit=002B DPL=0 Present Busy
  11372. %@AS@%  0018  Data Seg  Base=020D7A Limit=03FF DPL=0 Present ReadWrite 
  11373. %@AS@%  0020  Data Seg  Base=000000 Limit=03FF DPL=0 Present ReadWrite 
  11374. %@AS@%  0028  LDT Desc  Base=000000 Limit=0000 DPL=0 Present 
  11375. %@AS@%  0030  Data Seg  Base=000000 Limit=0000 DPL=0 Present ReadWrite
  11376. %@AS@%  0040  Data Seg  Base=000400 Limit=03BF DPL=3 Present ReadWrite %@AE@%
  11377.  
  11378.  
  11379. %@2@%%@CR:C6A00090047 @%%@AB@%di ─ Display IDT%@AE@%%@EH@%%@NL@%
  11380. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11381.  
  11382.  
  11383. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11384.  
  11385. %@AS@%  di«a» «range»%@AE@%
  11386.  
  11387. The %@AB@%di%@AE@% command displays the specified range of entries in the IDT (Interrupt
  11388. Descriptor Table).  %@NL@%
  11389.  
  11390. %@TH:  11   683 02 34 42 @%
  11391. Parameter                         Description
  11392. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11393. %@AB@%a%@AE@%                                 Causes all entries in the table to be 
  11394.                                   displayed, not just the valid ones. The 
  11395.                                   default is to display just the valid IDT
  11396.                                   entries.
  11397.  
  11398. %@AI@%range%@AE@%                             Specifies the range of entries to be 
  11399.                                   displayed. If you omit %@AI@%range%@AE@%, the 
  11400.                                   debugger displays all IDT entries.
  11401.  
  11402. %@TE:  11   683 02 34 42 @%
  11403.  
  11404.  
  11405. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11406.  
  11407. %@AS@%  di 0 10%@AE@%
  11408.  
  11409. This command produces a display of valid entries similar to the following:  %@NL@%
  11410.  
  11411. %@AS@%  0000  Int Gate  Sel=1418    Offst=03D8 DPL=3 Present
  11412. %@AS@%  0001  Int Gate  Sel=2D38    Offst=0049 DPL=3 Present 
  11413. %@AS@%  0002  Int Gate  Sel=1418    Offst=03E4 DPL=3 Present 
  11414. %@AS@%  0003  Int Gate  Sel=2D38    Offst=006F DPL=3 Present 
  11415. %@AS@%  0004  Int Gate  Sel=1418    Offst=0417 DPL=3 Present 
  11416. %@AS@%  0005  Int Gate  Sel=1418    Offst=041D DPL=3 Present 
  11417. %@AS@%  0006  Int Gate  Sel=1418    Offst=0423 DPL=3 Present 
  11418. %@AS@%  0007  Int Gate  Sel=2D38    Offst=00A3 DPL=3 Present 
  11419. %@AS@%  0008  Int Gate  Sel=1418    Offst=042F DPL=3 Present 
  11420. %@AS@%  0009  Int Gate  Sel=2D38    Offst=00CA DPL=3 Present 
  11421. %@AS@%  000A  Int Gate  Sel=2D38    Offst=00D3 DPL=3 Present 
  11422. %@AS@%  000B  Int Gate  Sel=2D38    Offst=0156 DPL=3 Present 
  11423. %@AS@%  000C  Int Gate  Sel=2D38    Offst=01A4 DPL=3 Present 
  11424. %@AS@%  000D  Int Gate  Sel=2D38    Offst=01C6 DPL=3 Present %@AE@%
  11425.  
  11426.  
  11427. %@2@%%@CR:C6A00090048 @%%@AB@%dl ─ Display LDT%@AE@%%@EH@%%@NL@%
  11428. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11429.  
  11430.  
  11431. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11432.  
  11433. %@AS@%  dl«a | p | s | h» «range»%@AE@%
  11434.  
  11435. The %@AB@%dl%@AE@% command displays the specified range of entries in the LDT (Local
  11436. Descriptor Table).  %@NL@%
  11437.  
  11438. %@TH:  26  1507 02 34 42 @%
  11439. Parameter                         Description
  11440. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11441. %@AB@%a%@AE@%                                 Causes all entries in the table to be 
  11442.                                   displayed, not just the valid ones. The 
  11443.                                   default is to display just the valid LDT
  11444.                                   entries. If the command is passed a GDT 
  11445.                                   selector, it displays GDT and the 
  11446.                                   appropriate GDT entry. 
  11447.  
  11448. %@AB@%p%@AE@%                                 Causes private segment selectors to be 
  11449.                                   displayed. 
  11450.  
  11451. %@AB@%s%@AE@%                                 Causes shared segment selectors to be 
  11452.                                   displayed.
  11453.  
  11454. %@AB@%h%@AE@%                                 Causes huge segment selectors to be 
  11455.                                   displayed. To display the huge segment 
  11456.                                   selectors, give the shadow selector 
  11457.                                   followed by the maximum number of 
  11458.                                   selectors reserved for that segment plus
  11459.                                   1.
  11460.  
  11461. %@AI@%range%@AE@%                             Specifies the range of entries to be 
  11462.                                   displayed. If you omit %@AI@%range%@AE@%, the entire
  11463.                                   table is displayed.
  11464.  
  11465. %@TE:  26  1507 02 34 42 @%
  11466.  
  11467.  
  11468. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11469.  
  11470. %@AS@%  dla 4 57%@AE@%
  11471.  
  11472. This example displays all of the LDT entries. The command produces a display
  11473. similar to the following:  %@NL@%
  11474.  
  11475. %@AS@%  0014  Call Gate Sel=1418    Offst=0417 DPL=0 NotPres WordCount=1D
  11476. %@AS@%  001C  Code Seg  Base=051418 Limit=0423 DPL=0 NotPres ExecOnly  
  11477. %@AS@%  0027  Reserved  Base=87F000 Limit=FEA5 DPL=3 Present 
  11478. %@AS@%  0034  Code Seg  Base=05F000 Limit=1805 DPL=0 NotPres ExecOnly
  11479. %@AS@%  003C  Code Seg  Base=05F000 Limit=EF57 DPL=0 NotPres ExecOnly
  11480. %@AS@%  0047  Code Seg  Base=4DC000 Limit=0050 DPL=3 Present ExecOnly
  11481. %@AS@%  004D  Reserved  Base=71F000 Limit=F841 DPL=1 NotPres
  11482. %@AS@%  0057  Code Seg  Base=59F000 Limit=E739 DPL=3 Present ExecOnly %@AE@%
  11483.  
  11484.  
  11485. %@2@%%@CR:C6A00090049 @%%@AB@%dt ─ Display TSS%@AE@%%@EH@%%@NL@%
  11486. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11487.  
  11488.  
  11489. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11490.  
  11491. %@AS@%  dt «addr»%@AE@%
  11492.  
  11493. The %@AB@%dt%@AE@% command displays the current TSS (Task State Segment) or the selected
  11494. TSS if you specify the optional address.  %@NL@%
  11495.  
  11496. %@TH:   7   471 02 34 42 @%
  11497. Parameter                         Description
  11498. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11499. %@AI@%addr%@AE@%                              Specifies the address of the TSS to 
  11500.                                   display. If no %@AI@%addr%@AE@% is given, %@AB@%dt%@AE@% 
  11501.                                   displays the current TSS pointed to by 
  11502.                                   the TR register. 
  11503.  
  11504. %@TE:   7   471 02 34 42 @%
  11505.  
  11506.  
  11507. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11508.  
  11509. %@AS@%  dt%@AE@%
  11510.  
  11511. This example displays the current TSS. The resulting display is similar to
  11512. the following:  %@NL@%
  11513.  
  11514. %@AS@%  AX=0000   BX=0000   CX=0000   DX=0000   SP=0000   BP=0000   SI=0000
  11515. %@AS@%DI=0000
  11516. %@AS@%  IP=0000   CS=0000   DS=0000   ES=0000   SS=0000   NV UP DI PL NZ NA PO NC
  11517. %@AS@%  SS0=0038  SP0=08DE  SS1=0000  SP1=0000  SS2=0000  SP2=0000
  11518. %@AS@%  IOPL=0    LDTR=0028 LINK=0000%@AE@%
  11519.  
  11520.  
  11521. %@2@%%@CR:C6A00090050 @%%@AB@%dw ─ Display Words%@AE@%%@EH@%%@NL@%
  11522. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11523.  
  11524.  
  11525. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11526.  
  11527. %@AS@%  dw «range»%@AE@%
  11528.  
  11529. The %@AB@%dw%@AE@% command displays the hexadecimal values of the words at a given
  11530. address or in a given range of addresses.  %@NL@%
  11531.  
  11532. The command displays one or more lines, depending on the %@AI@%range%@AE@% given. Each
  11533. line displays the address of the first word in the line, followed by up to
  11534. eight hexadecimal word values. The hexadecimal values are separated by
  11535. spaces. The command displays values until the end of the %@AI@%range%@AE@% or until the
  11536. first 64 words have been displayed.  %@NL@%
  11537.  
  11538. Typing %@AB@%dw%@AE@% displays 64 words at the current dump address. If the last word in
  11539. the previous %@AB@%dw%@AE@% command was displayed at address 04BA:0110, the next display
  11540. will start at 04BA:0112.  %@NL@%
  11541.  
  11542. %@TH:   8   552 02 34 42 @%
  11543. Parameter                         Description
  11544. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11545. %@AI@%range%@AE@%                             Specifies the range of addresses to 
  11546.                                   display. If you omit %@AI@%range%@AE@%, 64 words are
  11547.                                   displayed beginning at the first address
  11548.                                   after the address displayed by the 
  11549.                                   previous %@AB@%dw%@AE@% command.
  11550.  
  11551. %@TE:   8   552 02 34 42 @%
  11552.  
  11553.  
  11554. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11555.  
  11556. %@AS@%  dw CS:100 110%@AE@%
  11557.  
  11558. This example displays the word values from CS:100 to CS:110, resulting in a
  11559. display similar to the following:  %@NL@%
  11560.  
  11561. %@AS@%  04BA:0100 2041 7473 6972 676E 0104 5404 7865 0A0D
  11562. %@AS@%  04BA:0110 002E%@AE@%
  11563.  
  11564.  
  11565. %@2@%%@CR:C6A00090051 @%%@AB@%e ─ Enter Byte%@AE@%%@EH@%%@NL@%
  11566. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11567.  
  11568.  
  11569. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11570.  
  11571. %@AS@%  e addr «list»%@AE@%
  11572.  
  11573. The %@AB@%e%@AE@% command enters byte values into memory at a specified address. You can
  11574. specify the new values on the command line, or let the debugger prompt you
  11575. for values. If the debugger uses a prompt, it displays the address and its
  11576. contents and then waits for you to perform one of the following actions:  %@NL@%
  11577.  
  11578.  
  11579.   ■   Replace a byte value with a value you type. Type the value after the
  11580.       current value. If the byte you type is an illegal hexadecimal value or
  11581.       contains more than two digits, the system does not echo the illegal or
  11582.       extra character. %@NL@%
  11583.  
  11584.   ■   Press the SPACEBAR to advance to the next byte. To change the value,
  11585.       type the new value after the current value. If, when you press the
  11586.       SPACEBAR, you move beyond an 8-byte boundary, the 80386 Debugger
  11587.       starts a new display line with the address displayed at the beginning.
  11588.       %@NL@%
  11589.  
  11590.   ■   Type a hyphen (-) to return to the preceding byte. If you decide to
  11591.       change a byte before the current position, typing the hyphen returns
  11592.       the current position to the previous byte. When you type the hyphen, a
  11593.       new line is started with its address and byte value displayed. %@NL@%
  11594.  
  11595.   ■   Press ENTER to terminate the %@AB@%e%@AE@% command. You can press ENTER at any
  11596.       byte position. 
  11597. %@TH:  11   678 02 34 42 @%
  11598. Parameter                         Description
  11599. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11600. %@AI@%addr%@AE@%                              Specifies the address of the first byte 
  11601.                                   to be entered.
  11602.  
  11603. %@AI@%list%@AE@%                              Specifies the byte values used for 
  11604.                                   replacement. These values are inserted 
  11605.                                   automatically. If an error occurs when 
  11606.                                   you are using the list form of the 
  11607.                                   command, no byte values are changed.
  11608.  
  11609. %@TE:  11   678 02 34 42 @%
  11610.  
  11611. %@NL@%
  11612.  
  11613.  
  11614.  
  11615. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11616.  
  11617. %@AS@%  eCS:100
  11618. %@AS@%  04BA:0100 EB.%@AE@%
  11619.  
  11620. This example prompts you to change the value EB at CS:100. To step through
  11621. the subsequent bytes without changing values, press the SPACEBAR.  %@NL@%
  11622.  
  11623. %@AS@%  04BA:0100 EB.41  10. 00. BC.%@AE@%
  11624.  
  11625. In this example, the SPACEBAR is pressed three times.  %@NL@%
  11626.  
  11627. To return to a value at a previous address, type a hyphen.  %@NL@%
  11628.  
  11629. %@AS@%  04BA:0100  EB.41    10. 00. BC.-
  11630. %@AS@%  04BA:0102  00.-
  11631. %@AS@%  04BA:0101  10.%@AE@%
  11632.  
  11633. This example returns to the address CS:101.  %@NL@%
  11634.  
  11635.  
  11636. %@2@%%@CR:C6A00090052 @%%@AB@%f ─ Fill Memory%@AE@%%@EH@%%@NL@%
  11637. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11638.  
  11639.  
  11640. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11641.  
  11642. %@AS@%  f range list%@AE@%
  11643.  
  11644. The %@AB@%f%@AE@% command fills the addresses in a specified range with the values in
  11645. the specified list.  %@NL@%
  11646.  
  11647. %@TH:  17  1214 02 34 42 @%
  11648. Parameter                         Description
  11649. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11650. %@AI@%range%@AE@%                             Specifies the range of addresses to be 
  11651.                                   filled. If %@AI@%range%@AE@% contains more bytes 
  11652.                                   than the number of values in %@AI@%list%@AE@%, the 
  11653.                                   debugger uses %@AI@%list%@AE@% repeatedly until all 
  11654.                                   bytes in %@AI@%range%@AE@% are filled. If any of the
  11655.                                   memory in %@AI@%range%@AE@% is not valid (bad or 
  11656.                                   nonexistent), an error will occur in all
  11657.                                   succeeding locations. 
  11658.  
  11659. %@AI@%list%@AE@%                              Specifies the list of values to fill the
  11660.                                   given %@AI@%range%@AE@%. If %@AI@%list%@AE@% contains more 
  11661.                                   values than the number of bytes in %@AI@%range%@AE@%,
  11662.                                   the debugger ignores the extra values in
  11663.                                   %@AI@%list%@AE@%. 
  11664.  
  11665. %@TE:  17  1214 02 34 42 @%
  11666.  
  11667.  
  11668. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11669.  
  11670. %@AS@%  f04BA:100 L 100 42 45 52 54 41%@AE@%
  11671.  
  11672. This example fills memory locations 04BA:100 through 04BA:1FF with the bytes
  11673. specified, repeating the five values until it has filled all 100H bytes.  %@NL@%
  11674.  
  11675.  
  11676. %@2@%%@CR:C6A00090053 @%%@AB@%g ─ Go%@AE@%%@EH@%%@NL@%
  11677. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11678.  
  11679.  
  11680. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11681.  
  11682. %@AS@%  g «=addr «addr...»»%@AE@%
  11683.  
  11684. The %@AB@%g%@AE@% command executes the program currently in memory. If you type the %@AB@%g%@AE@%
  11685. command by itself, the current program executes as if it had run outside the
  11686. debugger. If you specify %@AB@%=%@AE@%%@AI@%addr%@AE@%, execution begins at the specified address.  %@NL@%
  11687.  
  11688. Specifying an optional breakpoint address causes execution to halt at the
  11689. first address encountered, regardless of the position of the address in the
  11690. list of addresses that halts execution or program branching. When program
  11691. execution reaches a breakpoint, the default command string is executed.  %@NL@%
  11692.  
  11693. The stack (SS:SP) must be valid and have six bytes available for this
  11694. command. The %@AB@%g%@AE@% command uses an %@AB@%IRET%@AE@% instruction to cause a jump to the
  11695. program under test. The stack is set, and the user flags, CS register, and
  11696. IP register are pushed on the user stack. (If the user stack is not valid or
  11697. is too small, the operating environment may crash.) An interrupt code (0CCH)
  11698. is placed at the specified breakpoint addresses.  %@NL@%
  11699.  
  11700. When the debugger encounters an instruction with the breakpoint code, it
  11701. restores all breakpoint addresses listed with the %@AB@%g%@AE@% command to their
  11702. original instructions. If you do not halt execution at one of the
  11703. breakpoints, the interrupt codes are not replaced with the original
  11704. instructions.  %@NL@%
  11705.  
  11706. %@TH:  15   990 02 34 42 @%
  11707. Parameter                         Description
  11708. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11709. %@AB@%=%@AE@%%@AI@%addr%@AE@%                             Specifies the address where execution is
  11710.                                   to begin. The equal sign (=) is needed 
  11711.                                   to distinguish the starting address from
  11712.                                   the breakpoint address. 
  11713.  
  11714. %@AI@%addr%@AE@%                              Specifies one or more breakpoint 
  11715.                                   addresses where execution is to halt. 
  11716.                                   You can specify up to 10 breakpoints, 
  11717.                                   but only at addresses containing the 
  11718.                                   first byte of an opcode. If you attempt 
  11719.                                   to set more than 10 breakpoints, an 
  11720.                                   error message will be displayed. 
  11721.  
  11722. %@TE:  15   990 02 34 42 @%
  11723.  
  11724.  
  11725. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11726.  
  11727. %@AS@%  gCS:7550%@AE@%
  11728.  
  11729. This example executes the program currently in memory until address 7550 in
  11730. the CS selector is executed. The debugger then executes the default command
  11731. string, removes the INT 3 trap from this address, and restores the original
  11732. instruction. When you resume execution, the original instruction will be
  11733. executed.  %@NL@%
  11734.  
  11735.  
  11736. %@2@%%@CR:C6A00090054 @%%@AB@%h ─ Hexadecimal Arithmetic%@AE@%%@EH@%%@NL@%
  11737. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11738.  
  11739.  
  11740. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11741.  
  11742. %@AS@%  h word word%@AE@%
  11743.  
  11744. The %@AB@%h%@AE@% command performs hexadecimal arithmetic on the two specified
  11745. parameters.  %@NL@%
  11746.  
  11747. The debugger adds, subtracts, multiplies, and divides the second parameter
  11748. and the first parameter, then displays the results on one line. The debugger
  11749. does 32-bit multiplication and displays the result as doublewords. The
  11750. debugger displays the result of division as a 16-bit quotient and a 16-bit
  11751. remainder.  %@NL@%
  11752.  
  11753. %@TH:   3   223 02 19 57 @%
  11754. Parameter          Description
  11755. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11756. %@AI@%word%@AE@%               Specifies two 16-bit word parameters.
  11757. %@TE:   3   223 02 19 57 @%
  11758.  
  11759.  
  11760. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11761.  
  11762. %@AS@%  h 300 100%@AE@%
  11763.  
  11764. This example performs the calculations and displays the following:  %@NL@%
  11765.  
  11766. %@AS@%  +0400  -0200 *0000 0003 /0003 0000%@AE@%
  11767.  
  11768.  
  11769. %@2@%%@CR:C6A00090055 @%%@AB@%i ─ Input Byte%@AE@%%@EH@%%@NL@%
  11770. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11771.  
  11772.  
  11773. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11774.  
  11775. %@AS@%  i word%@AE@%
  11776.  
  11777. The %@AB@%i%@AE@% command inputs and displays one byte from a specified port.  %@NL@%
  11778.  
  11779. %@TH:   3   222 02 20 56 @%
  11780. Parameter           Description
  11781. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11782. %@AI@%word%@AE@%                Specifies the 16-bit port address.
  11783. %@TE:   3   222 02 20 56 @%
  11784.  
  11785.  
  11786. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11787.  
  11788. %@AS@%  i2F8%@AE@%
  11789.  
  11790. This example displays the byte at port address 2F8H.  %@NL@%
  11791.  
  11792.  
  11793. %@2@%%@CR:C6A00090056 @%%@AB@%j ─ Conditional Execute%@AE@%%@EH@%%@NL@%
  11794. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11795.  
  11796.  
  11797. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11798.  
  11799. %@AS@%  j expr «"cmds"»%@AE@%
  11800.  
  11801. The %@AB@%j%@AE@% command executes the specified commands when the specified expression
  11802. is TRUE. If %@AI@%expr%@AE@% is FALSE, the debugger continues to the next command line
  11803. (excluding the commands in %@AI@%cmds%@AE@%).  %@NL@%
  11804.  
  11805. The %@AB@%j%@AE@% command is useful in breakpoint commands to conditionally break
  11806. execution when an expression becomes true.  %@NL@%
  11807.  
  11808. %@TH:  12   776 02 34 42 @%
  11809. Parameter                         Description
  11810. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11811. %@AI@%expr%@AE@%                              Evaluates to a Boolean TRUE or FALSE.
  11812.  
  11813. %@AI@%cmds%@AE@%                              Specifies a list of debugger commands to
  11814.                                   be executed when %@AI@%expr%@AE@% is TRUE. The list 
  11815.                                   must be enclosed in single or double 
  11816.                                   quotation marks. You must separate 
  11817.                                   optional commands with semicolons (;). 
  11818.                                   You can use a single or NULL command 
  11819.                                   without quotation marks.
  11820.  
  11821. %@TE:  12   776 02 34 42 @%
  11822.  
  11823.  
  11824. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  11825.  
  11826. %@AS@%  bp 167:1454 "J AX == 0;G"%@AE@%
  11827.  
  11828. This example causes execution to break if AX does not equal zero when the
  11829. breakpoint is reached.  %@NL@%
  11830.  
  11831. %@AS@%  bp 167:1462 "J BY (DS:SI+3) == 40 'R;G';DG DS"%@AE@%
  11832.  
  11833. This example displays the registers and continues execution when the byte
  11834. pointed to by DS:SI +3 is equal to 40H; otherwise, it displays the
  11835. descriptor table.  %@NL@%
  11836.  
  11837. %@AS@%  bp 156:1455 "J (MSW AND 1) == 1 'G'"%@AE@%
  11838.  
  11839. This example breaks execution when the breakpoint is reached in real mode.  %@NL@%
  11840.  
  11841. %@AS@%  bp 156:1455 "J (MSW AND 1) 'G'" %@AE@%
  11842.  
  11843. This example is a shortcut that produces the same results as the preceding
  11844. command.  %@NL@%
  11845.  
  11846.  
  11847. %@2@%%@CR:C6A00090057 @%%@AB@%k ─ Backtrace Stack%@AE@%%@EH@%%@NL@%
  11848. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11849.  
  11850.  
  11851. %@3@%%@AB@%Syntax%@CR:C6A00090058 @%%@AE@%%@EH@%%@NL@%
  11852.  
  11853. %@AS@%  k «ss:bp» «cs:ip»%@AE@%
  11854.  
  11855. This command displays the current stack frame. Each line shows the name of a
  11856. procedure, its arguments, and the address of the statement that called it.
  11857. The command displays four 2-byte arguments by default. The %@AB@%ka%@AE@% command
  11858. changes the number of arguments displayed by this command.  %@NL@%
  11859.  
  11860. Using the %@AB@%k%@AE@% command at the beginning of a function (before the function
  11861. prolog has been executed) will give incorrect results. The command uses the
  11862. BP register to compute the current backtrace, and this register is not
  11863. correctly set for a function until its prolog has been executed.%@CR:C6A00090059 @%%@NL@%
  11864.  
  11865. %@TH:   4   289 02 17 59 @%
  11866. Parameter        Description
  11867. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11868. %@AI@%ss:bp%@AE@%            Specifies an optional stack-frame address.
  11869. %@AI@%cs:ip%@AE@%            Specifies an optional code address.
  11870. %@TE:   4   289 02 17 59 @%
  11871.  
  11872.  
  11873. %@2@%%@CR:C6A00090060 @%%@AB@%ka ─ Set Backtrace Arguments%@AE@%%@EH@%%@NL@%
  11874. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11875.  
  11876.  
  11877. %@3@%%@AB@%Syntax%@CR:C6A00090061 @%%@AE@%%@EH@%%@NL@%
  11878.  
  11879. %@AS@%  ka value%@AE@%
  11880.  
  11881. The %@AB@%ka%@AE@% command sets the number of parameters displayed for all subsequent
  11882. stack trace commands. The initial default is four.  %@NL@%
  11883.  
  11884. %@TH:   6   399 02 34 42 @%
  11885. Parameter                         Description
  11886. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11887. %@AI@%value%@AE@%                             Specifies the number of parameters to be
  11888.                                   displayed. The %@AI@%value%@AE@% parameter must be 
  11889.                                   in the range 0 to 31.
  11890.  
  11891. %@TE:   6   399 02 34 42 @%
  11892.  
  11893.  
  11894. %@2@%%@CR:C6A00090062 @%%@AB@%kt ─ Backtrace Task Stack%@AE@%%@EH@%%@NL@%
  11895. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11896.  
  11897.  
  11898. %@3@%%@AB@%Syntax%@CR:C6A00090063 @%%@CR:C6A00090064 @%%@AE@%%@EH@%%@NL@%
  11899.  
  11900. %@AS@%  kt «tdb»%@AE@%
  11901.  
  11902. This command displays the stack frame of the current task or the task
  11903. specified by %@AI@%tdb%@AE@%. Each line shows the name of a procedure, its arguments,
  11904. and the address of the statement that called it. The command displays four
  11905. 2-byte arguments by default. The %@AB@%ka%@AE@% command changes the number of arguments
  11906. displayed by this command.  %@NL@%
  11907.  
  11908. This command can be combined with the %@AB@%kv%@AE@% command; the syntax for the
  11909. combined command is %@AB@%kvt%@AE@% «%@AI@%tdb%@AE@%».  %@NL@%
  11910.  
  11911. %@TH:  10   743 02 34 42 @%
  11912. Parameter                         Description
  11913. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11914. %@AI@%tdb%@AE@%                               Specifies the segment address of the 
  11915.                                   program descriptor block for the task to
  11916.                                   be traced. To obtain the %@AI@%tdb%@AE@% value, use 
  11917.                                   the .%@AB@%dq%@AE@% (Dump Task Queue) command. If %@AI@%%@AE@%
  11918.                                   %@AI@%tdb%@AE@% is not supplied, the %@AB@%kt%@AE@% command 
  11919.                                   displays the stack frame of the current 
  11920.                                   task. %@CR:C6A00090065 @%
  11921.  
  11922. %@TE:  10   743 02 34 42 @%
  11923.  
  11924.  
  11925. %@2@%%@CR:C6A00090066 @%%@AB@%kv ─ Verbose Backtrace Stack%@AE@%%@EH@%%@NL@%
  11926. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11927.  
  11928.  
  11929. %@3@%%@AB@%Syntax%@CR:C6A00090067 @%%@AE@%%@EH@%%@NL@%
  11930.  
  11931. %@AS@%  kv %@AE@%
  11932.  
  11933. The %@AB@%kv%@AE@% command displays information that the %@AB@%k %@AE@%(Backtrace Stack) command
  11934. provides, plus information about stack location and frame pointer values for
  11935. each frame.  %@NL@%
  11936.  
  11937.  
  11938. %@2@%%@CR:C6A00090068 @%%@AB@%la ─ List Absolute Symbols%@AE@%%@EH@%%@NL@%
  11939. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11940.  
  11941.  
  11942. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11943.  
  11944. %@AS@%  la%@AE@%
  11945.  
  11946. The %@AB@%la%@AE@% command lists the absolute symbols in the currently active map.  %@NL@%
  11947.  
  11948.  
  11949. %@2@%%@CR:C6A00090069 @%%@AB@%lg ─ List Groups%@AE@%%@EH@%%@NL@%
  11950. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11951.  
  11952.  
  11953. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11954.  
  11955. %@AS@%  lg%@AE@%
  11956.  
  11957. The %@AB@%lg%@AE@% command lists the selector (or segment) and the name of each group in
  11958. the active map.  %@NL@%
  11959.  
  11960.  
  11961. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11962.  
  11963. %@AS@%  lg%@AE@%
  11964.  
  11965. This example produces a display similar to the following:  %@NL@%
  11966.  
  11967. %@AS@%  #0090:0000 DOSCODE
  11968. %@AS@%  #0828:0000 DOSGROUP
  11969. %@AS@%  #1290:0000 DBGCODE
  11970. %@AS@%  #16C0:0000 DBGDATA
  11971. %@AS@%  #1A38:0000 TASKCODE
  11972. %@AS@%  #1AD8:0000 DOSRING3CODE
  11973. %@AS@%  #1AE0:0000 DOSINITCODE
  11974. %@AS@%  #2018:0000 DOSINITRMCODE
  11975. %@AS@%  #20A8:0000 DOSINITDATA
  11976. %@AS@%  #23F8:0000 DOSMTE 
  11977. %@AS@%  #2420:0000 DOSHIGHDATA
  11978. %@AS@%  #28D0:0000 DOSHIGHCODE
  11979. %@AS@%  #3628:0000 DOSHIGH2CODE
  11980. %@AS@%  #0090:0000 DOSCODE%@AE@%
  11981.  
  11982.  
  11983. %@2@%%@CR:C6A00090070 @%%@AB@%lm ─ List Map%@AE@%%@EH@%%@NL@%
  11984. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11985.  
  11986.  
  11987. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  11988.  
  11989. %@AS@%  lm%@AE@%
  11990.  
  11991. The %@AB@%lm%@AE@% command lists the symbol files currently loaded and indicates which
  11992. one is active.  %@NL@%
  11993.  
  11994. The last symbol file loaded is made active by default. Use the %@AB@%w%@AE@% (Change
  11995. Map) command to change the active file.  %@NL@%
  11996.  
  11997.  
  11998. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  11999.  
  12000. %@AS@%  lm%@AE@%
  12001.  
  12002. This example returns a display similar to the following:  %@NL@%
  12003.  
  12004. %@AS@%  COMSAM2D is active.
  12005. %@AS@%  DISK01D.%@AE@%
  12006.  
  12007.  
  12008. %@2@%%@CR:C6A00090071 @%%@AB@%ln ─ List Near%@AE@%%@EH@%%@NL@%
  12009. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12010.  
  12011.  
  12012. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12013.  
  12014. %@AS@%  ln «addr»%@AE@%
  12015.  
  12016. The %@AB@%ln%@AE@% command lists the symbol nearest to the specified address. The
  12017. command lists the nearest symbol before and after the specified %@AI@%addr%@AE@%
  12018. parameter.  %@NL@%
  12019.  
  12020. %@TH:   6   374 02 34 42 @%
  12021. Parameter                         Description
  12022. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12023. %@AI@%addr%@AE@%                              Specifies any valid instruction address.
  12024.                                   The default is the current disassembly 
  12025.                                   address.
  12026.  
  12027. %@TE:   6   374 02 34 42 @%
  12028.  
  12029.  
  12030. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12031.  
  12032. %@AS@%  ln%@AE@%
  12033.  
  12034. This example displays the nearest symbols before and after the current
  12035. disassembly address. The output looks like this:  %@NL@%
  12036.  
  12037. %@AS@%  6787 VerifyRamSemAddr + 10
  12038. %@AS@%  67AA PutRamSemID - 13%@AE@%
  12039.  
  12040.  
  12041. %@2@%%@CR:C6A00090072 @%%@AB@%ls ─ List Symbols%@AE@%%@EH@%%@NL@%
  12042. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12043.  
  12044.  
  12045. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12046.  
  12047. %@AS@%  ls {group-name | name-chars | *}%@AE@%
  12048.  
  12049. The %@AB@%ls%@AE@% command lists the symbols in the specified group, or names that match
  12050. the search specification in all groups. Only the * wildcard is accepted and
  12051. only as the last character (all other characters will be ignored).  %@NL@%
  12052.  
  12053. %@TH:   8   463 02 34 42 @%
  12054. Parameter                         Description
  12055. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12056. %@AI@%group-name%@AE@%                        Names the group that contains the 
  12057.                                   symbols you want to list. 
  12058.  
  12059. %@AI@%name-chars%@AE@%                        Displays a list of symbols that begin 
  12060.                                   with the specified characters.
  12061.  
  12062. %@TE:   8   463 02 34 42 @%
  12063.  
  12064.  
  12065. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12066.  
  12067. %@AS@%  ls DOSRING3CODE
  12068. %@AS@%  ls vkd*
  12069. %@AS@%  ls vmm_base%@AE@%
  12070.  
  12071. The first example displays all of the symbols in the DOSRING3CODE group. The
  12072. debugger displays the symbols in a format similar to the following:  %@NL@%
  12073.  
  12074. %@AS@%  0000 Sigdispatch
  12075. %@AS@%  001A LibInitDisp%@AE@%
  12076.  
  12077. The second example displays all of the symbols that start with the first
  12078. three characters "vkd." This will show the group names as they are searched,
  12079. similar to the following:  %@NL@%
  12080.  
  12081. %@AS@%  GROUP: [0028] CODE
  12082. %@AS@%   60003A74 VKD_Control_Debug
  12083. %@AS@%  GROUP: [0030] DATA
  12084. %@AS@%   6001DFFC VKD_CB_Offset
  12085. %@AS@%  GROUP: [0030} IDATA%@AE@%
  12086.  
  12087. The third example displays the address and group for the symbol "VMM_base."
  12088. %@NL@%
  12089.  
  12090.  
  12091. %@2@%%@CR:C6A00090073 @%%@AB@%m ─ Move Memory%@AE@%%@EH@%%@NL@%
  12092. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12093.  
  12094.  
  12095. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12096.  
  12097. %@AS@%  m range addr%@AE@%
  12098.  
  12099. The %@AB@%m%@AE@% command moves a block of memory from one memory location to another.  %@NL@%
  12100.  
  12101. Overlapping moves─those where part of the block overlaps some of the current
  12102. addresses─are always performed without loss of data. Addresses that could be
  12103. overwritten are moved first. For moves from higher to lower addresses, the
  12104. sequence of events is first to move the data at the block's lowest address
  12105. and then to work toward the highest. For moves from lower to higher
  12106. addresses, the sequence is first to move the data at the block's highest
  12107. address and then to work toward the lowest.  %@NL@%
  12108.  
  12109. Note that if the addresses in the block being moved will not have new data
  12110. written to them, the data in the block %@AI@%before the move%@AE@% will remain. The %@AB@%m%@AE@%
  12111. command copies the data from one area into another, in the sequence
  12112. described, and writes over the new addresses─hence, the importance of the
  12113. moving sequence.  %@NL@%
  12114.  
  12115. To review the results of a memory move, use the %@AB@%d%@AE@% (Display Memory) command,
  12116. specifying the same address you used with the %@AB@%m%@AE@% command.  %@NL@%
  12117.  
  12118. %@TH:   8   443 02 34 42 @%
  12119. Parameter                         Description
  12120. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12121. %@AI@%range%@AE@%                             Specifies the block of memory to be 
  12122.                                   moved.
  12123.  
  12124. %@AI@%addr%@AE@%                              Specifies the starting address where the
  12125.                                   memory is to be relocated.
  12126.  
  12127. %@TE:   8   443 02 34 42 @%
  12128.  
  12129.  
  12130. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12131.  
  12132. %@AS@%  mCS:100 110 CS:500%@AE@%
  12133.  
  12134. This example first moves address CS:110 to CS:510 and then moves CS:10F to
  12135. CS:50F, and so on, until CS:100 is moved to CS:500.  %@NL@%
  12136.  
  12137.  
  12138. %@2@%%@CR:C6A00090074 @%%@AB@%o ─ Output to Port%@AE@%%@EH@%%@NL@%
  12139. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12140.  
  12141.  
  12142. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12143.  
  12144. %@AS@%  o word byte%@AE@%
  12145.  
  12146. The %@AB@%o%@AE@% command writes a byte to a 16-bit port address.  %@NL@%
  12147.  
  12148. %@TH:   4   306 02 13 63 @%
  12149. Parameter    Description
  12150. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12151. %@AI@%word%@AE@%         Specifies the 16-bit port address you are writing to. 
  12152. %@AI@%byte%@AE@%         Specifies the 8-bit value to be written to the port.
  12153. %@TE:   4   306 02 13 63 @%
  12154.  
  12155.  
  12156. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12157.  
  12158. %@AS@%  o 2F8 4F%@AE@%
  12159.  
  12160. This example writes the byte value 4F to output port 2F8.  %@NL@%
  12161.  
  12162.  
  12163. %@2@%%@CR:C6A00090075 @%%@AB@%p ─ Program Trace%@AE@%%@EH@%%@NL@%
  12164. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12165.  
  12166.  
  12167. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12168.  
  12169. %@AS@%  p«N» «=addr »«count»%@AE@%
  12170.  
  12171. The %@AB@%p%@AE@% command executes the instruction at a specified address and displays
  12172. the current values of all the registers and flags (whatever the %@AB@%z%@AE@% command
  12173. has been set to). It then executes the default command string, if any.  %@NL@%
  12174.  
  12175. The %@AB@%p%@AE@% command is identical to the %@AB@%t%@AE@% (Trace Instructions) command, except
  12176. that it automatically executes and returns from any calls or software
  12177. interrupts it encounters. The %@AB@%t%@AE@% command always stops after executing into
  12178. the call or interrupt, leaving execution control inside the called routine.
  12179. %@NL@%
  12180.  
  12181. %@TH:  24  1630 02 34 42 @%
  12182. Parameter                         Description
  12183. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12184. %@AB@%N%@AE@%                                 Suppresses the register display so just 
  12185.                                   the assembly line is displayed. The 
  12186.                                   suppression will result only if the 
  12187.                                   default command, %@AB@%z%@AE@%, is set to a normal 
  12188.                                   setting, %@AB@%r%@AE@%.
  12189.  
  12190. %@AI@%addr%@AE@%                              Specifies the starting address to begin 
  12191.                                   execution. If you omit the optional %@AI@%addr%@AE@%,
  12192.                                   execution begins at the instruction 
  12193.                                   pointed to by the CS and IP registers. 
  12194.                                   Use the equal sign (=) only if you 
  12195.                                   specify an %@AI@%addr%@AE@%. 
  12196.  
  12197. %@AI@%count%@AE@%                             Specifies the number of instructions to 
  12198.                                   execute before halting and executing the
  12199.                                   default command string. If you specify %@AI@%%@AE@%
  12200.                                   %@AI@%count%@AE@%, the command continues to execute %@AI@%%@AE@%
  12201.                                   %@AI@%count%@AE@% instructions before stopping. The 
  12202.                                   command executes the default command 
  12203.                                   string for each instruction before 
  12204.                                   executing the next. 
  12205.  
  12206. %@TE:  24  1630 02 34 42 @%
  12207.  
  12208.  
  12209. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  12210.  
  12211. %@AS@%  p%@AE@%
  12212.  
  12213. This example executes the instruction pointed to by the current CS and IP
  12214. register values before it executes the default command string.  %@NL@%
  12215.  
  12216. %@AS@%  p=120%@AE@%
  12217.  
  12218. This example executes the instruction at address CS:120 before it executes
  12219. the default command string.  %@NL@%
  12220.  
  12221.  
  12222. %@2@%%@CR:C6A00090076 @%%@AB@%r ─ Display Registers%@AE@%%@EH@%%@NL@%
  12223. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12224.  
  12225.  
  12226. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12227.  
  12228. %@AS@%  r reg =word%@AE@%
  12229.  
  12230. The %@AB@%r%@AE@% command displays the contents of one or more CPU registers and allows
  12231. the contents to be changed to new values. If you specify a %@AI@%reg%@AE@% with the %@AB@%r%@AE@%
  12232. command, the 16-bit value of that register is displayed in hexadecimal
  12233. followed by a colon (:) prompt on the next line. You can then enter a new
  12234. %@AI@%word%@AE@% value for the specified register or press ENTER if you do not want to
  12235. change the register value.  %@NL@%
  12236.  
  12237. If you use %@AB@%f%@AE@% for %@AI@%reg%@AE@%, the debugger displays the flags in a row at the
  12238. beginning of a new line and displays a hyphen (-) after the last flag.  %@NL@%
  12239.  
  12240. You can type new flag values in any order as alphabetic pairs. You do not
  12241. have to leave spaces between these values. To exit the %@AB@%r%@AE@% command, press
  12242. ENTER. Any flags for which you did not specify new values remain unchanged.
  12243. %@NL@%
  12244.  
  12245. If you type more than one value for a flag, or if you enter an invalid flag
  12246. name, the debugger returns a "Bad Flag" error message. In both cases, the
  12247. flags up to the error in the list are changed; those flags at and after the
  12248. error are not changed.  %@NL@%
  12249.  
  12250. %@TH:  53  1723 02 11 32 33 @%
  12251. Parameter  Description
  12252. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12253. %@AI@%reg%@AE@%        Specifies the register to be 
  12254.            displayed. If you omit %@AI@%reg%@AE@%, 
  12255.            the debugger displays the 
  12256.            contents of all registers and 
  12257.            flags along with the next 
  12258.            executable instruction.
  12259.  
  12260. %@AI@%word%@AE@%       Specifies the new value for 
  12261.            the register. For the Flags 
  12262.            register, set or clear a flag 
  12263.            by using one of the following 
  12264.            names:
  12265.  
  12266.            Flag Name                       Action
  12267.  
  12268.            OV                              Overflow set
  12269.  
  12270.            NV                              Overflow clear
  12271.  
  12272.            DN                              Direction decrement
  12273.  
  12274.            UP                              Direction increment
  12275.  
  12276.            EI                              Interrupt enabled
  12277.  
  12278.            DI                              Interrupt disabled
  12279.  
  12280.            NG                              Sign negative
  12281.  
  12282.            PL                              Sign positive
  12283.  
  12284.            ZR                              Zero set
  12285.  
  12286.            NZ                              Zero clear
  12287.  
  12288.            Flag Name                       Action
  12289.  
  12290.            AC                              Auxiliary Carry set
  12291.  
  12292.            NA                              Auxiliary Carry clear
  12293.  
  12294.            PE                              Parity even
  12295.  
  12296.            PO                              Parity odd
  12297.  
  12298.            CY                              Carry set
  12299.  
  12300.            NC                              Carry clear
  12301.  
  12302.            NT                              Nested Task toggle on and off
  12303.  
  12304. %@TE:  53  1723 02 11 32 33 @%
  12305.  
  12306. For the MSW register, use the following names to set a flag:  %@NL@%
  12307.  
  12308. %@TH:   6   356 02 17 59 @%
  12309. Flag Name        Action
  12310. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12311. TS               Sets the task switch bit.
  12312. EM               Sets the emulation processor extension bit.
  12313. MP               Sets the monitor processor extension bit.
  12314. PM               Sets the protected mode bit.
  12315. %@TE:   6   356 02 17 59 @%
  12316.  
  12317.  
  12318. %@3@%%@AB@%Comments%@AE@%%@EH@%%@NL@%
  12319.  
  12320. Setting the protected-mode bit from within the debugger does %@AI@%not%@AE@% set the
  12321. target system to run in protected mode. The debugger simulates the setting.
  12322. To configure the target system to run in protected mode, you would have to
  12323. set the PM bit in the MSW register and reset the target system to boot in
  12324. protected mode.  %@NL@%
  12325.  
  12326.  
  12327. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  12328.  
  12329. %@AS@%  r%@AE@%
  12330.  
  12331. This example produces the following display:  %@NL@%
  12332.  
  12333. %@AS@%  AX=0698  BX=2008  CX=2C18  DX=18AB  SP=1B7A  BP=00FF  SI=0020  DI=10CD
  12334. %@AS@%  IP=0450  CS=18B0  DS=1BE8  ES=0DA8  SS=0048  NV UP DI PL NZ NA PO NC
  12335. %@AS@%  GDTR=01BE80 3687  IDTR=01F508 03FF  TR=0010  LDTR=0028 IOPL=3 MSW=PM 
  12336. %@AS@%  18B0:0450 C3             RET                             %@AE@%
  12337.  
  12338. %@AS@%  rf%@AE@%
  12339.  
  12340. This example displays each flag with a two-character alphabetic code. To
  12341. change any flag, type the opposite two-letter code. The flags are either set
  12342. or cleared. This example produces a display similar to the following:  %@NL@%
  12343.  
  12344. %@AS@%  NV UP DI NG NZ AC PE NC - _%@AE@%
  12345.  
  12346. To change the value of a flag's setting, enter an opposite setting for the
  12347. flag you wish to set.  %@NL@%
  12348.  
  12349. %@AS@%  NV UP DI NG NZ AC PE NC - PLEICY%@AE@%
  12350.  
  12351. This example changes the sign flag to positive, enables interrupts, and sets
  12352. the carry flag.  %@NL@%
  12353.  
  12354. %@AS@%  rmsw%@AE@%
  12355.  
  12356. This example modifies the MSW (Machine Status Word) bits. The debugger
  12357. displays the status of the MSW register and prints a colon on the next line.
  12358. %@NL@%
  12359.  
  12360.  
  12361. %@2@%%@CR:C6A00090077 @%%@AB@%s ─ Search Bytes%@AE@%%@EH@%%@NL@%
  12362. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12363.  
  12364.  
  12365. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12366.  
  12367. %@AS@%  s range { list | "string" }%@AE@%
  12368.  
  12369. The %@AB@%s%@AE@% command searches an address range for a specified list of bytes or an
  12370. ASCII character string.  %@NL@%
  12371.  
  12372. You can include one or more bytes in %@AI@%list%@AE@%, but multiple bytes must be
  12373. separated by a space or comma. When you search for more than one byte, the
  12374. command returns only the first address of the byte string. When your %@AI@%list%@AE@%
  12375. contains only one byte, the debugger displays all addresses of the byte in
  12376. the %@AI@%range%@AE@%.  %@NL@%
  12377.  
  12378. %@TH:  12   652 02 34 42 @%
  12379. Parameter                         Description
  12380. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12381. %@AI@%range%@AE@%                             Specifies the range of addresses to be 
  12382.                                   searched.
  12383.  
  12384. %@AI@%list%@AE@%                              Specifies one or more byte values to 
  12385.                                   search for.
  12386.  
  12387. %@AI@%string%@AE@%                            Specifies an ASCII character string to 
  12388.                                   be searched for. The string must be 
  12389.                                   enclosed in quotation marks.
  12390.  
  12391. %@TE:  12   652 02 34 42 @%
  12392.  
  12393.  
  12394. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12395.  
  12396. %@AS@%  sCS:100 110 41%@AE@%
  12397.  
  12398. This example searches for byte 41 in the range CS:100 to CS:110. If it finds
  12399. the value, the command produces a display similar to the following:  %@NL@%
  12400.  
  12401. %@AS@%  04BA:0104
  12402. %@AS@%  04BA:010D%@AE@%
  12403.  
  12404.  
  12405. %@2@%%@CR:C6A00090078 @%%@AB@%t ─ Trace Instructions%@AE@%%@EH@%%@NL@%
  12406. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12407.  
  12408.  
  12409. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12410.  
  12411. %@AS@%  t«N» «=addr» «word»%@AE@%
  12412.  
  12413. The %@AB@%t%@AE@% command executes one or more instructions along with the default
  12414. command string, then displays the decoded instruction. If you include an
  12415. %@AI@%addr%@AE@% parameter, tracing starts at the specified address. Otherwise, the
  12416. command steps through the next machine instruction and then executes the
  12417. default command string.  %@NL@%
  12418.  
  12419. The %@AB@%t%@AE@% command uses the hardware trace mode of the Intel microprocessor.
  12420. Consequently, you can also trace instructions stored in ROM.  %@NL@%
  12421.  
  12422. %@TH:  14   835 02 34 42 @%
  12423. Parameter                         Description
  12424. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12425. %@AB@%N%@AE@%                                 Suppresses the register display so just 
  12426.                                   the assembly line is displayed. This 
  12427.                                   works only if the default command, %@AB@%z%@AE@%, is
  12428.                                   set to %@AB@%r%@AE@% (the normal setting).
  12429.  
  12430. %@AI@%addr%@AE@%                              Specifies the instruction address to 
  12431.                                   start tracing. The equal sign (=) is 
  12432.                                   required.
  12433.  
  12434. %@AI@%word%@AE@%                              Specifies the number of instructions to 
  12435.                                   execute and trace.
  12436.  
  12437. %@TE:  14   835 02 34 42 @%
  12438.  
  12439.  
  12440. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12441.  
  12442. %@AS@%  t%@AE@%
  12443.  
  12444. %@AS@%  AX=0E00  BX=00FF  CX=0007  DX=01FF  SP=039D  BP=0000  SI=005C  DI=0000
  12445. %@AS@%  IP=011A  CS=04BA  DS=04BA  ES=04BA  SS=04BA  NV UP DI NG NZ AC PE NC
  12446. %@AS@%  GDTR=01D700 3677  IDTR=020D7A 03FF  TR=0010  LDTR=0028 IOPL=3 MSW=PM 
  12447. %@AS@%  04BA:011A  CD21          PUSH   21%@AE@%
  12448.  
  12449. This example traces the current position (04BA:011A) and uses the default
  12450. command string (%@AB@%r%@AE@% command) to display registers.  %@NL@%
  12451.  
  12452. %@AS@%  t=011A 10%@AE@%
  12453.  
  12454. This command causes the debugger to execute 16 (10H) instructions beginning
  12455. at 011A in the current selector. The debugger executes and displays the
  12456. results of the default command string for each instruction. The display
  12457. scrolls until the last instruction is executed. Use CONTROL+S to stop the
  12458. display from scrolling, and CONTROL+Q to resume.  %@NL@%
  12459.  
  12460.  
  12461. %@2@%%@CR:C6A00090079 @%%@AB@%u ─ Unassemble Bytes%@AE@%%@EH@%%@NL@%
  12462. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12463.  
  12464.  
  12465. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12466.  
  12467. %@AS@%  u range%@AE@%
  12468.  
  12469. The %@AB@%u%@AE@% command disassembles bytes and displays the source statements, with
  12470. addresses and byte values, that correspond to them.  %@NL@%
  12471.  
  12472. The display of disassembled code looks similar to a code listing for an
  12473. assembled file. If you type the %@AB@%u%@AE@% command by itself, 20H bytes are
  12474. disassembled at the first address after the one displayed by the previous %@AB@%u%@AE@%
  12475. command.  %@NL@%
  12476.  
  12477. %@TH:   7   479 02 34 42 @%
  12478. Parameter                         Description
  12479. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12480. %@AI@%range%@AE@%                             Specifies the range of addresses in 
  12481.                                   which instructions are to be 
  12482.                                   disassembled. If no %@AI@%range%@AE@% is given, the 
  12483.                                   command disassembles the next 20H bytes.
  12484.  
  12485. %@TE:   7   479 02 34 42 @%
  12486.  
  12487.  
  12488. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12489.  
  12490. %@AS@%  uCS:046C%@AE@%
  12491.  
  12492. This example returns a display similar to the following:  %@NL@%
  12493.  
  12494. %@AS@%  1A60:046C C3               RET
  12495. %@AS@%  1A60:046D 9A6B3E100D       CALL  0D10:3E6B
  12496. %@AS@%  1A60:0472 33C0             XOR  AX,AX
  12497. %@AS@%  1A60:0474 50               PUSH  AX
  12498. %@AS@%  1A60:0475 9D               POPF
  12499. %@AS@%  1A60:0476 9C               PUSHF 
  12500. %@AS@%  1A60:0477 58               POP  AX 
  12501. %@AS@%  1A60:0478 2500F0           AND  AX,F000
  12502. %@AS@%  1A60:047B 3D00F0           CMP  AX,F000  
  12503. %@AS@%  1A60:047E 7508             JNZ  0488       
  12504. %@AS@%  1A60:0480 689C26           PUSH  269C        
  12505. %@AS@%  1A60:0483 9AF105100D       CALL  0D10:05F1                    %@AE@%
  12506.  
  12507. If the bytes in some addresses are altered, the disassembler alters the
  12508. instruction statements. You can also use the %@AB@%u%@AE@% command for the changed
  12509. locations, for the new instructions viewed, and for the disassembled code
  12510. used to edit the source file.  %@NL@%
  12511.  
  12512.  
  12513. %@2@%%@CR:C6A00090080 @%%@AB@%v ─ Set Interrupt Vector Trapping%@AE@%%@EH@%%@NL@%
  12514. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12515.  
  12516.  
  12517. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12518.  
  12519. %@AS@%  v«1 | 3»%@AE@%
  12520.  
  12521. The %@AB@%v%@AE@% command is used to specify which privilege rings should have
  12522. interrupts 1 and 3 trapped. This is useful for allowing the 80386 Debugger
  12523. to coexist with other debuggers such as the Symbolic Debugger (%@AB@%SYMDEB%@AE@%) and
  12524. CodeView for Windows (%@AB@%CVW%@AE@%). The 80386 Debugger handles interrupts 1 and 3
  12525. which occur in any privilege rings where trapping is enabled, but reflects
  12526. the interrupts if trapping is disabled, so that the secondary debugger will
  12527. see them. To use the command, enter v1 or v3 as the command with no
  12528. parameters. %@AB@%WDEB386%@AE@% then displays the current rings for which trapping is
  12529. enabled. For example:  %@NL@%
  12530.  
  12531. %@AS@%  #v1
  12532. %@AS@%  Rings trapped for int 1 - 0 1 2 3 V
  12533. %@AS@%  ? +%@AE@%
  12534.  
  12535. The question mark (?) is displayed to prompt you for changes. The plus sign
  12536. (+) indicates that you are in enabling mode, so you can just press 0, 1, 2,
  12537. 3, or V to enable trapping in the required ring. If you need to disable
  12538. trapping in any rings, then press HYPHEN ( - ); this will change the plus
  12539. sign to a minus sign, indicating that you are now disabling trapping.
  12540. Pressing PLUS SIGN ( + ) will get you back into enabling mode. Any number of
  12541. changes can be made at one time. The current mode is displayed after each
  12542. change. For example:  %@NL@%
  12543.  
  12544. %@AS@%  #v1
  12545. %@AS@%  Rings trapped for int 1 - 0 2 V
  12546. %@AS@%  ? +1 +3 -2 -%@AE@%
  12547.  
  12548. This command sequence was created by pressing 1, 3, HYPHEN, 2, and ENTER or
  12549. the SPACEBAR. It enabled trapping INT 1 instructions in rings 1 and 3 and
  12550. disabled trapping in ring 2.  %@NL@%
  12551.  
  12552.  
  12553. %@2@%%@CR:C6A00090081 @%%@AB@%vl ─ Display Interrupt Trapping Information%@AE@%%@EH@%%@NL@%
  12554. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12555.  
  12556.  
  12557. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12558.  
  12559. %@AS@%  vl%@AE@%
  12560.  
  12561. This command shows which privilege rings have trapping enabled for
  12562. interrupts 1 and 3. The %@AB@%v%@AE@% command can be used to enable or disable trapping
  12563. in specific privilege rings.  %@NL@%
  12564.  
  12565.  
  12566. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12567.  
  12568. %@AS@%  vl
  12569. %@AS@%  Rings trapped for int 1 - 0 1 2 3 V
  12570. %@AS@%  Rings trapped for int 3 - 0 1 2 3 V%@AE@%
  12571.  
  12572.  
  12573. %@2@%%@CR:C6A00090082 @%%@AB@%w ─ Change Map%@AE@%%@EH@%%@NL@%
  12574. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12575.  
  12576.  
  12577. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12578.  
  12579. %@AS@%  w «map-name»%@AE@%
  12580.  
  12581. The %@AB@%w%@AE@% command changes the active map file.  %@NL@%
  12582.  
  12583. %@TH:  12   768 02 34 42 @%
  12584. Parameter                         Description
  12585. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12586. %@AI@%map-name%@AE@%                          Specifies the name of the map file you 
  12587.                                   want to make active. Use the %@AB@%lm%@AE@% (List 
  12588.                                   Map) command to display a list of 
  12589.                                   available map files.
  12590.  
  12591.                                   If %@AI@%map-name%@AE@% is not specified, then the 
  12592.                                   loaded maps are displayed and the user 
  12593.                                   is prompted to select a map by pressing 
  12594.                                   its corresponding option number.
  12595.  
  12596. %@TE:  12   768 02 34 42 @%
  12597.  
  12598.  
  12599. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  12600.  
  12601. %@AS@%  lm
  12602. %@AS@%  COMSAM2D is active.
  12603. %@AS@%  DISK01D.
  12604. %@AS@%  w DISK01D%@AE@%
  12605.  
  12606. The first example displays the loaded map files using the %@AB@%lm%@AE@% command, then
  12607. sets the active map file to DISK01D.  %@NL@%
  12608.  
  12609. %@AS@%  W
  12610. %@AS@%  1. KERNEL
  12611. %@AS@%  2. Win386 is active
  12612. %@AS@%  activate which map?%@AE@%
  12613.  
  12614. The second example shows selecting the desired map from the list of
  12615. available maps. At the prompt, pressing 1 will activate the KERNEL map;
  12616. pressing 2 will leave the Win386 map activated; pressing the SPACEBAR will
  12617. leave the current map activated; any other key will be ignored and the
  12618. debugger will continue to wait for input.  %@NL@%
  12619.  
  12620.  
  12621. %@2@%%@CR:C6A00090083 @%%@AB@%y ─ Debugger Option Command%@AE@%%@EH@%%@NL@%
  12622. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12623.  
  12624.  
  12625. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12626.  
  12627. %@AS@%  y [? | 386env | dislwr | regterse | codebytes | symaddrs]%@AE@%
  12628.  
  12629. This command allows the debugger configuration to be changed. The %@AB@%?%@AE@% option
  12630. prints the current options supported. The %@AB@%y%@AE@% command by itself prints the
  12631. current state of the options. The %@AB@%y%@AE@% and a flag name sets or toggles an
  12632. options flag.  %@NL@%
  12633.  
  12634. %@AS@%  386env - 32 bit environment (toggles)
  12635. %@AS@%  dislwr - lower case disassembly (toggles)
  12636. %@AS@%  regterse - terse register set (toggles)
  12637. %@AS@%  codebytes - terse instruction disassembly (toggles)
  12638. %@AS@%  symaddrs - symbols and addresses (toggles)%@AE@%
  12639.  
  12640. All these flags toggle their state when set and are printed only when the
  12641. option is on.  %@NL@%
  12642.  
  12643. The %@AB@%386env%@AE@% flag controls the size of addresses and registers, when
  12644. displayed. When this option is on, addresses, registers, etc., are printed
  12645. in 32-bit formats; otherwise they are printed in 16-bit formats. This flag
  12646. has nothing to do with the CPU (286/386) the debugger is running on, only
  12647. the display sizes.  %@NL@%
  12648.  
  12649. The %@AB@%dislwr%@AE@% flag controls the disassembler's lowercase option. When the flag
  12650. is on, disassembly is in lowercase.  %@NL@%
  12651.  
  12652. The %@AB@%regterse%@AE@% flag controls the number of registers that are displayed in the
  12653. register dump command. In the 386 environment (%@AB@%386env%@AE@% on), when the %@AB@%regterse%@AE@%
  12654. flag is on, only the first three lines are displayed (instead of the normal
  12655. six-line-plus disassembly line display). In the 286 environment (%@AB@%386env%@AE@%
  12656. off), only the first two lines of the normal three-line display (plus the
  12657. disassembly line) are printed.  %@NL@%
  12658.  
  12659. The %@AB@%codebytes%@AE@% flag controls the display of the actual code bytes when
  12660. disassembling.  %@NL@%
  12661.  
  12662. The %@AB@%symaddrs%@AE@% flag controls showing just a symbol name or symbol name and
  12663. address when disassembling.  %@NL@%
  12664.  
  12665.  
  12666. %@2@%%@CR:C6A00090084 @%%@AB@%z ─ Zap Embedded INT 1 and INT 3 Instructions%@AE@%%@EH@%%@NL@%
  12667. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12668.  
  12669.  
  12670. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12671.  
  12672. %@AS@%  z%@AE@%
  12673.  
  12674. Zaps the current INT 3 or the previous INT 1 instruction, by replacing the
  12675. instruction bytes with NOP instructions. This allows the user to avoid INT 1
  12676. or INT 3 instructions that were assembled into the executable file from
  12677. breaking into the debugger more than once.  %@NL@%
  12678.  
  12679.  
  12680. %@2@%%@CR:C6A00090085 @%%@AB@%zd ─ Execute Default Command String%@AE@%%@EH@%%@NL@%
  12681. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12682.  
  12683.  
  12684. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12685.  
  12686. %@AS@%  zd%@AE@%
  12687.  
  12688. The %@AB@%zd%@AE@% command executes the default command string.  %@NL@%
  12689.  
  12690. The default command string is initially set to the %@AB@%r%@AE@% (Display Registers)
  12691. command by the debugger. The default command string is executed every time a
  12692. breakpoint is encountered during program execution or whenever a %@AB@%p%@AE@% (Program
  12693. Trace) or %@AB@%t%@AE@% (Trace Instructions) command is executed.  %@NL@%
  12694.  
  12695. Use the %@AB@%zl%@AE@% command to display the default command string and the %@AB@%zs%@AE@% command
  12696. to change the default command string.  %@NL@%
  12697.  
  12698.  
  12699. %@2@%%@CR:C6A00090086 @%%@AB@%zl ─ Display Default Command String%@AE@%%@EH@%%@NL@%
  12700. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12701.  
  12702.  
  12703. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12704.  
  12705. %@AS@%  zl%@AE@%
  12706.  
  12707. The %@AB@%zl%@AE@% command displays the default command string.  %@NL@%
  12708.  
  12709.  
  12710. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12711.  
  12712. %@AS@%  zl
  12713. %@AS@%  "R"%@AE@%
  12714.  
  12715. This example displays the default command string.  %@NL@%
  12716.  
  12717.  
  12718. %@2@%%@CR:C6A00090087 @%%@AB@%zs ─ Change Default Command String%@AE@%%@EH@%%@NL@%
  12719. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12720.  
  12721.  
  12722. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  12723.  
  12724. %@AS@%  zs "string"%@AE@%
  12725.  
  12726. The %@AB@%zs%@AE@% command lets you change the default command string.  %@NL@%
  12727.  
  12728. %@TH:   8   536 02 34 42 @%
  12729. Parameter                         Description
  12730. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12731. %@AI@%string%@AE@%                            Specifies the new default command string.
  12732.                                   The string must be enclosed in single or
  12733.                                   double quotation marks. You must 
  12734.                                   separate the debugger commands within 
  12735.                                   the string with semicolons.
  12736.  
  12737. %@TE:   8   536 02 34 42 @%
  12738.  
  12739.  
  12740. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  12741.  
  12742. %@AS@%  zs "r;c100 L 100 300"%@AE@%
  12743.  
  12744. This example changes the current default command string to an %@AB@%r%@AE@% (Display
  12745. Register) command followed by a %@AB@%c%@AE@% (Compare Memory) command.  %@NL@%
  12746.  
  12747. %@AS@%  zs "j (by cs:ip) == cc 'g'"%@AE@%
  12748.  
  12749. This example begins execution whenever an INT 3 instruction is executed in
  12750. your test program. This will execute a %@AB@%g%@AE@% (Go) command every time an INT 3
  12751. instruction is executed.  %@NL@%
  12752.  
  12753. You can use %@AB@%zs%@AE@% to set up a watchpoint as follows:  %@NL@%
  12754.  
  12755. %@AS@%  zs "j (wo 40:1234) == 0eeed;t"%@AE@%
  12756.  
  12757. This command traces until the word at 40:1234 is %@AI@%not%@AE@% equal to 0EEED. This
  12758. won't work if you are tracing through the mode switching code in DOS or
  12759. other sections of code that can't be traced.  %@NL@%
  12760.  
  12761.  
  12762.  
  12763.  
  12764.  
  12765. %@2@%%@CR:C6A00090088 @%%@AB@%9.6 386 Enhanced Windows Environment Commands%@AE@%%@EH@%%@NL@%
  12766.  
  12767. These commands are specific to the operating environment of Windows running
  12768. in 386 enhanced mode. These commands are always dot commands, and are in
  12769. addition to the common commands documented in the previous section.  %@NL@%
  12770.  
  12771. All of these commands are listed when the %@AB@%.?%@AE@% command is executed.  %@NL@%
  12772.  
  12773. %@TH: 120  7389 02 34 42 @%
  12774. Command                           Description
  12775. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12776. %@AB@%.DG%@AE@%                               Calls Windows to dump its global heap 
  12777.                                   when Windows is installed.
  12778.  
  12779. %@AB@%.DF%@AE@%                               Calls Windows to dump its free list when
  12780.                                   Windows is installed. 
  12781.  
  12782. %@AB@%.DL%@AE@%                               Calls Windows to dump the LRU list when 
  12783.                                   Windows is installed. 
  12784.  
  12785. %@AB@%.VM%@AE@%                               Displays the status of the current 
  12786.                                   virtual machine (VM). Status information
  12787.                                   includes reentry count, VM handle, 
  12788.                                   critical section state, client registers,
  12789.                                   and top entries from the client's stack.
  12790.  
  12791. %@AB@%.VC%@AE@%                               Displays the standard fields of the 
  12792.                                   current VM's control block.
  12793.  
  12794. %@AB@%.VH%@AE@%                               Displays the current VM's handle.
  12795.  
  12796. %@AB@%.VR%@AE@%                               Displays the current VM's client 
  12797.                                   registers, if the debugger is in 
  12798.                                   protected mode.
  12799.  
  12800. %@AB@%.VS%@AE@%                               Displays the current VM's virtual mode 
  12801.                                   stack, if the debugger is in protected 
  12802.                                   mode.
  12803.  
  12804. %@AB@%.VL%@AE@%                               Displays a list of all valid VM handles.
  12805.  
  12806. %@AB@%.T%@AE@%                                Toggles the fault logging flag. When 
  12807.                                   fault logging is turned on, all system 
  12808.                                   faults (hardware interrupts, general 
  12809.                                   protection faults, page faults, illegal 
  12810.                                   instruction faults, and so on) are 
  12811.                                   logged, with the registers at the time 
  12812.                                   of the fault, and so on. This list of 
  12813.                                   logged faults can then be viewed with 
  12814.                                   the %@AB@%.S%@AE@%, %@AB@%.SS,%@AE@% or %@AB@%.SL%@AE@% commands.
  12815.  
  12816. %@AB@%.S%@AE@% [%@AI@%item_num%@AE@%]                     Displays fault logging information in a 
  12817.                                   single line-condensed form. If an %@AI@%%@AE@%
  12818.                                   %@AI@%item_num%@AE@% parameter is given, then the 
  12819.                                   list starts with the specified log item;
  12820.                                   otherwise it starts with the last (most 
  12821.                                   recent) log item. The list is displayed 
  12822.                                   from most recent to less recent order. 
  12823.                                   It displays item number, fault number, 
  12824.                                   VM handle at the time of fault, critical
  12825.                                   section state, client's CS:IP; and, in 
  12826.                                   the case of general protection faults, 
  12827.                                   the executed instruction. The display 
  12828.                                   will look like the following:
  12829.  
  12830.                                   %@AS@%= 00003BB8: 000D 60441000 00 01 %@AE@%
  12831.                                   %@AS@%02B7:23F5 INT     2A    00008002%@AE@%
  12832.  
  12833.                                   The first number (00003BB8) is the log 
  12834.                                   item number. The second number (000D) is
  12835.                                   the fault (interrupt) number (0Dh = 
  12836.                                   General Protection). The next number 
  12837.                                   (60441000) is the VM handle of the VM 
  12838.                                   interrupted.
  12839.  
  12840.                                   The next two numbers (00) and (01) are 
  12841.                                   the critical section claim counts at the
  12842.                                   start and end of the fault handling. So,
  12843.                                   in this example, the critical section 
  12844.                                   was unclaimed on entry, but the fault 
  12845.                                   handler claimed it before exiting.
  12846.  
  12847.                                   The next number (02B7:23F5) is the 
  12848.                                   client's CS:IP at the time of the 
  12849.                                   interrupt. (INT 2A) is the instruction 
  12850.                                   that the client attempted to execute, 
  12851.                                   causing the protection fault.
  12852.  
  12853.                                   The last number (00008002) is the value 
  12854.                                   of EAX register. This number is given 
  12855.                                   since it is commonly used for software 
  12856.                                   interrupt function number selection, and
  12857.                                   since all software interrupts done in 
  12858.                                   virtual 8086 mode will show in this log.
  12859.                                   This allows the programmer to see the 
  12860.                                   most about each fault in a single line. 
  12861.                                   When the faulting instruction is an IN 
  12862.                                   or OUT instruction, DX and EAX will be 
  12863.                                   displayed as appropriate.
  12864.  
  12865.                                   After each screenful of display, the 
  12866.                                   debugger pauses, waiting for the user to
  12867.                                   press a key to continue. Pressing ESCAPE
  12868.                                   or CONTROL+C aborts any further listing.
  12869.                                   This command clears the fault logging 
  12870.                                   flag, to disable further logging.
  12871.  
  12872. %@AB@%.SL%@AE@% [%@AI@%item_num%@AE@%]                    Displays complete fault logging 
  12873.                                   information. If a log item number is 
  12874.                                   specified, then just the one fault's 
  12875.                                   information is displayed, starting with 
  12876.                                   the condensed line, then the register 
  12877.                                   state at the start of the fault, and 
  12878.                                   then the register state at the end. If 
  12879.                                   no item number is specified, then all 
  12880.                                   log items are displayed, starting with 
  12881.                                   the last log item. This list shows the 
  12882.                                   log number, fault number, VM handle, 
  12883.                                   client registers, and instruction (if 
  12884.                                   the item is the end-of-fault item.)
  12885.  
  12886.                                   Screen handling is performed exactly as 
  12887.                                   in the %@AB@%.S%@AE@% command.
  12888.  
  12889. %@AB@%.DS%@AE@%                               Dumps the protected-mode stack and 
  12890.                                   displays near code segment labels (if 
  12891.                                   available) next to each%@AB@% DWORD%@AE@% from the 
  12892.                                   stack.
  12893.  
  12894. %@TE: 120  7389 02 34 42 @%
  12895.  
  12896. The following %@AB@%M%@AE@%%@AI@%x%@AE@% commands are for debugging the 386-enhanced-mode Windows
  12897. environment memory manager. They are probably of little use to other
  12898. programmers.  %@NL@%
  12899.  
  12900. %@TH:  45  2449 02 34 42 @%
  12901. Command                           Description
  12902. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12903. %@AB@%.MH%@AE@% [%@AI@%handle%@AE@%]                      Displays the 386-enhanced-mode Windows 
  12904.                                   heap information about a specific handle,
  12905.                                   if specified; otherwise global 
  12906.                                   information is displayed.
  12907.  
  12908. %@AB@%.MM%@AE@% [%@AI@%handle%@AE@%]                      Displays the 386-enhanced-mode Windows 
  12909.                                   memory information, such as free and 
  12910.                                   locked pages, if no handle is specified.
  12911.                                   Otherwise, it displays information about
  12912.                                   the memory handle such as size and 
  12913.                                   linear address.
  12914.  
  12915. %@AB@%.MV%@AE@%                               Displays the memory handles that are 
  12916.                                   allocated to the current VM.
  12917.  
  12918. %@AB@%.MS PFT%@AE@%%@AI@%addr%@AE@%                       Displays PFT (paged memory) information.
  12919.  
  12920. %@AB@%.MF%@AE@%                               Displays the current free list.
  12921.  
  12922. %@AB@%.MI%@AE@%                               Displays instanced data regions.
  12923.  
  12924. %@AB@%.VMM%@AE@%                              This command displays a menu of 
  12925.                                   subcommands. Pressing a single character
  12926.                                   selects and executes the listed command.
  12927.  
  12928. %@AB@%.device-name%@AE@%                      This command calls the indicated virtual
  12929.                                   device so that it can dump information 
  12930.                                   relevant for debugging it.
  12931.  
  12932. %@AB@%.LQ%@AE@%                               Displays queue outs from the most 
  12933.                                   recent.
  12934.  
  12935. %@AB@%.ML%@AE@% %@AI@%lin_addr%@AE@%                      Displays page-table information for the 
  12936.                                   given linear address.
  12937.  
  12938. %@AB@%.MP%@AE@% %@AI@%phys_addr%@AE@%                     Displays all linear addresses that map 
  12939.                                   the given physical address.
  12940.  
  12941. %@AB@%.MD%@AE@%                               Changes the debug MONO paging display.
  12942.  
  12943. %@AB@%MO%@AE@%                                Schedules a page-out event of all 
  12944.                                   present pages that are not locked.
  12945.  
  12946. %@TE:  45  2449 02 34 42 @%
  12947.  
  12948.  
  12949. %@2@%%@CR:C6A00090089 @%%@AB@%9.7 Summary%@AE@%%@EH@%%@NL@%
  12950.  
  12951. The 80386 Debugger is a tool that lets you debug Windows applications in
  12952. protected (standard or 386 enhanced) mode on systems with an 80386 CPU. It
  12953. offers more advanced debugging features not available in CodeView for
  12954. Windows, but lacks %@AB@%CVW%@AE@%'s more convenient user interface.  %@NL@%
  12955.  
  12956. For more information related to the 80386 Debugger, see the following:  %@NL@%
  12957.  
  12958. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  12959. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12960. Programming Windows applications  %@AI@%Guide to Programming%@AE@%
  12961.  
  12962. System requirements               %@AI@%Installation and Update Guide%@AE@%
  12963.  
  12964.  
  12965.  
  12966.  
  12967.  
  12968.  
  12969. %@CR:C6A00100001 @%%@1@%%@AB@%Chapter 10  Monitoring Messages: Spy%@AE@%%@EH@%%@NL@%
  12970. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12971.  
  12972. Microsoft Windows Spy (%@AB@%SPY%@AE@%) monitors system messages sent to a specified
  12973. application window. Spy records the messages and displays them on a
  12974. specified device.%@CR:C6A00100002 @%%@CR:C6A00100003 @%%@NL@%
  12975.  
  12976. Spy is useful for verifying that the messages you think a window is
  12977. receiving are being received. It is also helpful for examining the values of
  12978. message parameters.  %@NL@%
  12979.  
  12980. ────────────────────────────────────────────────────────────────────────────%@NL@%
  12981. NOTE
  12982.  
  12983. %@AI@%If you are using CodeView for Windows to debug your application, you can use
  12984. %@AI@%CodeView instead of Spy to trace messages.%@AE@%
  12985. ────────────────────────────────────────────────────────────────────────────%@NL@%
  12986.  
  12987. This chapter describes the following:  %@NL@%
  12988.  
  12989.  
  12990.   ■   Displaying messages%@NL@%
  12991.  
  12992.   ■   Choosing options%@NL@%
  12993.  
  12994.   ■   Choosing a window%@NL@%
  12995.  
  12996.   ■   Turning Spy on and off
  12997. %@NL@%
  12998.  
  12999.  
  13000.  
  13001. %@2@%%@CR:C6A00100004 @%%@AB@%10.1  Displaying Messages%@AE@%%@EH@%%@NL@%
  13002.  
  13003. To watch messages, do the following:%@CR:C6A00100005 @%%@NL@%
  13004.  
  13005.  
  13006.   1.  Choose the Options menu to display the Options dialog box and select
  13007.       the following:
  13008.  
  13009.       ■   The kind of message you want to watch%@NL@%
  13010.  
  13011.       ■   The output device to which you want messages to go%@NL@%
  13012.  
  13013.       ■   Whether you want Spy to display messages synchronously or
  13014.           asynchronously%@NL@%
  13015. %@NL@%
  13016.  
  13017.   2.  Select the window whose messages you want to watch by choosing the
  13018.       Window command from the Window menu.%@NL@%
  13019.  
  13020.   3.  Click the window you want to watch. To stop watching messages, choose
  13021.       the Spy Off command from the Spy menu.%@NL@%
  13022.  
  13023.  
  13024. Figure 10.1 illustrates the Spy window.  %@NL@%
  13025.  
  13026. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13027.  
  13028.  
  13029. %@2@%%@CR:C6A00100006 @%%@AB@%10.2  Choosing Options%@AE@%%@EH@%%@NL@%
  13030.  
  13031. The Options menu displays a dialog box that offers you the following
  13032. choices:  %@NL@%
  13033.  
  13034.  
  13035.   ■   The kind of message you want to watch%@NL@%
  13036.  
  13037.   ■   The output device to which you want samples to go%@NL@%
  13038.  
  13039.   ■   Whether or not Spy sends samples to the output device synchronously or
  13040.       asynchronously%@NL@%
  13041.  
  13042.  
  13043. The following sections describe how to choose these options.  %@NL@%
  13044.  
  13045.  
  13046. %@3@%%@CR:C6A00100007 @%%@AB@%10.2.1  Choosing Messages%@AE@%%@EH@%%@NL@%
  13047.  
  13048. The Options menu displays a dialog box that offers the following choices:%@CR:C6A00100008 @%%@NL@%
  13049.  
  13050. %@AB@%Message%@AE@%                           %@AB@%Description%@AE@%
  13051. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13052. Mouse                             Mouse-related messages, such as
  13053.                                   WM_MOUSEMOVE and WM_SETCURSOR.
  13054.  
  13055. Input                             Input-related messages, such as WM_CHAR 
  13056.                                   and WM_COMMAND.
  13057.  
  13058. System                            System-wide messages, such as
  13059.                                   WM_ENDSESSION and WM_TIMECHANGE.
  13060.  
  13061. %@AB@%Message%@AE@%                           %@AB@%Description%@AE@%
  13062. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13063. Window                            Window manager messages, such as WM_SIZE
  13064.                                   and WM_SHOWWINDOW.
  13065.  
  13066. Init                              Initialization messages, such as 
  13067.                                   WM_INITMENU and WM_INITDIALOG.
  13068.  
  13069. Clipboard                         Clipboard messages, such as
  13070.                                   WM_RENDERFORMAT.
  13071.  
  13072. Other                             Messages other than the types explicitly
  13073.                                   listed.
  13074.  
  13075. DDE                               Dynamic Data Exchange messages, such as 
  13076.                                   WM_DDE_REQUEST.
  13077.  
  13078. Non Client                        Windows nonclient messages, such as
  13079.                                   WM_NCDESTROY and WM_NCHITTEST.
  13080.  
  13081. By default, Spy monitors all messages.%@CR:C6A00100009 @%%@CR:C6A00100010 @%%@CR:C6A00100011 @%%@CR:C6A00100012 @%%@CR:C6A00100013 @%%@CR:C6A00100014 @%%@NL@%
  13082.  
  13083.  
  13084. %@3@%%@CR:C6A00100015 @%%@AB@%10.2.2  Choosing the Output Device%@AE@%%@EH@%%@NL@%
  13085.  
  13086. You can specify that Spy send messages to the following output devices:%@CR:C6A00100016 @%%@NL@%
  13087.  
  13088. %@AB@%Device%@AE@%                            %@AB@%Description%@AE@%
  13089. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13090. Window                            Spy displays messages in the Spy window.
  13091.                                   You can specify how many messages Spy 
  13092.                                   stores in its buffer. By default, it 
  13093.                                   stores 100 lines of messages which you 
  13094.                                   can view by scrolling through the Spy 
  13095.                                   window.
  13096.  
  13097. Com1                              Spy sends messages to the COM1 port.
  13098.  
  13099. File                              Spy sends messages to the specified file.
  13100.                                   The default output file is SPY.OUT.
  13101.  
  13102.  
  13103. %@3@%%@CR:C6A00100017 @%%@AB@%10.2.3  Choosing Frequency of Output%@AE@%%@EH@%%@NL@%
  13104.  
  13105. The following options specify whether Spy sends messages to the output
  13106. device as Spy receives them, or queues messages before sending them:%@CR:C6A00100018 @%%@NL@%
  13107.  
  13108. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  13109. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13110. Synchronous                       Spy displays messages as it receives 
  13111.                                   them.
  13112.  
  13113. Asynchronous                      Spy queues messages for display.
  13114.  
  13115. By default, Spy sends messages synchronously.%@CR:C6A00100019 @%%@NL@%
  13116.  
  13117.  
  13118. %@2@%%@CR:C6A00100020 @%%@AB@%10.3  Choosing a Window: The Window Menu%@AE@%%@EH@%%@NL@%
  13119.  
  13120. After specifying message options, use the Window menu to choose the window
  13121. you want Spy to watch. The Window menu contains the following commands:%@CR:C6A00100021 @%%@CR:C6A00100022 @%%@NL@%
  13122.  
  13123. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  13124. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13125. Window...                         Specifies the window that Spy watches. 
  13126.                                   When you choose the Window... command, 
  13127.                                   Spy displays a dialog box that contains 
  13128.                                   information for the window in which the 
  13129.                                   cursor is located. As you move the 
  13130.                                   cursor from window to window, the 
  13131.                                   following information changes:
  13132.  
  13133.                                   ■ Window─Handle to the window
  13134.  
  13135.                                   ■ Class─Window class
  13136.  
  13137.                                   ■ Module─Program that created the window
  13138.  
  13139.                                   ■ Parent─Handle to the parent window and
  13140.                                   the name of the program that created the
  13141.                                   parent window
  13142.  
  13143.                                   ■ Rect─Upper-right and lower-left 
  13144.                                   coordinates of the window and the window
  13145.                                   size in screen coordinates
  13146.  
  13147.                                   ■ Style─Style bits of the window under 
  13148.                                   the cursor, the principal style of the 
  13149.                                   window, and an identifier, if the window
  13150.                                   is a child window. The principal style 
  13151.                                   can be WS_POPUP, WS_ICONIC, 
  13152.                                   WS_OVERLAPPED, or WS_CHILD.
  13153.  
  13154. All Windows                       Specifies that Spy watches all windows. 
  13155.                                   Choose the All Windows command again to 
  13156.                                   direct Spy to stop watching all windows.
  13157.  
  13158. Clear Window                      Clears the Spy window of messages.
  13159.  
  13160.  
  13161. %@2@%%@CR:C6A00100023 @%%@AB@%10.4  Turning Spy On and Off: The Spy Menu%@CR:C6A00100024 @%%@AE@%%@EH@%%@NL@%
  13162.  
  13163. After selecting a window to monitor, turn Spy on by clicking the window and
  13164. choosing OK in the dialog box.  %@NL@%
  13165.  
  13166. To stop monitoring messages, or to resume monitoring messages, or to exit
  13167. Spy, use the Spy menu. The Spy menu contains the following commands:  %@NL@%
  13168.  
  13169. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  13170. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13171. Spy On/Off                        Starts and stops message monitoring.
  13172.  
  13173. Exit                              Exits Spy.
  13174.  
  13175. About Spy...                      Provides information about the version 
  13176.                                   of Spy you are using.
  13177.  
  13178.  
  13179. %@2@%%@CR:C6A00100025 @%%@AB@%10.5  Summary%@AE@%%@EH@%%@NL@%
  13180.  
  13181. Spy is a tool that lets you monitor messages sent to a specified window. For
  13182. more information about topics related to Spy, see the following:  %@NL@%
  13183.  
  13184. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  13185. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13186. Input messages                    %@AI@%Guide to Programming%@AE@%: Chapter 4, 
  13187.                                   "Keyboard and Mouse Input" %@AI@%%@AE@%
  13188.  
  13189. Message syntax and content        %@AI@%Reference, Volume 1%@AE@%: Chapter 6, 
  13190.                                   "Messages Directory" %@AI@%%@AE@%
  13191.  
  13192.  
  13193.  
  13194.  
  13195.  
  13196.  
  13197. %@CR:C6A00110001 @%%@1@%%@AB@%Chapter 11  Viewing the Heap: Heap Walker%@AE@%%@EH@%%@NL@%
  13198. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13199.  
  13200. Microsoft Windows Heap Walker (%@AB@%HEAPWALK%@AE@%) lets you examine the global heap,
  13201. the system memory that DOS reserves for Windows use. The utility displays
  13202. information about memory segments, or objects. Heap Walker is useful for
  13203. analyzing the effects your application has when it allocates objects in the
  13204. global heap.%@CR:C6A00110002 @%%@CR:C6A00110003 @%%@NL@%
  13205.  
  13206. This chapter describes the following topics:  %@NL@%
  13207.  
  13208.  
  13209.   ■   How Heap Walker views memory%@NL@%
  13210.  
  13211.   ■   The Heap Walker window%@NL@%
  13212.  
  13213.   ■   Using Heap Walker commands to examine the global heap
  13214. %@NL@%
  13215.  
  13216.  
  13217.  
  13218. %@2@%%@CR:C6A00110004 @%%@AB@%11.1  How Heap Walker Views Memory%@AE@%%@EH@%%@NL@%
  13219.  
  13220. Heap Walker displays the global heap when Windows is running in either
  13221. protected or real mode. The heap differs from one mode to the other. The
  13222. following sections describe the differences.  %@NL@%
  13223.  
  13224.  
  13225. %@3@%%@CR:C6A00110005 @%%@AB@%11.1.1  Viewing the Heap in Protected Mode%@AE@%%@EH@%%@NL@%
  13226.  
  13227. If Windows is running in protected (standard or 386 enhanced) mode, the heap
  13228. is an area of memory that starts above DOS, TSR, and system drivers.  %@NL@%
  13229.  
  13230. When viewing the heap in protected mode, Heap Walker identifies objects by
  13231. selector. The CPU uses selectors to indirectly specify memory addresses.%@CR:C6A00110006 @%%@NL@%
  13232.  
  13233.  
  13234. %@3@%%@CR:C6A00110007 @%%@AB@%11.1.2  Viewing the Heap in Real Mode%@AE@%%@EH@%%@NL@%
  13235.  
  13236. If Windows is running in real mode, the heap can consist of one of the
  13237. following:%@CR:C6A00110008 @%%@NL@%
  13238.  
  13239.  
  13240.   ■   The heap that starts above DOS, TSR programs, and system drivers, and
  13241.       ends at the top of DOS memory.%@NL@%
  13242.  
  13243.   ■   The heap that Windows uses in real mode plus expanded memory that
  13244.       Windows can map into the 1-megabyte address space. Windows accesses
  13245.       this area of memory using handles to appropriate segments. This access
  13246.       mechanism, called the Expanded Memory Specification (EMS), is
  13247.       transparent to an application.%@CR:C6A00110009 @% %@CR:C6A00110010 @%%@NL@%
  13248.  
  13249.  
  13250.  
  13251. %@2@%%@CR:C6A00110011 @%%@AB@%11.2  The Heap Walker Window%@AE@%%@EH@%%@NL@%
  13252.  
  13253. Figure 11.1 illustrates the Heap Walker window after the user has executed a
  13254. Walk command.%@CR:C6A00110012 @%%@NL@%
  13255.  
  13256. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13257.  
  13258. By default, Heap Walker displays all global objects in the area of memory
  13259. below the EMS line, starting at the bottom of the heap. To display objects
  13260. in the heap that includes expanded memory, use the EMS menu described in
  13261. Table 11.2, "Walk Commands."  %@NL@%
  13262.  
  13263. Whether you examine the heap below the line or the EMS heap, Heap Walker
  13264. displays the following information about each object:%@CR:C6A00110013 @%%@NL@%
  13265.  
  13266.  
  13267.   ■   ADDR (real mode only)─Segment of the object arena header; the object
  13268.       starts one paragraph later.%@NL@%
  13269.  
  13270.   ■   SLCT (protected mode only)─Selector of the object.%@NL@%
  13271.  
  13272.   ■   HANDL─Handle of the memory object.%@NL@%
  13273.  
  13274.   ■   SIZE─Size of the object, in bytes.%@NL@%
  13275.  
  13276.   ■   LOCK─Lock count of the object.%@NL@%
  13277.  
  13278.   ■   FLAG─"D" if the object is discardable; "S" if it is shareable.%@NL@%
  13279.  
  13280.   ■   OWNER-NAME─Owner of the object.%@NL@%
  13281.  
  13282.   ■   OBJ-TYPE─Type of the object. %@NL@%
  13283.  
  13284.   ■   ADD-INFO─Additional information that describes the kind of resource
  13285.       objects allocated.%@NL@%
  13286.  
  13287.  
  13288.  
  13289. %@2@%%@CR:C6A00110014 @%%@AB@%11.3  Using Heap Walker Commands%@AE@%%@EH@%%@NL@%
  13290.  
  13291. Heap Walker commands let you do the following:  %@NL@%
  13292.  
  13293.  
  13294.   ■   Perform file operations%@NL@%
  13295.  
  13296.   ■   Walk the heap %@NL@%
  13297.  
  13298.   ■   Sort memory objects %@NL@%
  13299.  
  13300.   ■   Show objects %@NL@%
  13301.  
  13302.   ■   Allocate part or all of the heap%@NL@%
  13303.  
  13304.   ■   Add the size of selected memory objects %@NL@%
  13305.  
  13306.  
  13307. The following sections describe Heap Walker commands.  %@NL@%
  13308.  
  13309.  
  13310. %@3@%%@CR:C6A00110015 @%%@AB@%11.3.1  Performing File Operations: The File Menu%@AE@%%@EH@%%@NL@%
  13311.  
  13312. Table 11.1 describes Heap Walker commands that perform basic file
  13313. operations.%@CR:C6A00110016 @%%@CR:C6A00110017 @%%@CR:C6A00110018 @%%@NL@%
  13314.  
  13315. Table 11.1  File Operation Commands
  13316.  
  13317. %@TH:  16   857 02 34 42 @%
  13318. Command                           Action
  13319. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13320. Save                              Saves the current listing of objects on 
  13321.                                   the heap to a HWG.TXT file. Heap Walker 
  13322.                                   writes the first listing you save to 
  13323.                                   file HWG00.TXT, and numbers subsequent 
  13324.                                   saves consecutively (HWG00.TXT, 
  13325.                                   HWG01.TXT).
  13326.  
  13327. Exit                              Exits Heap Walker.
  13328.  
  13329. About Heap Walker                 Displays information about the current 
  13330.                                   version of Heap Walker.
  13331.  
  13332. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13333.  
  13334. %@TE:  16   857 02 34 42 @%
  13335.  
  13336. When saving a list of current objects to a file, Heap Walker dumps the heap
  13337. that is displayed on the screen as well as the following information, from
  13338. left to right:  %@NL@%
  13339.  
  13340.  
  13341.   ■   The module name%@NL@%
  13342.  
  13343.   ■   The number of discardable segments loaded in memory%@NL@%
  13344.  
  13345.   ■   The number of bytes that the discardable segments occupy%@NL@%
  13346.  
  13347.   ■   The number of bytes that nondiscardable segments occupy in memory%@NL@%
  13348.  
  13349.   ■   The total number of bytes that the module occupies in memory%@NL@%
  13350.  
  13351.  
  13352.  
  13353. %@3@%%@CR:C6A00110019 @%%@AB@%11.3.2  Walking the Heap: The Walk and EmsWalk Menus%@AE@%%@EH@%%@NL@%
  13354.  
  13355. Table 11.2 describes commands for walking the heap.%@CR:C6A00110020 @%%@CR:C6A00110021 @%%@CR:C6A00110022 @%%@NL@%
  13356.  
  13357. Table 11.2  Walk Commands
  13358.  
  13359. %@TH:  10   644 02 34 42 @%
  13360. Command                           Action
  13361. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13362. Walk Heap                         Displays objects on the heap below the 
  13363.                                   EMS line (real mode only if EMS is 
  13364.                                   present). Each display line identifies 
  13365.                                   one global object. If the heap does not 
  13366.                                   have EMS or the heap is in protected 
  13367.                                   mode, this command displays the entire 
  13368.                                   heap.
  13369.  
  13370. %@TE:  10   644 02 34 42 @%
  13371.  
  13372. Table 11.2  Walk Commands (continued)
  13373.  
  13374. %@TH:  44  2570 02 34 42 @%
  13375. Command                           Action
  13376. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13377. Walk LRU List                     Displays only discardable objects. The 
  13378.                                   Heap Walker lists objects from the least
  13379.                                   recently used to the most recently used.
  13380.                                   The object at the top of the list has 
  13381.                                   been least recently used and, therefore,
  13382.                                   is most eligible for discarding. 
  13383.  
  13384. Walk Free List                    Displays only free blocks of memory.
  13385.  
  13386. GC(0) and Walk                    Performs a global compact, asking for 
  13387.                                   zero bytes, then displays the heap.
  13388.  
  13389. GC(-1) and Walk                   Attempts to throw out all discardable 
  13390.                                   objects and then displays the heap.
  13391.  
  13392. GC(-1) and Hit A:                 Attempts to throw out all discardable 
  13393.                                   objects, then accesses drive A. Used to 
  13394.                                   test critical error handling. 
  13395.  
  13396. Set Swap Area                     Resets the code fence. The code fence 
  13397.                                   defines an area of memory reserved for 
  13398.                                   discardable code. 
  13399.  
  13400. Segmentation Test                 Dumps the heap to a file called 
  13401.                                   HWG00.TXT and does a global compact (-1).
  13402.                                   Heap Walker numbers files consecutively 
  13403.                                   in subsequent dumps. This command is 
  13404.                                   available whenever Heap Walker is in the
  13405.                                   system and EMS memory is not installed, 
  13406.                                   even if Heap Walker is not the active 
  13407.                                   application. 
  13408.  
  13409. Specified application             Walks the heap of a specified 
  13410.                                   application using the Expanded Memory 
  13411.                                   Specification. An EMS walk comprises 
  13412.                                   relevant objects in memory above the EMS
  13413.                                   line and below 1-megabyte.. This command
  13414.                                   is available only in real mode for 
  13415.                                   systems with EMS installed. %@CR:C6A00110023 @%%@CR:C6A00110024 @%
  13416.  
  13417. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13418.  
  13419. %@TE:  44  2570 02 34 42 @%
  13420.  
  13421.  
  13422. %@3@%%@CR:C6A00110025 @%%@AB@%11.3.3  Sorting Memory Objects: The Sort Menu%@AE@%%@EH@%%@NL@%
  13423.  
  13424. Heap Walker lets you sort memory objects in a variety of ways. Table 11.3
  13425. describes Heap Walker sort commands.%@CR:C6A00110026 @%%@CR:C6A00110027 @%%@CR:C6A00110028 @%%@NL@%
  13426.  
  13427. Table 11.3  Sort Commands
  13428.  
  13429. %@TH:  15   598 02 34 42 @%
  13430. Command                           Action
  13431. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13432. Address (real mode only)          Sorts by address.
  13433.  
  13434. Selector (protected mode only)    Sorts by selector.
  13435.  
  13436. Module                            Sorts by module name.
  13437.  
  13438. Size                              Sorts by object size.
  13439.  
  13440. Label Segments                    Substitutes segment names for segment 
  13441.                                   numbers.
  13442.  
  13443. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13444.  
  13445. %@TE:  15   598 02 34 42 @%
  13446.  
  13447.  
  13448. %@3@%%@CR:C6A00110029 @%%@AB@%11.3.4  Displaying Memory Objects: The Object Menu%@AE@%%@EH@%%@NL@%
  13449.  
  13450. Heap Walker lets you view objects selectively. Table 11.4 describes commands
  13451. to control and display memory objects.%@CR:C6A00110030 @%%@CR:C6A00110031 @%%@CR:C6A00110032 @%%@CR:C6A00110033 @%%@NL@%
  13452.  
  13453. Table 11.4  Memory Object Commands
  13454.  
  13455. %@TH:  53  2677 02 34 42 @%
  13456. Command                           Action
  13457. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13458. Show                              Displays the contents of a selected 
  13459.                                   object in hexadecimal and ASCII format.
  13460.  
  13461. Show Bits                         Displays the bitmap (if any) of a 
  13462.                                   selected graphics device interface (GDI)
  13463.                                   object such as a font or cursor.
  13464.  
  13465. Discard                           Discards a selected object. 
  13466.  
  13467. Oldest                            Marks a selected object as the next 
  13468.                                   candidate for 
  13469.                                   discarding.
  13470.  
  13471. Newest                            Marks a selected object as the last 
  13472.                                   candidate for 
  13473.                                   discarding.
  13474.  
  13475. LocalWalk                         Displays the local heap of the currently
  13476.                                   selected object. The object must be a 
  13477.                                   data segment. The local walk window 
  13478.                                   shows the following: 
  13479.  
  13480.                                   OFFSET─The offset from the DS register 
  13481.                                   of the object
  13482.  
  13483.                                   SIZE─Size in bytes of the object
  13484.  
  13485.                                   MOV/FIX─Indicates whether the object is 
  13486.                                   moveable or fixed 
  13487.  
  13488.                                   FLAGS─Indicates whether or not an object
  13489.                                   is discardable 
  13490.  
  13491.                                   OBJ TYPE─Object type
  13492.  
  13493.                                   Windows allocates the first object in 
  13494.                                   the local heap, so there are always at 
  13495.                                   least two objects in a local heap. 
  13496.                                   LocalWalk has a File menu with a Save 
  13497.                                   command that saves to a file named 
  13498.                                   HWL00.TXT. Heap Walker numbers files 
  13499.                                   consecutively on subsequent dumps 
  13500.                                   (HWL00.TXT, HWL01.TXT).
  13501.  
  13502. LC(-1) and LocalWalk              Compacts the selected local heap, then 
  13503.                                   displays the heap. LocalWalk has a Save 
  13504.                                   command that saves to a file named 
  13505.                                   HWL00.TXT. Heap Walker numbers files 
  13506.                                   consecutively on subsequent dumps 
  13507.                                   (HWL00.TXT, HWL01.TXT).
  13508.  
  13509. %@TE:  53  2677 02 34 42 @%
  13510.  
  13511. Table 11.4  Memory Object Commands (continued)
  13512.  
  13513. %@TH:  11   701 02 34 42 @%
  13514. Command                           Action
  13515. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13516. GDI LocalWalk                     Displays the GDI local heap and provides
  13517.                                   information on the objects in the heap. 
  13518.                                   LocalWalk has a Save command that saves 
  13519.                                   to a file named HWL00.TXT. Heap Walker 
  13520.                                   numbers files consecutively on 
  13521.                                   subsequent dumps (HWL00.TXT, HWL01.TXT).
  13522.  
  13523. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13524.  
  13525. %@TE:  11   701 02 34 42 @%
  13526.  
  13527.  
  13528. %@3@%%@CR:C6A00110034 @%%@AB@%11.3.5  Allocating Memory: The Alloc Menu%@AE@%%@EH@%%@NL@%
  13529.  
  13530. Heap Walker lets you allocate part or all of memory. Table 11.5 describes
  13531. commands that allocate memory.%@CR:C6A00110035 @%%@CR:C6A00110036 @%%@CR:C6A00110037 @%%@CR:C6A00110038 @%%@NL@%
  13532.  
  13533. Table 11.5  Memory Allocation Commands
  13534.  
  13535. %@TH:  39  2009 02 34 42 @%
  13536. Command                           Action
  13537. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13538. Allocate all of memory            Allocates all free memory. This command 
  13539.                                   is useful for testing out-of-memory 
  13540.                                   conditions in applications. 
  13541.  
  13542. Free allocated memory             Frees memory allocated by the Allocate 
  13543.                                   all of memory command. 
  13544.  
  13545. Free 1K                           Frees 1K of memory. Applies only to 
  13546.                                   memory allocated by the Allocate all of 
  13547.                                   memory command.
  13548.  
  13549. Free 2K                           Frees 2K of memory. Applies only to 
  13550.                                   memory allocated by the Allocate all of 
  13551.                                   memory command.
  13552.  
  13553. Free 5K                           Frees 5K of memory. Applies only to 
  13554.                                   memory allocated by the Allocate all of 
  13555.                                   memory command.
  13556.  
  13557. Free 10K                          Frees 10K of memory. Applies only to 
  13558.                                   memory allocated by the Allocate all of 
  13559.                                   memory command.
  13560.  
  13561. Free 25K                          Frees 25K of memory. Applies only to 
  13562.                                   memory allocated by the Allocate all of 
  13563.                                   memory command.
  13564.  
  13565. Free 50K                          Frees 50K of memory. Applies only to 
  13566.                                   memory allocated by the Allocate all of 
  13567.                                   memory command.
  13568.  
  13569. Free XK                           Frees a specified number of kilobytes of
  13570.                                   memory. Heap Walker displays a dialog 
  13571.                                   box that lets you specify the number.
  13572.  
  13573. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13574.  
  13575. %@TE:  39  2009 02 34 42 @%
  13576.  
  13577.  
  13578. %@3@%%@CR:C6A00110039 @%%@AB@%11.3.6  Determining Memory Size: The Add! Menu%@AE@%%@EH@%%@NL@%
  13579.  
  13580. Heap Walker lets you determine the total size of selected memory objects. To
  13581. add the total number of bytes of selected objects, choose the Add! menu. The
  13582. menu is a command that displays the number of selected segments and total
  13583. segment size in a dialog box.%@CR:C6A00110040 @%%@CR:C6A00110041 @%%@CR:C6A00110042 @%%@NL@%
  13584.  
  13585.  
  13586. %@2@%%@CR:C6A00110043 @%%@AB@%11.4  Suggestions for Using Heap Walker%@AE@%%@EH@%%@NL@%
  13587.  
  13588. One error that frequently occurs in applications is the failure to free
  13589. memory objects once they are no longer needed. This can cause Windows to
  13590. fail when one of its data segments grows beyond the 64K limit.  %@NL@%
  13591.  
  13592. You can use Heap Walker to help determine if your application is not freeing
  13593. memory objects. Heap Walker lets you view changes in the size of all Windows
  13594. data segments, allowing you to observe the effect your application has on
  13595. these segments.  %@NL@%
  13596.  
  13597. To check how your application changes the size of the Windows data segments,
  13598. follow these steps:  %@NL@%
  13599.  
  13600.  
  13601.   1.  Make sure that your application does not generate fatal exits.%@NL@%
  13602.  
  13603.   2.  Start the debugging version of Windows, making sure that all the
  13604.       values for settings in the [kernel] section of WIN.INI are correct.%@NL@%
  13605.  
  13606.   3.  Immediately start Heap Walker and note the sizes of the GDI and USER
  13607.       data segments. This establishes the baseline against which you can
  13608.       compare the size of the data segments later.%@NL@%
  13609.  
  13610.   4.  Select the Object GDI LocalWalk(DATASEG) menu option to display a
  13611.       window that lists the different objects in the GDI data segment.
  13612.       Select the Save! menu option of this window to copy this list to a
  13613.       file; the file will also contain a summary of GDI objects.%@NL@%
  13614.  
  13615.   5.  Run your application and exercise it fully over a long period of time,
  13616.       noting the changes in the size of the GDI and USER data segments which
  13617.       Heap Walker displays as your application runs. While your application
  13618.       is running, repeat step 4 a number of times to take "snapshots" of the
  13619.       effect your application has on the GDI data segment.%@NL@%
  13620.  
  13621.   6.  Close your application, take a final "snapshot" of the GDI data
  13622.       segment, and note the total sizes of the GDI and USER data segments.%@NL@%
  13623.  
  13624.  
  13625. As you analyze the data that you've recorded, you should look for GDI
  13626. objects that your application creates but does not delete when they are no
  13627. longer needed.  %@NL@%
  13628.  
  13629. You should also check the size of the USER data segment before and after you
  13630. run your application. While it is normal for the USER data segment to be a
  13631. little larger after your application has run once, it should not grow larger
  13632. after you have run your application additional times. If it does, your
  13633. application probably is calling the %@AB@%MakeProcInstance%@AE@% function without
  13634. calling %@AB@%FreeProcInstance%@AE@% to free the procedure-instance address when it is
  13635. no longer needed.  %@NL@%
  13636.  
  13637.  
  13638. %@2@%%@CR:C6A00110044 @%%@AB@%11.5  Summary%@AE@%%@EH@%%@NL@%
  13639.  
  13640. Heap Walker is a tool that lets you examine objects on the global heap. For
  13641. more information on the heap, see Chapter 15, "Memory Management," and
  13642. Chapter 16, "More Memory Management," in%@AI@% Guide to Programming.  %@AE@%%@NL@%
  13643.  
  13644.  
  13645.  
  13646.  
  13647.  
  13648.  
  13649. %@CR:C6A00120001 @%%@1@%%@AB@%Chapter 12  Moving Memory: Shaker%@AE@%%@EH@%%@NL@%
  13650. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13651.  
  13652. The Microsoft Windows Shaker (%@AB@%SHAKER%@AE@%) lets you see the effect of memory
  13653. movement on your application. Shaker randomly allocates and frees chunks of
  13654. global memory with the intention of forcing the system to relocate moveable
  13655. data or code segments in your application.  %@NL@%
  13656.  
  13657. Shaker is useful for making sure that no problems occur when memory moves.%@CR:C6A00120002 @%%@CR:C6A00120003 @%%@CR:C6A00120004 @%%@NL@%
  13658.  
  13659. This chapter describes commands you use to allocate and free global memory.
  13660. %@NL@%
  13661.  
  13662.  
  13663. %@2@%%@CR:C6A00120005 @%%@AB@%12.1  Using Shaker%@AE@%%@EH@%%@NL@%
  13664.  
  13665. To use Shaker, select the parameters you want and start Shaker. You select
  13666. parameters and start or stop Shaker with the following commands on the menu
  13667. bar:  %@NL@%
  13668.  
  13669. %@AB@%Command%@AE@%                           %@AB@%Function%@AE@%
  13670. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13671. Parameter                         Displays a dialog box that lets you 
  13672.                                   specify the following parameters:
  13673.  
  13674.                                   ■ Allocation Granularity─Sets the 
  13675.                                   minimum
  13676.                                   size of the objects to be allocated. 
  13677.                                   Each object
  13678.                                   is some multiple of this size; for 
  13679.                                   example, if the granularity is 128, 
  13680.                                   Shaker allocates objects that have byte 
  13681.                                   sizes of 128, 256, 384, and so on. The 
  13682.                                   smaller the granularity, the more likely
  13683.                                   it is that the allocated objects will 
  13684.                                   fit in the spaces between global objects.
  13685.                                   %@CR:C6A00120006 @% %@CR:C6A00120007 @%%@CR:C6A00120008 @%
  13686.  
  13687.                                   ■ Time Interval─Sets the time interval, 
  13688.                                   in system-timer ticks, between 
  13689.                                   allocations. Shaker allocates a new 
  13690.                                   object after each interval elapses. If 
  13691.                                   the maximum number of objects has been 
  13692.                                   allocated, it reallocates one it had 
  13693.                                   previously allocated. 
  13694.  
  13695.                                   ■ Max Objects─Sets the maximum number 
  13696.                                   of
  13697.                                   objects to be allocated.
  13698.  
  13699. Display                           Displays or removes the display of 
  13700.                                   object handles and allocation sizes.
  13701.  
  13702. %@AB@%Command%@AE@%                           %@AB@%Function%@AE@%
  13703. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13704. Start                             Starts the allocation.
  13705.  
  13706. Stop                              Stops the allocation.
  13707.  
  13708. Step                              Allocates one object and stops. This 
  13709.                                   command can be used when Shaker is 
  13710.                                   otherwise stopped.%@CR:C6A00120009 @% 
  13711.  
  13712.  
  13713. %@2@%%@CR:C6A00120010 @%%@AB@%12.2  Summary%@AE@%%@EH@%%@NL@%
  13714.  
  13715. Shaker is a tool that shows you the effect of memory movement on your
  13716. application. For more information on memory management, see Chapter 15,
  13717. "Memory Management," and Chapter 16, "More Memory Management," in %@AI@% Guide to
  13718. %@AI@%Programming%@AE@%.  %@NL@%
  13719.  
  13720.  
  13721.  
  13722.  
  13723.  
  13724.  
  13725. %@CR:C6A00130001 @%%@1@%%@AB@%Chapter 13  Analyzing CPU Time: Profiler%@AE@%%@EH@%%@NL@%
  13726. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13727.  
  13728. Microsoft Windows Profiler (%@AB@%PROFILER%@AE@%) is an analytical tool that helps you
  13729. optimize the performance of Windows applications. Profiler lets you sample
  13730. the amount of time Windows spends executing sections of code.%@CR:C6A00130002 @%%@NL@%
  13731.  
  13732. This chapter describes the following topics:  %@NL@%
  13733.  
  13734.  
  13735.   ■   An overview of Profiler%@NL@%
  13736.  
  13737.   ■   Preparing to run Profiler%@NL@%
  13738.  
  13739.   ■   Using Profiler functions%@NL@%
  13740.  
  13741.   ■   Sampling code%@NL@%
  13742.  
  13743.   ■   Displaying samples%@NL@%
  13744.  
  13745.  
  13746. Profiler analyzes applications running with Windows in real mode or in 386
  13747. enhanced mode; it cannot analyze applications running with Windows in
  13748. standard mode. If you are analyzing Windows applications in real mode, you
  13749. use Profiler differently than if you are analyzing applications running with
  13750. Windows in 386 enhanced mode. Section 13.4, "Sampling Code," discusses the
  13751. differences. Profiler does not support Windows running in standard mode.  %@NL@%
  13752.  
  13753.  
  13754. %@2@%%@CR:C6A00130003 @%%@AB@%13.1  Overview of Profiler%@AE@%%@EH@%%@NL@%
  13755.  
  13756. Profiler contains the following:  %@NL@%
  13757.  
  13758.  
  13759.   ■   A sampling utility%@NL@%
  13760.  
  13761.   ■   A reporting utility%@NL@%
  13762.  
  13763.   ■   A set of functions that you call from your application%@NL@%
  13764.  
  13765.  
  13766. The sampling utility gathers information about the time spent between
  13767. adjacent labels, and records memory addresses of code. If the application
  13768. you are profiling runs with Windows in real mode, the sampling utility is
  13769. PROF.COM. To run the Profiler you invoke PROF.COM, which in turns invokes
  13770. Windows.  %@NL@%
  13771.  
  13772. If the application you are profiling runs with Windows in 386 enhanced mode,
  13773. the sampling utility is a special device driver, VPROD.386. To run Profiler,
  13774. first install VPROD.386, and then run Windows directly.  %@NL@%
  13775.  
  13776. Profiler stores the information it gathers in a buffer. It writes the buffer
  13777. to disk when Windows terminates, producing a CSIPS.DAT file and a
  13778. SEGENTRY.DAT file in the directory that was your current directory when you
  13779. started Windows. The CSIPS.DAT file contains statistical samplings of the
  13780. code segment (CS), instruction pointer (IP) registers. The SEGENTRY.DAT file
  13781. contains information about the movement of code segments. Because code
  13782. segments can be located at different physical addresses during the execution
  13783. of the program, information in both the CSIPS.DAT and SEGENTRY.DAT files are
  13784. required to prepare the profiling report. %@CR:C6A00130004 @% %@CR:C6A00130005 @% %@CR:C6A00130006 @% %@CR:C6A00130007 @%%@NL@%
  13785.  
  13786. After the sampling utility has finished gathering information, the reporting
  13787. utility, SHOWHITS.EXE, organizes and displays the results.%@CR:C6A00130008 @%%@NL@%
  13788.  
  13789. Profiler's functions let you start and stop examining code, manage the
  13790. output of code samples, and get information about Profiler. All applications
  13791. that Profiler examines must include two functions that start and stop the
  13792. sampling of code. Other Profiler functions are optional.  %@NL@%
  13793.  
  13794.  
  13795. %@2@%%@CR:C6A00130009 @%%@AB@%13.2  Preparing to Run Profiler%@AE@%%@EH@%%@NL@%
  13796.  
  13797. To profile a Windows application in real mode, you need an IBM PC/AT(R) or
  13798. PS/2(R) compatible system because Profiler uses the AT CMOS clock chip to
  13799. time sampling intervals. The utility will not run on standard PC and
  13800. PC/XT(tm) systems.  %@NL@%
  13801.  
  13802. To profile an application running with Windows in 386 enhanced mode, use any
  13803. system capable of running Windows in 386 enhanced mode.%@CR:C6A00130010 @%%@CR:C6A00130011 @%%@NL@%
  13804.  
  13805. In addition to ensuring that your system is compatible with Profiler, you
  13806. must do the following:  %@NL@%
  13807.  
  13808.  
  13809.   1.  Ensure that the Windows directory is defined in your PATH environment
  13810.       variable.%@NL@%
  13811.  
  13812.   2.  Include in your application at least two mandatory Profiler functions,
  13813.       %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@%. %@NL@%
  13814.  
  13815. %@STUB@%      %@AB@%ProfStart%@AE@% indicates when you want Profiler to start sampling code;
  13816.       %@AB@%ProfStop%@AE@% indicates when you want Profiler to stop sampling. Other
  13817.       functions are optional.%@NL@%
  13818.  
  13819.   3.  Compile your application and link the compiled code with the standard
  13820.       Windows libraries. Use the %@AB@%LINK /m%@AE@% option to prepare a .MAP file. This
  13821.       file is required by the %@AB@%MAPSYM%@AE@% utility.%@CR:C6A00130012 @%%@NL@%
  13822.  
  13823.   4.  Use %@AB@%MAPSYM%@AE@% to produce an application symbol (.SYM) file.%@NL@%
  13824.  
  13825.  
  13826.  
  13827. %@2@%%@CR:C6A00130013 @%%@AB@%13.3  Using Profiler Functions%@AE@%%@EH@%%@NL@%
  13828.  
  13829. In addition to the mandatory %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@% functions, Profiler
  13830. includes functions that determine if Profiler is installed, specify a rate
  13831. for sampling, and control the output buffer.  %@NL@%
  13832.  
  13833. The way you use the Profiler functions depends on whether your application
  13834. runs in real mode or in 386 enhanced mode.%@CR:C6A00130014 @%%@NL@%
  13835.  
  13836. If your application runs with Windows in real mode and you want to override
  13837. the standard sampling rate or the amount of data that the Profiler writes to
  13838. disk, you can use either command line options when invoking the Profiler or
  13839. Profiler functions. For information on using command line options, see
  13840. Section 13.4, "Sampling Code."  %@NL@%
  13841.  
  13842. If your application runs with Windows in 386 enhanced mode and you want to
  13843. specify nondefault values, you must use Profiler functions. You cannot
  13844. change default values when invoking the utility.%@CR:C6A00130015 @%%@CR:C6A00130016 @%%@NL@%
  13845.  
  13846. The sections that follow describe Profiler functions.  %@NL@%
  13847.  
  13848.  
  13849. %@3@%%@CR:C6A00130017 @%%@AB@%13.3.1  Starting and Stopping Sampling: The ProfStart and ProfStop Functions%@AE@%%@EH@%%@NL@%
  13850.  
  13851. Use the %@AB@%ProfStart%@AE@% and%@AB@% ProfStop%@AE@% functions for each section of code that you
  13852. want to sample. Deciding where to call%@AB@% ProfStart%@AE@% and %@AB@%ProfStop%@AE@% is important.
  13853. You should avoid sampling when your application calls Windows functions that
  13854. yield to other applications. For example, sampling a function such as
  13855. %@AB@%GetMessage%@AE@% could cause Profiler to collect data on applications other than
  13856. your own. %@CR:C6A00130018 @% %@CR:C6A00130019 @% %@CR:C6A00130020 @%%@CR:C6A00130021 @%%@NL@%
  13857.  
  13858. The following example illustrates when to call %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@%:  %@NL@%
  13859.  
  13860. %@AS@%  #include "windows.h" 
  13861. %@AS@%  #include "hello.h"   
  13862. %@AS@%     . 
  13863. %@AS@%     . 
  13864. %@AS@%     . 
  13865. %@AS@%  void HelloPaint( hDC )
  13866. %@AS@%  HDC hDC;
  13867. %@AS@%  {
  13868. %@AS@%      int i, j;
  13869. %@AS@%     
  13870. %@AS@%      ProfStart();%@AE@%
  13871.  
  13872. %@AS@%  for(i = 1; i <= 3; i++)
  13873. %@AS@%        for(j = 1; j <= 20; j++)
  13874. %@AS@%   {
  13875. %@AS@%        TextOut( hDC,
  13876. %@AS@%                   (short)(i * 120),
  13877. %@AS@%                    (short)(j * 12),
  13878. %@AS@%                    (LPSTR)szMessage,
  13879. %@AS@%                    (short)MessageLength );
  13880. %@AS@%   }
  13881. %@AS@%      ProfStop();
  13882. %@AS@%  }
  13883. %@AS@%     .
  13884. %@AS@%     .
  13885. %@AS@%     .%@AE@%
  13886.  
  13887. In this example, the Profiler %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@% functions specify that
  13888. Profiler sample the application's %@AB@%HelloPaint%@AE@% function. Profiler samples only
  13889. the nested loops that include the call to the %@AB@%TextOut%@AE@% function.  %@NL@%
  13890.  
  13891.  
  13892. %@3@%%@CR:C6A00130022 @%%@AB@%13.3.2  Checking if Profiler Is Installed: The ProfInsChk Function%@AE@%%@EH@%%@NL@%
  13893.  
  13894. To determine if Profiler is installed, use the %@AB@%ProfInsChk%@AE@% function.
  13895. %@AB@%ProfInsChk%@AE@% has the following syntax:  %@NL@%
  13896.  
  13897. %@AS@%  int FAR PASCAL ProfInsChk(void)%@AE@%
  13898.  
  13899. The function returns the following values:  %@NL@%
  13900.  
  13901.  
  13902.   ■   0 if Profiler is not installed %@NL@%
  13903.  
  13904.   ■   1 if the Windows real-mode Profiler is installed%@NL@%
  13905.  
  13906.   ■   2 if the Windows 386-enhanced-mode Profiler is installed%@NL@%
  13907.  
  13908.  
  13909. If Profiler is not installed, the system ignores other Profiler function
  13910. calls.%@CR:C6A00130023 @%%@CR:C6A00130024 @%%@NL@%
  13911.  
  13912.  
  13913. %@3@%%@CR:C6A00130025 @%%@AB@%13.3.3  Setting the Sampling Rate: The ProfSampRate Function%@AE@%%@EH@%%@NL@%
  13914.  
  13915. To set the rate of code sampling, use the %@AB@%ProfSampRate%@AE@% function.
  13916. %@AB@%ProfSampRate%@AE@% has the following syntax: %@CR:C6A00130026 @%%@NL@%
  13917.  
  13918. %@AS@%  void FAR PASCAL ProfSampRate(int,int)%@AE@%
  13919.  
  13920. The first parameter specifies the sampling rate of Profiler if the
  13921. application is running with Windows in real mode. The value of the first
  13922. parameter ranges from 1 to 13, indicating the following sampling rates:%@CR:C6A00130027 @%%@CR:C6A00130028 @%%@NL@%
  13923.  
  13924. %@AB@%Numeric Value%@AE@%                     %@AB@%Sampling Rate%@AE@%
  13925. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13926. 1                                 122.070 microseconds
  13927.  
  13928. 2                                 244.141 microseconds
  13929.  
  13930. 3                                 488.281 microseconds
  13931.  
  13932. 4                                 976.562 microseconds
  13933.  
  13934. 5                                 1.953125 milliseconds
  13935.  
  13936. 6                                 3.90625 milliseconds
  13937.  
  13938. 7                                 7.8125 milliseconds
  13939.  
  13940. 8                                 15.625 milliseconds
  13941.  
  13942. 9                                 31.25 milliseconds
  13943.  
  13944. 10                                62.5 milliseconds
  13945.  
  13946. 11                                125 milliseconds
  13947.  
  13948. 12                                250 milliseconds
  13949.  
  13950. 13                                500 milliseconds
  13951.  
  13952. The second parameter defines sampling rates if Profiler is analyzing an
  13953. application running with Windows in 386 enhanced mode. The value of the
  13954. second parameter can range from 1 to 1000, specifying the sampling rate in
  13955. milliseconds.  %@NL@%
  13956.  
  13957. For Windows in real mode the initial rate is 5 (1.953125 milliseconds) or
  13958. what you specify when invoking PROF.COM.  %@NL@%
  13959.  
  13960. For Windows in 386 enhanced mode, the default rate is 2 milliseconds.  %@NL@%
  13961.  
  13962. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13963. NOTE
  13964.  
  13965. %@AI@%Profiler selects only the parameter appropriate for the version of Windows
  13966. %@AI@%used. If your application runs with Windows in real mode, Profiler reads
  13967. %@AI@%only the first parameter; if your application runs with Windows in 386
  13968. %@AI@%enhanced mode, Profiler reads only the second. %@CR:C6A00130029 @%%@CR:C6A00130030 @%%@AE@%
  13969. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13970.  
  13971.  
  13972. %@3@%%@CR:C6A00130031 @%%@AB@%13.3.4  Managing Output: The ProfClear, ProfFlush, and ProfSetup Functions%@AE@%%@EH@%%@NL@%
  13973.  
  13974. To manage the output of samples that Profiler gathers, use the %@AB@%ProfClear%@AE@%,%@AB@%
  13975. %@AB@%ProfFlush%@AE@%, and%@AB@% ProfSetup%@AE@% functions. %@AB@%ProfClear%@AE@% discards all samples currently
  13976. in the sampling buffer.%@AB@% ProfFlush%@AE@% flushes the sampling buffer to disk,
  13977. provided that samples do not exceed the limit you define.%@CR:C6A00130032 @%%@CR:C6A00130033 @%%@NL@%
  13978.  
  13979. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13980. IMPORTANT
  13981.  
  13982. %@AI@%Use %@AB@%ProfFlush%@AE@%%@AI@% sparingly because it can distort the performance of your
  13983. %@AI@%application. Additionally, do not call the function when DOS may be
  13984. %@AI@%unstable, as in interrupt handling.%@AE@%%@AE@%
  13985. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13986.  
  13987. The %@AB@%ProfSetup%@AE@% function lets you specify the size of the output buffer and
  13988. the amount of samples written to disk. %@AB@%ProfSetup%@AE@% is available only to
  13989. applications running with Windows in 386 enhanced mode.  %@NL@%
  13990.  
  13991. If your application runs with Windows in real mode, you must specify the
  13992. size of the output buffer and the size of sampling data when you invoke
  13993. Profiler.  %@NL@%
  13994.  
  13995. The syntax of %@AB@%ProfSetup%@AE@% is as follows:  %@NL@%
  13996.  
  13997. %@AS@%  void FAR PASCAL ProfSetup(int, int)%@AE@%
  13998.  
  13999. The first parameter specifies the size of the output buffer in kilobytes
  14000. (K), from 1 to 1064. The default value is 64.  %@NL@%
  14001.  
  14002. The second parameter controls how much sampling data Profiler writes to
  14003. disk. Default value is the size of the output buffer in kilobytes. A value
  14004. of 0 specifies unlimited sampling data.  %@NL@%
  14005.  
  14006. The following example uses %@AB@%ProfSetup%@AE@% to specify values for the size of the
  14007. output buffer and the amount of samples written to disk. It also calls
  14008. %@AB@%ProfSampRate%@AE@% to change the default sampling rate.  %@NL@%
  14009.  
  14010. %@AS@%  BOOL HelloInit( hInstance )
  14011. %@AS@%  HANDLE hInstance;
  14012. %@AS@%  {
  14013. %@AS@%      PWNDCLASS   pHelloClass;
  14014. %@AS@%     .
  14015. %@AS@%     .
  14016. %@AS@%     .%@AE@%
  14017.  
  14018. %@AS@%  int PASCAL WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )
  14019. %@AS@%  HANDLE hInstance, hPrevInstance;
  14020. %@AS@%  LPSTR lpszCmdLine;
  14021. %@AS@%  int cmdShow;
  14022. %@AS@%  {
  14023. %@AS@%      MSG   msg;
  14024. %@AS@%      HWND  hWnd;
  14025. %@AS@%      HMENU hMenu;
  14026. %@AS@%     .
  14027. %@AS@%     .
  14028. %@AS@%     .
  14029. %@AS@%      ProfSetup(100,0);
  14030. %@AS@%      ProfSampRate(4,1);
  14031. %@AS@%     .
  14032. %@AS@%     .
  14033. %@AS@%     .%@AE@%
  14034.  
  14035. In this example, the %@AB@%ProfSetup%@AE@% function changes the default sample buffer
  14036. size from 64K to 100K and specifies that Profiler write an unlimited amount
  14037. of data to disk. The function applies only if the application is running
  14038. with Windows in 386 enhanced mode. The %@AB@%ProfSampRate%@AE@% function changes default
  14039. sampling rates to 1 millisecond in 386 enhanced mode.%@CR:C6A00130034 @%%@NL@%
  14040.  
  14041. If the application runs with Windows in real mode, Profiler ignores the
  14042. %@AB@%ProfSetup%@AE@% call. The %@AB@%ProfSampRate%@AE@% function changes default sampling rates to
  14043. 976.562 microseconds in real mode.  %@NL@%
  14044.  
  14045.  
  14046. %@3@%%@CR:C6A00130035 @%%@AB@%13.3.5  Stopping Profiler: The ProfFinish Function%@AE@%%@EH@%%@NL@%
  14047.  
  14048. To stop Profiler, use the %@AB@%ProfFinish%@AE@% function. %@AB@%ProfFinish%@AE@% stops sampling and
  14049. flushes the output buffer to disk. If your application is running with
  14050. Windows in 386 enhanced mode, %@AB@%ProfFinish%@AE@% also frees the buffer for system
  14051. use.%@CR:C6A00130036 @%%@CR:C6A00130037 @%%@NL@%
  14052.  
  14053. If you do not call %@AB@%ProfFinish%@AE@%, the output buffer automatically flushes to
  14054. disk when you terminate Windows.  %@NL@%
  14055.  
  14056. If you are profiling more than one instance of the same application, calling
  14057. the %@AB@%ProfFinish%@AE@% function will stop Profiler for all instances of the
  14058. application.  %@NL@%
  14059.  
  14060.  
  14061. %@2@%%@CR:C6A00130038 @%%@AB@%13.4  Sampling Code%@AE@%%@EH@%%@NL@%
  14062.  
  14063. The method you use to sample code depends on the version of Windows your
  14064. application runs with. If your application runs with Windows in real mode,
  14065. you invoke the PROF.COM program, which loads and runs Windows. If your
  14066. application runs with Windows in 386 enhanced mode, you first install
  14067. VPROD.386, a virtual device driver, and then run Windows directly.  %@NL@%
  14068.  
  14069. In real mode, the Profiler output buffer is limited to 64K. In 386 enhanced
  14070. mode, your application can call %@AB@%ProfSetup%@AE@% to set the size of the output
  14071. buffer up to 1064K.  %@NL@%
  14072.  
  14073. Both sampling methods use memory that is otherwise available to Windows.
  14074. Therefore, using Profiler may decrease the performance of the application
  14075. you are analyzing. You can reduce the amount of memory used by specifying a
  14076. small output buffer. However, a small output buffer may cause sample loss.  %@NL@%
  14077.  
  14078. Profiler can write samples to disk only when Windows indicates it is safe to
  14079. do so. When the sampling buffer fills, Profiler ignores additional samples
  14080. until the buffer is flushed to disk. To minimize sample loss, either
  14081. increase the buffer size or periodically call the %@AB@%ProfFlush%@AE@% function.%@CR:C6A00130039 @%%@CR:C6A00130040 @%%@CR:C6A00130041 @%%@CR:C6A00130042 @%%@CR:C6A00130043 @%%@CR:C6A00130044 @%%@NL@%
  14082.  
  14083. The following sections describe features specific to Windows in real mode,
  14084. and Windows in 386 enhanced mode.%@CR:C6A00130045 @%%@CR:C6A00130046 @%%@CR:C6A00130047 @%%@NL@%
  14085.  
  14086.  
  14087. %@3@%%@CR:C6A00130048 @%%@AB@%13.4.1  Sampling Applications in Windows Real Mode%@AE@%%@EH@%%@NL@%
  14088.  
  14089. To profile applications running with Windows in real mode, use the PROF.COM
  14090. utility.  %@NL@%
  14091.  
  14092. The syntax for invoking PROF.COM is as follows:  %@NL@%
  14093.  
  14094. %@AS@%  PROF «-tn» [[-cn» «-ln» «-d» «program arguments»%@AE@%
  14095.  
  14096. The KERNEL.EXE file must be in the current directory or in the current PATH
  14097. environment. The following describes the command line options:  %@NL@%
  14098.  
  14099. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  14100. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14101. -%@AB@%t%@AE@%%@AI@%n%@AE@%                               Specifies the intervals at which 
  14102.                                   Profiler samples code. For values of %@AI@%n%@AE@%, 
  14103.                                   see the description of real-mode Windows
  14104.                                   arguments to the %@AB@%ProfSampRate%@AE@% function 
  14105.                                   in Section 13.3.3, "Setting the Sampling
  14106.                                   Rate: The ProfSampRate Function."
  14107.  
  14108. -%@AB@%c%@AE@%%@AI@%n%@AE@%                               Specifies the size of the output buffer 
  14109.                                   in kilobytes. The value of %@AI@%n%@AE@% can range 
  14110.                                   from 1 to 64 (default buffer size is 
  14111.                                   64K). 
  14112.  
  14113. -%@AB@%l%@AE@%%@AI@%n%@AE@%                               Limits the total size of samples written
  14114.                                   to disk. If this option is not specified,
  14115.                                   the default is the size of the output 
  14116.                                   buffer.
  14117.  
  14118. -%@AB@%d%@AE@%                                Specifies that the program being 
  14119.                                   analyzed runs with DOS, not Windows. 
  14120.  
  14121. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  14122. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14123. %@AI@%program arguments%@AE@%                 Names the program and arguments, if any,
  14124.                                   that Profiler loads and runs. You would 
  14125.                                   typically place arguments, such as the 
  14126.                                   name of the application you are running,
  14127.                                   on the Windows command line. If 
  14128.                                   specified, the name must include an 
  14129.                                   extension. When profiling Windows 
  14130.                                   applications, this parameter should be 
  14131.                                   the name of the Windows program, 
  14132.                                   typically WIN.COM. %@CR:C6A00130049 @% %@CR:C6A00130050 @% %@CR:C6A00130051 @%
  14133.  
  14134.  
  14135. %@3@%%@CR:C6A00130052 @%%@AB@%13.4.2  Sampling Applications in Windows 386 Enhanced Mode%@AE@%%@EH@%%@NL@%
  14136.  
  14137. The PROF.COM command line options are not available when you profile
  14138. applications that run with Windows in 386 enhanced mode. Instead, you add
  14139. the Profiler functions to your source code to get equivalent results.  %@NL@%
  14140.  
  14141. To profile applications that run with Windows in 386 enhanced mode, do the
  14142. following:%@CR:C6A00130053 @%%@NL@%
  14143.  
  14144.  
  14145.   1.  Install the VPROD.386 driver by adding the following to the [386enh]
  14146.       section of your SYSTEM.INI file:%@CR:C6A00130054 @%%@CR:C6A00130055 @%%@CR:C6A00130056 @%%@CR:C6A00130057 @%
  14147.  
  14148. %@AS@%      DEVICE=VPROD.386%@AE@%
  14149. %@NL@%
  14150.  
  14151.   2.  Run Windows in 386 enhanced mode.%@NL@%
  14152.  
  14153.   3.  Run the application you want to profile.%@NL@%
  14154.  
  14155.   4.  When you have finished profiling your application, remove the
  14156.       VPROD.386 entry from your SYSTEM.INI file.%@NL@%
  14157.  
  14158.  
  14159.  
  14160. %@2@%%@CR:C6A00130058 @%%@AB@%13.5  Displaying Samples: SHOWHITS.EXE%@AE@%%@EH@%%@NL@%
  14161.  
  14162. Use a DOS application, SHOWHITS.EXE, to display data that the Profiler
  14163. gathers. This reporting utility reads CSIPS.DAT, SEGENTRY.DAT, and .SYM
  14164. files, and organizes and displays the data. The sampling utility places the
  14165. CSIPS.DAT and SEGENTRY.DAT files in the current directory. To ensure that
  14166. SHOWHITS can locate these files, either run SHOWHITS from the same
  14167. directory, or else specify full pathnames for the CSIPS.DAT and SEGENTRY.DAT
  14168. files. If the .SYM files are not in the current directory, then use the %@AB@%-i%@AE@%
  14169. option to specify the directory or directories containing the symbols files.%@CR:C6A00130059 @%%@CR:C6A00130060 @%%@CR:C6A00130061 @%%@NL@%
  14170.  
  14171. SHOWHITS.EXE reads .SYM files to match instruction pointer samples with
  14172. global symbols in the application. When you run SHOWHITS.EXE the utility
  14173. searches for .SYM files that contain symbolic names identical to the names
  14174. of modules that Profiler sampled. If the sampled program is written in the C
  14175. language, the symbolic names are typically function names. If the sampled
  14176. program is written in assembly language, the symbolic names can be either
  14177. procedure names or %@AB@%PUBLIC%@AE@% symbols within procedures.  %@NL@%
  14178.  
  14179. SHOWHITS.EXE reports the number of times sampling occurred between  adjacent
  14180. symbols.  %@NL@%
  14181.  
  14182. The syntax for invoking SHOWHITS.EXE is as follows:  %@NL@%
  14183.  
  14184. %@AS@%  SHOWHITS «-r|3» «-ipath [-ipath«...»»» «csips_file» «segentry_file»%@AE@%
  14185.  
  14186. The following describes SHOWHITS.EXE options:  %@NL@%
  14187.  
  14188. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  14189. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14190. -%@AB@%r%@AE@%                                The Profiler was run in real mode 
  14191.                                   (PROF.COM). SHOWHITS uses the KERNEL.SYM
  14192.                                   Windows
  14193.                                   kernel symbol file.
  14194.  
  14195. -%@AB@%3%@AE@%                                The Profiler was run in 386 enhanced 
  14196.                                   mode (VPROD.386). SHOWHITS uses the 
  14197.                                   KRNL386.SYM Windows kernel symbol file.
  14198.  
  14199. -%@AB@%i%@AE@%%@AI@%path%@AE@%                            The %@AI@%path%@AE@% option specifies one or more 
  14200.                                   directories to search for .SYM files. 
  14201.                                   The default is the current directory. 
  14202.                                   SHOWHITS.EXE loads all .SYM files in the
  14203.                                   specified directories, regardless of 
  14204.                                   their relevance to the application you 
  14205.                                   are profiling.
  14206.  
  14207. %@AI@%csips_file%@AE@%                        Specifies the full pathname of the 
  14208.                                   CSIPS.DAT file. If not specified, 
  14209.                                   SHOWHITS.EXE looks for the file in the 
  14210.                                   current directory.
  14211.  
  14212. %@AI@%segentry file%@AE@%                     Specifies the full pathname of the 
  14213.                                   SEGENTRY.DAT file. If not specified, 
  14214.                                   SHOWHITS.EXE looks for the file in the 
  14215.                                   current directory.
  14216.  
  14217. If you do not supply the %@AB@%-r%@AE@% or%@AB@% -3%@AE@% option, SHOWHITS.EXE will prompt you for
  14218. the mode.  %@NL@%
  14219.  
  14220. SHOWHITS.EXE displays information about hits, which are instruction pointer
  14221. samples, into the following four categories:%@CR:C6A00130062 @%%@CR:C6A00130063 @%%@CR:C6A00130064 @%%@CR:C6A00130065 @%%@NL@%
  14222.  
  14223. %@AB@%Category%@AE@%                          %@AB@%Description%@AE@%
  14224. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14225. Unrecognized                      A list of instruction pointers that 
  14226. segments                          occur within segments for which there 
  14227.                                   are no symbols of module names. 
  14228.                                   Unrecognized segments are typically code
  14229.                                   for device drivers, TSR programs, and 
  14230.                                   other code that Windows does not use.
  14231.  
  14232. %@AB@%Category%@AE@%                          %@AB@%Description%@AE@%
  14233. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14234. Known segments                    The number of hits that occur within 
  14235.                                   known modules. Hits on known segments 
  14236.                                   typically include counts for the 
  14237.                                   application and counts for Windows 
  14238.                                   modules such as KERNEL, GDI, and DISPLAY.
  14239.                                   Profiler also counts hits in DOS and the
  14240.                                   ROM BIOS. In addition to display hits, 
  14241.                                   SHOWHITS.EXE lists the total number of 
  14242.                                   hits and the segment's percentage of 
  14243.                                   total hits.
  14244.  
  14245. Breakdown                         A detailed breakdown of the hits between
  14246.                                   labels
  14247.                                   of the modules for which SHOWHITS.EXE 
  14248.                                   finds .SYM files. SHOWHITS.EXE also 
  14249.                                   displays the
  14250.                                   total number of hits and the percentage 
  14251.                                   of the total number.
  14252.  
  14253. Summary                           A list of the top 10 hits.
  14254.  
  14255. The following example illustrates a display:%@CR:C6A00130066 @%%@NL@%
  14256.  
  14257. %@AS@%  Here are the Hits for Unrecognized Segments
  14258. %@AS@%  
  14259. %@AS@%  Here are the Hits for Known Segments
  14260. %@AS@%  
  14261. %@AS@%   0.3%        3  Hits on SYSTEM-0
  14262. %@AS@%   0.5%        5  Hits on HELLO-0
  14263. %@AS@%  76.5%      786  Hits on DISPLAY-0
  14264. %@AS@%  11.3%      116  Hits on GDI-0
  14265. %@AS@%  11.5%      118  Hits on KERNEL-0
  14266. %@AS@%  
  14267. %@AS@%     1028  TOTAL HITS
  14268. %@AS@%  
  14269. %@AS@%  
  14270. %@AS@%  HELLO!_TEXT
  14271. %@AS@%  
  14272. %@AS@%   0.4%        4  Hits between labels _HelloPaint and _HelloInit
  14273. %@AS@%   0.1%        1  Hits between labels __cintDIV and __fptrap
  14274. %@AS@%  
  14275. %@AS@%  Profiler Summary (Top 10 Hits):
  14276. %@AS@%  
  14277. %@AS@%   0.4%        4  HELLO! _TEXT! _HelloPaint - _HelloInit
  14278. %@AS@%   0.1%        1  HELLO! _TEXT! __cintDIV - __fptrap%@AE@%
  14279.  
  14280.  
  14281. %@2@%%@CR:C6A00130067 @%%@AB@%13.6  Summary%@AE@%%@EH@%%@NL@%
  14282.  
  14283. Profiler is a tool that lets you determine the amount of time Windows spends
  14284. executing sections of code. For more information about Profiler functions,
  14285. see %@AI@%Reference, Volume 1%@AE@%: Chapter 4, "Functions Directory."%@AI@%  %@AE@%%@NL@%
  14286.  
  14287.  
  14288.  
  14289.  
  14290.  
  14291.  
  14292. %@CR:C6A00140001 @%%@1@%%@AB@%Chapter 14  Analyzing Swaps: Swap%@AE@%%@EH@%%@NL@%
  14293. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14294.  
  14295. Microsoft Windows Swap (%@AB@%SWAP%@AE@%) is a tool that lets you analyze the calls,
  14296. swaps, discards, and returns that occur when your Windows application runs.
  14297. Swap includes a utility that records swapping information and another
  14298. utility that displays the information to a standard output device.%@CR:C6A00140002 @%%@CR:C6A00140003 @%%@NL@%
  14299.  
  14300. Swap is useful for determining the number of procedure calls that occur
  14301. across segment boundaries. You can optimize the performance of your
  14302. application by reducing the number of calls across boundaries.  %@NL@%
  14303.  
  14304. This chapter describes the following topics:  %@NL@%
  14305.  
  14306.  
  14307.   ■   Preparing to run Swap%@NL@%
  14308.  
  14309.   ■   Running Swap%@NL@%
  14310.  
  14311.   ■   Displaying swapping information
  14312. %@NL@%
  14313.  
  14314.  
  14315.  
  14316. %@2@%%@CR:C6A00140004 @%%@AB@%14.1  Preparing to Run Swap%@AE@%%@EH@%%@NL@%
  14317.  
  14318. Before running Swap, do the following:  %@NL@%
  14319.  
  14320.  
  14321.   ■   Ensure that you have the necessary Swap files.%@NL@%
  14322.  
  14323.   ■   Place the %@AB@%SwapRecording%@AE@% function in your application.%@NL@%
  14324.  
  14325.  
  14326.  
  14327. %@3@%%@CR:C6A00140005 @%%@AB@%14.1.1  Files You Need to Run Swap%@AE@%%@EH@%%@NL@%
  14328.  
  14329. To run Swap, you need the following files:  %@NL@%
  14330.  
  14331.  
  14332.   ■   SKERNEL.EXE─Windows uses this file instead of KERNEL.EXE as part of
  14333.       the debugging version of Windows. The SKERNEL.EXE file produces a data
  14334.       file named SWAPPRO.DAT, which contains information about the swapping
  14335.       behavior of your application. SKERNEL.EXE runs only when Windows is in
  14336.       real mode.%@CR:C6A00140006 @%%@NL@%
  14337.  
  14338.   ■   Application .SYM files─Swap requires symbol files for the modules of
  14339.       your application that you want to analyze. To create symbol files,
  14340.       first link the program using the%@AB@% /map%@AE@% option, and then run the %@AB@%MAPSYM%@AE@%
  14341.       utility.%@CR:C6A00140007 @%%@NL@%
  14342.  
  14343.   ■   SWAP.EXE─This file uses the SWAPPRO.DAT file to produce a report of
  14344.       swapping behavior.%@CR:C6A00140008 @%%@NL@%
  14345.  
  14346.  
  14347. Swap also includes the optional SKERNEL.SYM file, which provides a listing
  14348. of symbols in SKERNEL.EXE.%@CR:C6A00140009 @%%@NL@%
  14349.  
  14350.  
  14351. %@3@%%@CR:C6A00140010 @%%@AB@%14.1.2  Using the SwapRecording Function%@AE@%%@EH@%%@NL@%
  14352.  
  14353. Place the %@AB@%SwapRecording%@AE@% function in your application to indicate when to
  14354. start and stop recording swapping behavior. The syntax of the function is as
  14355. follows:%@CR:C6A00140011 @%%@NL@%
  14356.  
  14357. %@AS@%  SwapRecording(value)%@AE@%
  14358.  
  14359. The %@AI@%value%@AE@% parameter specifies whether Swap begins or stops analyzing
  14360. swapping behavior, as follows:  %@NL@%
  14361.  
  14362. %@TH:  11   565 02 34 42 @%
  14363. Value                             Description
  14364. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14365. 0                                 Specifies that Swap stop analyzing.
  14366.  
  14367. 1                                 Specifies that Swap record calls, 
  14368.                                   discards, and swap returns.
  14369.  
  14370. 2                                 Specifies that Swap record calls, 
  14371.                                   discards, swap returns, and all calls 
  14372.                                   through thunks.
  14373.  
  14374. %@TE:  11   565 02 34 42 @%
  14375.  
  14376.  
  14377. %@2@%%@CR:C6A00140012 @%%@AB@%14.2  Running Swap%@AE@%%@EH@%%@NL@%
  14378.  
  14379. To run Swap, do the following:  %@NL@%
  14380.  
  14381.  
  14382.   1.  Make a backup copy of the KERNEL.EXE file in your Windows system
  14383.       directory by copying or renaming it. %@NL@%
  14384.  
  14385.   2.  Copy SKERNEL.EXE in the Windows development tools directory (named
  14386.       \WINDEV by default at installation) to the Windows system directory.%@NL@%
  14387.  
  14388.   3.  Start Windows in real mode (WIN /R) and run the application you want
  14389.       to analyze.%@NL@%
  14390.  
  14391.   4.  Exit from Windows.%@NL@%
  14392.  
  14393.   5.  Run SWAP.EXE.%@NL@%
  14394.  
  14395.   6.  When you are finished, be sure to restore the original KERNEL.EXE in
  14396.       your Windows system directory. %@NL@%
  14397.  
  14398.  
  14399. The following command invokes SWAP.EXE:  %@NL@%
  14400.  
  14401. %@AS@%  SWAP [-Ipath[;path...» [-Fswapfile]
  14402. %@AS@%[-Mmodule[:segment][;module[:segment]...»%@AE@%
  14403.  
  14404. Command line options are as follows:%@CR:C6A00140013 @%%@NL@%
  14405.  
  14406. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  14407. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14408. %@AB@%-I%@AE@%                                Specifies one or more directory 
  14409.                                   pathnames containing the symbol files of
  14410.                                   the modules to be analyzed. 
  14411.  
  14412. %@AB@%-F%@AE@%                                Specifies the pathname of the data 
  14413.                                   collection file.
  14414.  
  14415. %@AB@%-M%@AE@%%@AI@%module%@AE@%                          Specifies the application module that 
  14416.                                   Swap analyzes.
  14417.  
  14418. %@AI@%segment%@AE@%                           Specifies the segment that Swap 
  14419.                                   analyzes.
  14420.  
  14421.  
  14422. %@3@%%@CR:C6A00140014 @%%@AB@%14.2.1  Specifying a Symbol-File Path%@AE@%%@EH@%%@NL@%
  14423.  
  14424. By default, Swap searches for all required symbol files in the current
  14425. directory. To evaluate data in symbol files located in other directories,
  14426. specify the pathnames with the %@AB@%-I%@AE@% option. The pathnames must be separated by
  14427. semicolons.  %@NL@%
  14428.  
  14429. For example, the following command line specifies that symbol files reside
  14430. in the \PRE\SYSTEM and \TEST\SWAP directories:  %@NL@%
  14431.  
  14432. %@AS@%  SWAP -I\pre\system;\test\swap%@AE@%
  14433.  
  14434.  
  14435. %@3@%%@CR:C6A00140015 @%%@AB@%14.2.2  Specifying a Pathname for the Data Collection File%@AE@%%@EH@%%@NL@%
  14436.  
  14437. By default, Swap searches for the SWAPPRO.DAT file in the current directory.
  14438. If you rename the data collection file or place it somewhere other than the
  14439. current directory, use the %@AB@%-F%@AE@% option.  %@NL@%
  14440.  
  14441. For example, the following command line specifies that the data collection
  14442. file, named SWAPREC, resides in directory TMP:  %@NL@%
  14443.  
  14444. %@AS@%  SWAP -F\TMP\SWAPREC%@AE@%
  14445.  
  14446.  
  14447. %@3@%%@CR:C6A00140016 @%%@AB@%14.2.3  Specifying a Module and Segment%@AE@%%@EH@%%@NL@%
  14448.  
  14449. If the data collection file contains a large amount of data, Swap takes a
  14450. long time processing the module and symbol names. To reduce the time, use
  14451. the %@AB@%-M%@AE@% option to limit the number of modules and segments for which Swap
  14452. prepares output.%@CR:C6A00140017 @%%@NL@%
  14453.  
  14454. The following example specifies that Swap display only records that contain
  14455. the _FONTRES segment of the GDI:  %@NL@%
  14456.  
  14457. %@AS@%  SWAP -MGDI:_FONTRES%@AE@%
  14458.  
  14459. You can list multiple segments or module/segment pairs by separating them on
  14460. the command line with semicolons. The following example specifies that Swap
  14461. display records that contain the _FONTRES segment of the GDI and any segment
  14462. of USER:  %@NL@%
  14463.  
  14464. %@AS@%  SWAP -MGDI:_FONTRES;USER %@AE@%
  14465.  
  14466.  
  14467. %@2@%%@CR:C6A00140018 @%%@AB@%14.3  Displaying Output%@AE@%%@EH@%%@NL@%
  14468.  
  14469. Swap displays records of swapping behavior on standard output devices. Use
  14470. DOS commands to direct output to either a file or a screen.  %@NL@%
  14471.  
  14472. Swap records information in columns of ASCII text separated by tabs. The
  14473. format is suitable for reading into spreadsheet programs such as Microsoft
  14474. Excel.%@CR:C6A00140019 @%%@NL@%
  14475.  
  14476. Swap displays information from left to right as follows:  %@NL@%
  14477.  
  14478. %@AB@%Column%@AE@%                            %@AB@%Description%@AE@%
  14479. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14480. Type                              The kind of event that occurred. The 
  14481.                                   event can be one of the following:
  14482.  
  14483.                                   ■ CALL─A normal call through a thunk.
  14484.  
  14485.                                   ■ SWAP─A call through a thunk that 
  14486.                                   caused a swap.
  14487.  
  14488.                                   ■ DISCARD─Discard of a segment. If the 
  14489.                                   discard was the result of a swap, then 
  14490.                                   the discard records occur after the swap
  14491.                                   record.
  14492.  
  14493.                                   ■ RETURN─Return that caused a swap in 
  14494.                                   the
  14495.                                   caller.
  14496.  
  14497. Time                              The relative time that the event 
  14498.                                   occurred, in milliseconds. Resolution is
  14499.                                   1/18.2 seconds. The first event is 
  14500.                                   always 0.
  14501.  
  14502. Segment (1st)                     One of the following:%@CR:C6A00140020 @%
  14503.  
  14504.                                   ■ If CALL or SWAP, the segment being 
  14505.                                   called.
  14506.  
  14507.                                   ■ If DISCARD, the segment being 
  14508.                                   discarded.
  14509.  
  14510.                                   ■ If RETURN, the segment being returned 
  14511.                                   to.
  14512.  
  14513.                                   If the module name appears in 
  14514.                                   parentheses, Swap could not find the 
  14515.                                   .SYM file for the module.
  14516.  
  14517. Offset (1st)                      One of the following:
  14518.  
  14519.                                   ■ If CALL or SWAP, the offset into the 
  14520.                                   segment being called.
  14521.  
  14522.                                   ■ If RETURN, the offset into the segment
  14523.                                   being
  14524.                                   returned to.
  14525.  
  14526.                                   ■ If DISCARD, this field is blank.
  14527.  
  14528. Segment (2nd)                     One of the following:
  14529.  
  14530.                                   ■ If CALL or SWAP, the segment that did 
  14531.                                   the
  14532.                                   calling.
  14533.  
  14534. %@AB@%Column%@AE@%                            %@AB@%Description%@AE@%
  14535. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14536.                                   ■ If DISCARD, this field is blank.
  14537.  
  14538.                                   ■ If RETURN, this field is blank.
  14539.  
  14540.                                   If the module name appears in 
  14541.                                   parentheses, Swap could not find the 
  14542.                                   .SYM file for the module.
  14543.  
  14544. Offset (2nd)                      One of the following:
  14545.  
  14546.                                   ■ If CALL or SWAP, the offset into the 
  14547.                                   segment that did the calling.
  14548.  
  14549.                                   ■ If RETURN, this field is blank.
  14550.  
  14551.                                   ■ If DISCARD, this field is blank.
  14552.  
  14553.  
  14554. %@2@%%@CR:C6A00140021 @%%@AB@%14.4  Summary%@AE@%%@EH@%%@NL@%
  14555.  
  14556. Swap is a tool that lets you analyze the swapping behavior of Windows
  14557. applications. For more information about memory management, see Chapter 15,
  14558. "Memory Management," and Chapter 16, "More Memory Management," in %@AI@%Guide%@AE@% %@AI@%to
  14559. %@AI@%Programming%@AE@%.  %@NL@%
  14560.  
  14561.  
  14562.  
  14563.  
  14564.  
  14565.  
  14566. %@CR:C6A-Part 04 @%%@1@%%@AB@%PART IV  Help Tools%@AE@%%@EH@%%@NL@%
  14567. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14568.  
  14569. Part 4 provides a guideline for authors and developers of Help systems for
  14570. Microsoft Windows applications. It also defines some specific rules that
  14571. must be adhered to when creating a Help system for any single application.
  14572. For that reason, some sections include step-by-step procedures, while other
  14573. sections suggest general methods.  %@NL@%
  14574.  
  14575. To illustrate concepts and procedures, several chapters use sample screens
  14576. and text from the on-line Help in Helpex, a Windows application supplied in
  14577. your Software Development Kit. If you want to study this material in greater
  14578. detail, you can use the Helpex system as a working model.  %@NL@%
  14579.  
  14580.  
  14581.  
  14582.  
  14583.  
  14584.  
  14585. %@CR:C6A00150001 @%%@1@%%@AB@%Chapter 15  Providing Help: The Help System%@AE@%%@EH@%%@NL@%
  14586. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14587.  
  14588. A Help system provides users with online information about an application.
  14589. Creating the system requires the efforts of both a Help writer and a Help
  14590. programmer. The Help writer plans, writes, codes, builds, and keeps track of
  14591. Help topic files, which are text files that describe various aspects of the
  14592. application. The Help programmer ensures that the Help system works properly
  14593. with the application.%@NL@%
  14594.  
  14595. This chapter describes the following topics:  %@NL@%
  14596.  
  14597.  
  14598.   ■   Creating the Help system%@NL@%
  14599.  
  14600.   ■   How Help appears to the user%@NL@%
  14601.  
  14602.   ■   How Help appears to the Help writer%@NL@%
  14603.  
  14604.   ■   How Help appears to the Help programmer%@NL@%
  14605.  
  14606.  
  14607. This chapter and those that follow assume you are familiar with Microsoft
  14608. Windows Help. The chapters use examples from a sample application called
  14609. Helpex, provided on the SDK Sample Source Code disk. If you are unfamiliar
  14610. with Windows Help, take a moment to run the Helpex sample application and
  14611. use Helpex Help.  %@NL@%
  14612.  
  14613.  
  14614. %@2@%%@CR:C6A00150002 @%%@AB@%15.1  Creating a Help System: The Development Cycle%@AE@%%@EH@%%@NL@%
  14615.  
  14616. The creation of a Help system for a Windows application comprises the
  14617. following major tasks:%@CR:C6A00150003 @%%@NL@%
  14618.  
  14619.  
  14620.   1.  Gathering information for the Help topics.%@NL@%
  14621.  
  14622.   2.  Planning the Help system.%@NL@%
  14623.  
  14624. %@STUB@%      Chapter 16, "Planning the Help System," describes considerations you
  14625.       should keep in mind when planning your Help system.%@NL@%
  14626.  
  14627.   3.  Writing the text for the Help topics. %@NL@%
  14628.  
  14629.   4.  Entering all required control codes into the text files. %@NL@%
  14630.  
  14631. %@STUB@%      Control codes determine how the user can move around the Help system.
  14632.       Section 15.3, "How Help Appears to the Writer," includes an example of
  14633.       several control codes. Chapter 17, "Creating the Help Topic Files,"
  14634.       describes the codes in detail.%@NL@%
  14635.  
  14636.   5.  Creating a project file for the build. %@NL@%
  14637.  
  14638. %@STUB@%      The Help project file provides information that the Help Compiler
  14639.       needs to build a Help resource file. Chapter 18, "Building the Help
  14640.       File," describes the Help project file.%@NL@%
  14641.  
  14642.   6.  Building the Help resource file.%@NL@%
  14643.  
  14644. %@STUB@%      The Help resource file is a compiled version of the topic files the
  14645.       writer creates. Chapter 18, "Building the Help File," describes how to
  14646.       compile a Help resource file.%@NL@%
  14647.  
  14648.   7.  Testing and debugging the Help system.%@NL@%
  14649.  
  14650.   8.  Programming the application so that it can access Windows Help.%@NL@%
  14651.  
  14652.  
  14653. The following flow diagram shows the general work flow in the conception and
  14654. development of the Help system.%@CR:C6A00150004 @%%@NL@%
  14655.  
  14656. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14657.  
  14658.  
  14659. %@2@%%@CR:C6A00150005 @%%@AB@%15.2  How Help Appears to the User%@CR:C6A00150006 @%%@AE@%%@EH@%%@NL@%
  14660.  
  14661. To the user, the Help system appears to be part of the application, and is
  14662. made up of text and graphics displayed in the Help window in front of the
  14663. application. Figure 15.2 illustrates the Help window that appears when the
  14664. user asks for help with copying text in Helpex.  %@NL@%
  14665.  
  14666. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14667.  
  14668. The Help window displays one sample Help topic, a partial description of how
  14669. to perform one task. In Figure 15.2 the first sentence includes a definition
  14670. of the word "clipboard." By pressing the mouse button when the cursor is on
  14671. the word (denoted by dotted underlined text), the user can read the
  14672. definition, which appears in an overlapping box as long as the mouse button
  14673. is held down.%@CR:C6A00150007 @%%@NL@%
  14674.  
  14675. Cross-references to related topics are called jumps. By clicking on a jump
  14676. term for a related topic (denoted by underlined text), the user changes the
  14677. content of the Help window to a description of the new topic or command.
  14678. Figure 15.2 includes a look-up to the definition of "clipboard."  %@NL@%
  14679.  
  14680.  
  14681. %@2@%%@CR:C6A00150008 @%%@AB@%15.3  How Help Appears to the Help Writer%@AE@%%@EH@%%@NL@%
  14682.  
  14683. To the writer, the Help system is a group of topic files, which are text
  14684. files that include special codes. Figure 15.3 illustrates the source text
  14685. that corresponds to the topic shown in Figure <$R[C#1]>.2.%@CR:C6A00150009 @%%@NL@%
  14686.  
  14687. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14688.  
  14689. To create this topic, the Help writer describes the task, formats the text,
  14690. and inserts codes using strikethrough text, underlined text, and footnotes.
  14691. In place of strikethrough, the writer can use double underlining if the word
  14692. processor does not support strikethrough formatting. Footnotes in the text
  14693. contain linking information required by the Help Compiler. Chapter 16,
  14694. "Planning the Help System," discusses formatting considerations. Chapter 17,
  14695. "Creating the Help Topic Files," describes how to create topics and enter
  14696. the special codes that the Help system uses.%@CR:C6A00150010 @%%@NL@%
  14697.  
  14698.  
  14699. %@2@%%@CR:C6A00150011 @%%@AB@%15.4  How Help Appears to the Help Programmer%@AE@%%@EH@%%@NL@%
  14700.  
  14701. To the programmer, Windows Help is a stand-alone Windows application  which
  14702. the user can run like any other application. Your application can call the
  14703. %@AB@%WinHelp%@AE@% function to ask Windows to run the Help application and specify
  14704. which topic to display in the Help window.%@CR:C6A00150012 @%%@NL@%
  14705.  
  14706. See Chapter 18, "Building the Help File," for details about the Help
  14707. application programming interface (API).  %@NL@%
  14708.  
  14709.  
  14710. %@2@%%@CR:C6A00150013 @%%@AB@%15.5  Summary%@AE@%%@EH@%%@NL@%
  14711.  
  14712. The Help system is made up of topics linked via hypertext. The topics and
  14713. links appear differently on the screen to the user than they do in a topic
  14714. file to the writer. To the programmer, Help is a stand-alone application.%@CR:C6A00150014 @%%@NL@%
  14715.  
  14716. For more information about related topics, see the following:  %@NL@%
  14717.  
  14718. %@TH:   4   337 02 22 54 @%
  14719. Topic                 Reference
  14720. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14721. Coding Help topics    %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help Topic Files"
  14722. Compiling Help files  %@AI@%Tools%@AE@%: Chapter 18, "Building the Help File"%@CR:C6A00150015 @%
  14723. %@TE:   4   337 02 22 54 @%
  14724.  
  14725.  
  14726.  
  14727.  
  14728.  
  14729.  
  14730. %@CR:C6A00160001 @%%@1@%%@AB@%Chapter 16  Planning the Help System%@AE@%%@EH@%%@NL@%
  14731. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14732.  
  14733. The initial task for the Help writer is to develop a plan for creating the
  14734. system. This chapter discusses planning the Help system for a particular
  14735. application.  %@NL@%
  14736.  
  14737. The chapter covers the following topics:  %@NL@%
  14738.  
  14739.  
  14740.   ■   Developing a plan%@NL@%
  14741.  
  14742.   ■   Determining the topic file structure%@NL@%
  14743.  
  14744.   ■   Designing the visual appearance of Help topics
  14745. %@NL@%
  14746.  
  14747.  
  14748.  
  14749. %@2@%%@CR:C6A00160002 @%%@AB@%16.1  Developing a Plan%@AE@%%@EH@%%@NL@%
  14750.  
  14751. Before you begin writing Help topics using the information you have
  14752. gathered, you and the other members of the Help team should develop a plan
  14753. that addresses the following issues:%@CR:C6A00160003 @%%@NL@%
  14754.  
  14755.  
  14756.   ■   The audience for your application%@NL@%
  14757.  
  14758.   ■   The content of the Help topics%@NL@%
  14759.  
  14760.   ■   The structure of topics%@NL@%
  14761.  
  14762.   ■   The use of context-sensitive topics%@NL@%
  14763.  
  14764.  
  14765. You might want to present your plan in a design document that includes an
  14766. outline of Help information, a diagram of the structure of topics, and
  14767. samples of the various kinds of topics your system will include. Keep in
  14768. mind that contextsensitive Help requires increased development time,
  14769. especially for the application programmer.  %@NL@%
  14770.  
  14771.  
  14772. %@3@%%@CR:C6A00160004 @%%@AB@%16.1.1  Defining the Audience%@AE@%%@EH@%%@NL@%
  14773.  
  14774. The audience you address determines what kind of information you make
  14775. available in your Help system and how you present the information.%@CR:C6A00160005 @%%@NL@%
  14776.  
  14777. Users of Help systems might be classified as follows:  %@NL@%
  14778.  
  14779. %@AB@%User%@AE@%                              %@AB@%Background%@AE@%
  14780. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14781. Computer novice                   Completely new to computing.
  14782.  
  14783. Application novice                Some knowledge of computing, but new to 
  14784.                                   your kind of application. For example, 
  14785.                                   if you are providing Help for a 
  14786.                                   spreadsheet program, the application 
  14787.                                   novice might be familiar only with 
  14788.                                   word-processing packages.
  14789.  
  14790. Application                       Knowledgeable about your kind of 
  14791. intermediate                      application.
  14792.  
  14793. Application expert                Experienced extensively with your type 
  14794.                                   of application.
  14795.  
  14796. Keep in mind that one user may have various levels of knowledge. For
  14797. example, the expert in word processors may have no experience using
  14798. spreadsheets.%@CR:C6A00160006 @%%@NL@%
  14799.  
  14800.  
  14801. %@3@%%@CR:C6A00160007 @%%@AB@%16.1.2  Planning the Content of the Help System%@AE@%%@EH@%%@NL@%
  14802.  
  14803. You should create topics that are numerous enough and specific enough to
  14804. provide your users with the help they need.%@CR:C6A00160008 @%%@CR:C6A00160009 @%%@NL@%
  14805.  
  14806. Novice users need help learning tasks and more definitions of terms. More
  14807. sophisticated users occasionally seek help with a procedure or term, but
  14808. most often refresh their memory of commands and functions. The expert user
  14809. tends only to seek help with command or function syntax, keyboard
  14810. equivalents and shortcut keys.  %@NL@%
  14811.  
  14812. There are no rules for determining the overall content of your Help system.
  14813. If you are providing Help for all types of users, you will want to document
  14814. commands, procedures, definitions, features, functions, and other relevant
  14815. aspects of your application. If you are providing help for expert users
  14816. only, you might want to omit topics that describe procedures. Let your
  14817. audience definition guide you when deciding what topics to include.  %@NL@%
  14818.  
  14819. Keep in mind that the decision to implement context-sensitive Help is an
  14820. important one. Context-sensitive Help demands a close working relationship
  14821. between the Help author and the application programmer, and will therefore
  14822. increase the development time necessary to create a successful Help system.
  14823. %@NL@%
  14824.  
  14825.  
  14826. %@3@%%@CR:C6A00160010 @%%@AB@%16.1.3  Planning the Structure of Help Topics%@AE@%%@EH@%%@NL@%
  14827.  
  14828. Many Help systems structure topics hierarchically. At the top of the
  14829. hierarchy is an index or a table of contents, or both. The index and table
  14830. of contents list individual topics or categories of topics available to the
  14831. user.%@CR:C6A00160011 @%%@NL@%
  14832.  
  14833. Topics themselves can be related hierarchically. Each successive step takes
  14834. the user one level down in the hierarchy of the Help system until the user
  14835. reaches topic information. The hierarchical relationship of Help topics
  14836. determines in part how the user navigates through the Help system. Figure
  14837. 16.1 illustrates a possible hierarchy:  %@NL@%
  14838.  
  14839. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14840.  
  14841. Helpex contains an index that lists several categories of topics. Each
  14842. category includes a secondary index, which lists topics in the category, and
  14843. the topics themselves.  %@NL@%
  14844.  
  14845. Moving from the index to a topic, the user goes from the general to the
  14846. specific.  %@NL@%
  14847.  
  14848. The hierarchical structure provides the user a point of reference within
  14849. Help. Users are not constrained to navigate up and down the hierarchy; they
  14850. can jump from one topic to another, moving across categories of topics. The
  14851. effect of jumps is to obscure hierarchical relationships. For example, the
  14852. Windows Help application contains a search feature that lets the user enter
  14853. a key word into a dialog box and search for topics associated with that key
  14854. word. The Help application then displays a list of titles to choose from in
  14855. order to access information that relates to the key word.  %@NL@%
  14856.  
  14857. Because users often know which feature they want help with, they can usually
  14858. find what they want faster using the search feature than they can by moving
  14859. through the hierarchical structure. For more information about the search
  14860. feature, see Section 17.3.4, "Assigning Key Words."  %@NL@%
  14861.  
  14862. In addition to ordering topics hierarchically, you can order them in a
  14863. logical sequence that suits your audience. The logical sequence, or "browse
  14864. sequence," lets the user choose the Browse button to move from topic to
  14865. topic. Browse sequences are especially important for users who like to read
  14866. several related topics at once, such as the topics covering the commands on
  14867. the File menu. For more information about browse sequences, see Chapter 17,
  14868. "Creating the Help Topic Files."  %@NL@%
  14869.  
  14870. Whichever structure you decide to use, try to minimize the number of lists
  14871. that users must traverse in order to obtain information. Also, avoid making
  14872. users move through many levels to reach a topic. Most Help systems function
  14873. quite well with only two or three levels.%@CR:C6A00160012 @%%@NL@%
  14874.  
  14875.  
  14876. %@3@%%@CR:C6A00160013 @%%@AB@%16.1.4  Displaying Context-Sensitive Help Topics%@AE@%%@EH@%%@NL@%
  14877.  
  14878. Windows Help supports context-sensitive Help. When written in conjunction
  14879. with programming of the application, context-sensitive Help lets the user
  14880. press F1 in an open menu to get help with the selected menu item.
  14881. Alternatively, the user can press SHIFT+F1 and then click on a screen region
  14882. or command to get help on that item.%@CR:C6A00160014 @%%@CR:C6A00160015 @%%@NL@%
  14883.  
  14884. For example, if the user presses SHIFT+F1, then clicks on the maximize icon
  14885. when using the sample application Helpex, the Help system displays the
  14886. information illustrated in Figure 16.2:  %@NL@%
  14887.  
  14888. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14889.  
  14890. Developing context-sensitive Help requires coordination between the Help
  14891. writer and the application programmer so that Help and the application pass
  14892. the correct information back and forth.%@CR:C6A00160016 @%%@CR:C6A00160017 @%%@NL@%
  14893.  
  14894. To plan for context-sensitive Help, the Help author and the application
  14895. programmer should agree on a list of context numbers. Context numbers are
  14896. arbitrary numbers that correspond to each menu command or screen region in
  14897. the application, and are used to create the links to the corresponding Help
  14898. topics. You can then enter these numbers, along with their corresponding
  14899. context-string identifiers, in the Help project file, which the Help
  14900. Compiler uses to build a Help resource file. Section 18.1, "Creating the
  14901. Help Project File," provides details  on how to create a Help project file.
  14902. %@NL@%
  14903.  
  14904. The context numbers assigned in the Help project file must correspond to the
  14905. context numbers that the application sends at run time to invoke a
  14906. particular topic. See Section 18.9, "Programming the Application to Access
  14907. Help," for more information on assigning context numbers.  %@NL@%
  14908.  
  14909. If you do not explicitly assign context numbers to topics, the Help Compiler
  14910. generates default values by converting topic context strings into context
  14911. numbers. See Section 18.6, "Mapping Context-Sensistive Topics: The Map
  14912. Section," for more information on context-sensitive Help and context
  14913. strings.%@CR:C6A00160018 @%%@CR:C6A00160019 @%%@NL@%
  14914.  
  14915. To manage context numbers and file information, you might want to create a
  14916. Help tracker to list the context numbers for your context-sensitive topics.
  14917. See Section 17.5.1, "Creating the Help Tracker," for information about using
  14918. a tracker.%@CR:C6A00160020 @%%@CR:C6A00160021 @%%@NL@%
  14919.  
  14920.  
  14921. %@2@%%@CR:C6A00160022 @%%@AB@%16.2  Determining the Topic File Structure%@AE@%%@EH@%%@NL@%
  14922.  
  14923. The Help file structure remains essentially the same for all applications
  14924. even though the context and number of topic files differ. Topic files are
  14925. segmented into the different topics by means of page breaks. When you build
  14926. the Help system, the compiler uses these topic files to create the
  14927. information displayed for the user in the application's Help window.%@CR:C6A00160023 @%%@CR:C6A00160024 @%%@NL@%
  14928.  
  14929. Figure 16.3 shows this basic file structure.  %@NL@%
  14930.  
  14931. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14932.  
  14933.  
  14934. %@3@%%@CR:C6A00160025 @%%@AB@%16.2.1  Choosing a File Structure for Your Application%@AE@%%@EH@%%@NL@%
  14935.  
  14936. When choosing a file structure for your Help system, consider the scope and
  14937. content of the Help system you are planning. For example, you could place
  14938. all Help topics in a single large topic file. Or, you could place each Help
  14939. topic in a separate file. Neither of these file structures is generally
  14940. acceptable. An enormous single file or too many individual files can present
  14941. difficulties during the creation of the Help resource file.%@CR:C6A00160026 @%%@CR:C6A00160027 @%%@NL@%
  14942.  
  14943. The number of topics relates to the number of features covered by the Help
  14944. system. Consequently, you cannot make extensive changes to one without
  14945. making changes to the other. For instance, if a number of additional product
  14946. features are added to Help, then additional topics must be created to
  14947. accommodate the new information.  %@NL@%
  14948.  
  14949. Figure 16.4 illustrates the file structure of a possible Help system. The
  14950. number of topics and topic files is limited to simplify the diagram and more
  14951. clearly show the concept of linking the topics together through jumps, shown
  14952. in the figure as arrows. The figure is not intended to show the number of
  14953. files that can be included in the Help file system. Moreover, the figure
  14954. does not show how topic files are ordered using the browse feature.%@CR:C6A00160028 @%%@CR:C6A00160029 @%%@NL@%
  14955.  
  14956. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14957.  
  14958.  
  14959. %@2@%%@CR:C6A00160030 @%%@AB@%16.3  Designing the Appearance of Help Topics%@AE@%%@EH@%%@NL@%
  14960.  
  14961. How the information in the Help window appears to the user is primarily a
  14962. function of the layout of the Help topic. The Windows Help application
  14963. supports a number of text attributes and graphic images you can use to
  14964. design your Help window.  %@NL@%
  14965.  
  14966. This section provides general guidelines for designing a window and
  14967. describes fonts and graphic images that Windows Help supports.  %@NL@%
  14968.  
  14969.  
  14970. %@3@%%@CR:C6A00160031 @%%@AB@%16.3.1  Layout of the Help Text%@AE@%%@EH@%%@NL@%
  14971.  
  14972. Help text files are not limited to plain, unformatted text. You can use
  14973. different fonts and point sizes, include color and graphics to emphasize
  14974. points, present information in tables, indent paragraphs to present complex
  14975. information, and use a variety of other visual devices to present your
  14976. information.%@CR:C6A00160032 @%%@CR:C6A00160033 @%%@NL@%
  14977.  
  14978. Research on screen format and Help systems has produced general guidelines
  14979. for presenting information to users. Section 16.5, "Summary," lists some
  14980. sources of this research. The following list summarizes the findings of
  14981. these studies.  %@NL@%
  14982.  
  14983. %@TH:  82  4691 02 34 42 @%
  14984. Design Issue                      Guideline
  14985. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14986. Language                          Use language appropriate for the 
  14987.                                   audience you have defined.
  14988.  
  14989.                                   Language that is too sophisticated for 
  14990.                                   your audience can frustrate users by 
  14991.                                   requiring them 
  14992.                                   to learn the definition of unfamiliar 
  14993.                                   terms and 
  14994.                                   concepts.
  14995.  
  14996. Amount of text                    Use a minimum of text.
  14997.  
  14998.                                   Studies indicate that reading speed 
  14999.                                   decreases by 30 percent when users read 
  15000.                                   online text rather than printed text. 
  15001.                                   Minimal, concise text helps users 
  15002.                                   compensate for the decreased reading 
  15003.                                   speed.
  15004.  
  15005. Paragraph length                  Use short paragraphs.
  15006.  
  15007.                                   Online users become overloaded with text
  15008.                                   more easily than do readers of printed 
  15009.                                   material. Breaking your text into short 
  15010.                                   paragraphs helps avoid this problem.%@CR:C6A00160034 @%
  15011.  
  15012. White space                       Use it to help group information 
  15013.                                   visually.
  15014.  
  15015.                                   White space is important to making 
  15016.                                   online text more readable. Use it 
  15017.                                   liberally, while also considering the 
  15018.                                   overall size that a topic will occupy on
  15019.                                   the screen. Users tend to think there is
  15020.                                   more information on a screen than exists.
  15021.                                   For example, if the ratio of white space
  15022.                                   to text is 50:50, users perceive the 
  15023.                                   ratio to be 40:60. 
  15024.  
  15025. Highlighting                      Use highlighting techniques judiciously.
  15026.  
  15027.                                   Windows Help provides a variety of 
  15028.                                   highlighting devices, such as font sizes,
  15029.                                   font types, and color. Using a few 
  15030.                                   devices can help users find information 
  15031.                                   quickly. Using many devices will 
  15032.                                   decrease 
  15033.                                   the effectiveness of your visual 
  15034.                                   presentation and frustrate users. As 
  15035.                                   with print-based documentation, use only
  15036.                                   one or two fonts at a time.
  15037.  
  15038. Graphics and icons                Use graphics to support the explanation 
  15039.                                   of visual events.
  15040.  
  15041.                                   Windows Help supports the use of 
  15042.                                   bitmapped graphic images. Use 
  15043.                                   appropriate images to help 
  15044.                                   explain the function of icons and screen
  15045.                                   elements  in your application. Remember 
  15046.                                   that graphics will draw the user's eye 
  15047.                                   before the accompanying text. Be sure to
  15048.                                   crop your images to remove distracting 
  15049.                                   information. Use color images only if 
  15050.                                   you are 
  15051.                                   certain that all your users' systems 
  15052.                                   have color capability. As with 
  15053.                                   context-sensitive Help, consider the 
  15054.                                   additional time necessary to create 
  15055.                                   accurate and meaningful graphic images.
  15056.  
  15057. Design consistency                Be rigorously consistent in your design.
  15058.  
  15059.                                   Users expect the appearance of Help 
  15060.                                   topics to be the same, regardless of the
  15061.                                   information presented. Consistent 
  15062.                                   titling, highlighting, fonts, and 
  15063.                                   positioning of text in the window is 
  15064.                                   essential to an effective Help system.%@CR:C6A00160035 @%
  15065.  
  15066. %@TE:  82  4691 02 34 42 @%
  15067.  
  15068. Figure 16.5 illustrates a Help window that follows these design principles.
  15069. %@NL@%
  15070.  
  15071. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15072.  
  15073.  
  15074. %@3@%%@CR:C6A00160036 @%%@AB@%16.3.2  Type Fonts and Sizes%@AE@%%@EH@%%@NL@%
  15075.  
  15076. The Windows Help application can display text in any font and size available
  15077. to the system. When the topic files are passed to the build process, the
  15078. Help Compiler attempts to use the fonts and sizes found in the topic files.
  15079. If a font or point size cannot be matched exactly when the Help file is
  15080. displayed by Windows Help, the closest available font and size on the user's
  15081. system will be used.%@CR:C6A00160037 @%%@NL@%
  15082.  
  15083. Windows ships with only certain fonts in specific font sizes. If you write
  15084. Help files using these fonts and sizes, the displayed Help file will closely
  15085. match the printed word-processed file. Because fonts other than those
  15086. shipped with Windows may not be available on users' machines, you might want
  15087. to limit your font selection to the shipped Windows fonts.  %@NL@%
  15088.  
  15089. The fonts included with Windows are:  %@NL@%
  15090.  
  15091.  
  15092.   ■   Courier 10,12,15%@NL@%
  15093.  
  15094.   ■   Helv 8,10,12,14,18,24%@NL@%
  15095.  
  15096.   ■   Modern%@NL@%
  15097.  
  15098.   ■   Roman%@NL@%
  15099.  
  15100.   ■   Script%@NL@%
  15101.  
  15102.   ■   Symbol 8,10,12,14,18,24%@NL@%
  15103.  
  15104.   ■   Tms Rmn 8,10,12,14,18,24%@CR:C6A00160038 @%%@NL@%
  15105.  
  15106.  
  15107. Figure 16.6 illustrates a Help window with Helv-font text:  %@NL@%
  15108.  
  15109. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15110.  
  15111. Since Windows Help supports any Windows font, special symbols such as arrows
  15112. can be included in your topics by using the Symbol font, as shown in Figure
  15113. 16.7:  %@NL@%
  15114.  
  15115. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15116.  
  15117.  
  15118. %@3@%%@CR:C6A00160039 @%%@AB@%16.3.3  Graphic Images%@AE@%%@EH@%%@NL@%
  15119.  
  15120. The Windows Help application allows you to embed graphics in the Help file.
  15121. Graphics can be placed and displayed anywhere on the page. Text can appear
  15122. next to the graphic, as shown in Figure 16.8:%@CR:C6A00160040 @%%@CR:C6A00160041 @%%@NL@%
  15123.  
  15124. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15125.  
  15126. Color graphic images can be included, provided you use only the available
  15127. Windows system colors. If you use graphics tools that support an enhanced
  15128. color palette to create or capture images, these images may not always
  15129. display with the intended colors. And since you cannot control the color
  15130. capabilities on a user's machine, you might want to limit your graphic
  15131. images to black and white bitmaps.  %@NL@%
  15132.  
  15133. Keep in mind that graphics are most effective when they contribute to the
  15134. learning process. Graphics not tied to the information are usually
  15135. distracting rather than helpful and should be avoided. See Section 17.4,
  15136. "Inserting Graphic Images," for more information on placing graphics into
  15137. your Help files.%@CR:C6A00160042 @%%@NL@%
  15138.  
  15139.  
  15140. %@2@%%@CR:C6A00160043 @%%@AB@%16.4  Summary%@AE@%%@EH@%%@NL@%
  15141.  
  15142. This chapter described how to plan a Help system, including defining the
  15143. audience, planning the content, implementing context-sensitive Help,
  15144. structuring topic files, and designing the layout of Help topics.  %@NL@%
  15145.  
  15146. For additional information about planning your Help system, see the
  15147. following:  %@NL@%
  15148.  
  15149. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  15150. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  15151. Creating topic files              %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help 
  15152.                                   Topic Files"
  15153.  
  15154. Screen design                     Bradford, Annette Norris. "Conceptual 
  15155.                                   Differences Between the Display Screen 
  15156.                                   and the Printed Page." %@AI@%Technical %@AE@%
  15157.                                   %@AI@%Communication%@AE@% (Third Quarter 1984):
  15158.                                   13-16
  15159.  
  15160.                                   Galitz, Wilbert O. %@AI@%Handbook of Screen %@AE@%
  15161.                                   %@AI@%Format%@AE@%
  15162.                                   %@AI@%Design.%@AE@% 3d ed. Wellesley, MA: QED 
  15163.                                   Information Sciences, Inc., 1989
  15164.  
  15165.                                   Houghton, Raymond C., Jr. "Online Help 
  15166.                                   Systems: A Conspectus." %@AI@%Communications %@AE@%
  15167.                                   %@AI@%of the ACM%@AE@% 27(February 1984): 126-133
  15168.  
  15169.                                   Queipo, Larry. "User Expectations of 
  15170.                                   Online
  15171.                                   Information." %@AI@%IEEE Transactions on %@AE@%
  15172.                                   %@AI@%Professional Communications%@AE@% PC 
  15173.                                   29(December 1986): 11-15
  15174.  
  15175.  
  15176.  
  15177.  
  15178.  
  15179.  
  15180. %@CR:C6A00170001 @%%@1@%%@AB@%Chapter 17  Creating the Help Topic Files%@AE@%%@EH@%%@NL@%
  15181. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  15182.  
  15183. Probably the most time-consuming task in developing a Help system for your
  15184. application is creating the Help topic files from which you compile the Help
  15185. system. Help topic files are text files that define what the user sees when
  15186. using the Help system. The topic files can define various kinds of
  15187. information, such as an index to information on the system, a list of
  15188. commands, or a description of how to perform a task.  %@NL@%
  15189.  
  15190. Creating topic files entails writing the text that the user sees when using
  15191. Help, and entering control codes that determine how the user can move from
  15192. one topic to another.  %@NL@%
  15193.  
  15194. This chapter describes the following topics:  %@NL@%
  15195.  
  15196.  
  15197.   ■   Choosing an authoring tool%@NL@%
  15198.  
  15199.   ■   Structuring Help topic files%@NL@%
  15200.  
  15201.   ■   Coding Help topic files%@NL@%
  15202.  
  15203.   ■   Managing Help topic files
  15204. %@NL@%
  15205.  
  15206.  
  15207.  
  15208. %@2@%%@CR:C6A00170002 @%%@AB@%17.1  Choosing an Authoring Tool%@AE@%%@EH@%%@NL@%
  15209.  
  15210. To write your text files, you will need a Rich Text Format (RTF) editor,
  15211. which lets you create the footnotes, underlined text, and strikethrough or
  15212. double-underlined text that indicate the control codes. These codes are
  15213. described in Section 17.3, "Coding Help Topic Files." Your choices include,
  15214. but are not limited to:%@CR:C6A00170003 @%%@NL@%
  15215.  
  15216.  
  15217.   ■   Microsoft Word for Windows, version 1.0.%@NL@%
  15218.  
  15219.   ■   Microsoft Word for the PC, version 5.0.%@NL@%
  15220.  
  15221.   ■   Microsoft Word for the Macintosh, version 3.0 or 4.0.%@NL@%
  15222.  
  15223.   ■   Other word processors that support RTF.%@NL@%
  15224.  
  15225.  
  15226. Microsoft Word's RTF capability allows you to insert the coded text required
  15227. to define Help terms, such as jumps, key words, and definitions. If you
  15228. choose an editor other than one of the Microsoft Word products, make sure it
  15229. will create Help files that work as you intend.  %@NL@%
  15230.  
  15231.  
  15232. %@2@%%@CR:C6A00170004 @%%@AB@%17.2  Structuring Help Topic Files%@AE@%%@EH@%%@NL@%
  15233.  
  15234. A Help topic file typically contains multiple Help topics. To identify each
  15235. topic within a file:%@CR:C6A00170005 @%%@NL@%
  15236.  
  15237.  
  15238.   ■   Topics are separated by hard page breaks.%@NL@%
  15239.  
  15240.   ■   Each topic accessible via a hypertext link must have a unique
  15241.       identifier, or context string.%@NL@%
  15242.  
  15243.   ■   Each topic can have a title.%@NL@%
  15244.  
  15245.   ■   Each topic can have a list of key words associated with it.%@NL@%
  15246.  
  15247.   ■   Each topic can have a build-tag indicator.%@NL@%
  15248.  
  15249.   ■   Any topic can have an assigned browse sequence.%@NL@%
  15250.  
  15251.  
  15252. Figure 17.1 illustrates part of the topic file that contains descriptions of
  15253. how to perform tasks using the sample application Helpex.  %@NL@%
  15254.  
  15255. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15256.  
  15257. For information about inserting page breaks between topics, see the
  15258. documentation for the editor you are using. For information about assigning
  15259. context strings and titles to topics, see the following sections.  %@NL@%
  15260.  
  15261.  
  15262. %@2@%%@CR:C6A00170006 @%%@AB@%17.3  Coding Help Topic Files%@AE@%%@EH@%%@NL@%
  15263.  
  15264. The Help system uses control codes for particular purposes:%@CR:C6A00170007 @%%@CR:C6A00170008 @%%@NL@%
  15265.  
  15266. %@AB@%Control Code%@AE@%                      %@AB@%Purpose%@AE@%
  15267. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  15268. Asterisk (*) footnote             Build tag─Defines a tag that specifies 
  15269.                                   topics the compiler conditionally builds
  15270.                                   into the system. Build tags are optional,
  15271.                                   but they must appear first in a topic 
  15272.                                   when they are used.
  15273.  
  15274. Pound sign (#) footnote           Context string─Defines a context string 
  15275.                                   that uniquely identifies a topic. 
  15276.                                   Because hypertext relies on links 
  15277.                                   provided by context strings, topics 
  15278.                                   without context strings can only be 
  15279.                                   accessed using key words or browse 
  15280.                                   sequences.
  15281.  
  15282. Dollar sign ($) footnote          Title─Defines the title of a topic. 
  15283.                                   Titles are optional.
  15284.  
  15285. Letter "K" footnote               Key word─Defines a key word the user 
  15286.                                   uses to search for a topic. Key words 
  15287.                                   are optional.
  15288.  
  15289. Plus sign (+) footnote            Browse sequence number─Defines a 
  15290.                                   sequence that determines the order in 
  15291.                                   which the user can browse through topics.
  15292.                                   Browse sequences are optional. However, 
  15293.                                   if you omit browse sequences, the Help 
  15294.                                   window will still include the Browse 
  15295.                                   buttons, but they will be grayed.
  15296.  
  15297. Strikethrough or                  Cross-reference─Indicates the text the 
  15298. double-underlined text            user can choose to jump to another 
  15299.                                   topic.
  15300.  
  15301. Underlined text                   Definition─Specifies that a temporary or
  15302.                                   "look-up" box be displayed when the user
  15303.                                   holds down the mouse button or ENTER key.
  15304.                                   The box can include such information as 
  15305.                                   the definition of a word or phrase, or a
  15306.                                   hint about a procedure.
  15307.  
  15308. Hidden text                       Cross-reference context string─Specifies
  15309.                                   the context string for the topic that 
  15310.                                   will be displayed when the user chooses 
  15311.                                   the text that immediately precedes it.
  15312.  
  15313. If you are using build tags, footnote them at the very beginning of the
  15314. topic. Place other footnotes in any order you want. For information about
  15315. assigning specific control codes, see the following sections.  %@NL@%
  15316.  
  15317.  
  15318. %@3@%%@CR:C6A00170009 @%%@AB@%17.3.1  Assigning Build Tags%@CR:C6A00170010 @%%@AE@%%@EH@%%@NL@%
  15319.  
  15320. Build tags are strings that you assign to a topic in order to conditionally
  15321. include or exclude that topic from a build. Each topic can have one or more
  15322. build tags. Build tags are not a necessary component of your Help system.
  15323. However, they do provide a means of supporting different versions of a Help
  15324. system without having to create different source files for each version.
  15325. Topics without build tags are always included in a build.  %@NL@%
  15326.  
  15327. You insert build tags as footnotes using the asterisk (*). When you assign a
  15328. build tag footnote to a topic, the compiler includes or excludes the topic
  15329. according to build information specified in the %@AB@%BUILD%@AE@% option and [BuildTags]
  15330. section of the Help project file. For information about the %@AB@%BUILD %@AE@%option,
  15331. the [BuildTags] section and the Help project file, see Chaper 18, "Building
  15332. the Help File."%@CR:C6A00170011 @%%@NL@%
  15333.  
  15334. To assign a build tag to a topic:  %@NL@%
  15335.  
  15336.  
  15337.   1.  Place the cursor at the beginning of the topic heading line, so that
  15338.       it appears before all other footnotes for that topic.%@NL@%
  15339.  
  15340.   2.  Insert the asterisk (*) as a footnote reference mark.%@NL@%
  15341.  
  15342. %@STUB@%      Note that a superscript asterisk ( * ) appears next to the heading. %@NL@%
  15343.  
  15344.   3.  Type the build tag name as the footnote. %@NL@%
  15345.  
  15346. %@STUB@%      Be sure to allow only a single space between the asterisk (*) and the
  15347.       build tag. %@NL@%
  15348.  
  15349.  
  15350. Build tags can be made up of any alphanumeric characters. The build tag is
  15351. not case-sensitive. The tag may not contain spaces. You can specify multiple
  15352. build tags by separating them with a semicolon, as in the following example:
  15353. %@NL@%
  15354.  
  15355. %@AS@%  * AppVersion1; AppVersion2; Test_Build%@AE@%
  15356.  
  15357. Including a build tag footnote with a topic is equivalent to setting the tag
  15358. to true when compared to the value set in the project file. The compiler
  15359. assumes all other build tags to be false for that topic. After setting the
  15360. truth value of the build tag footnotes, the compiler evaluates the build
  15361. expression in the Options section of the Help project file. Note that all
  15362. build tags must be declared in the project file, regardless of whether a
  15363. given conditional compilation declares the tags. If the evaluation results
  15364. in a true state, the compiler includes the topic in the build. Otherwise,
  15365. the compiler omits the topic.  %@NL@%
  15366.  
  15367. The compiler includes in all builds topics that do not have a build tag
  15368. footnote regardless of the build tag expressions defined in the Help project
  15369. file. For this reason, you may want to use build tags primarily to exclude
  15370. specific topics from certain builds. If the compiler finds any build tags
  15371. not declared in the Help project file, it displays an error message.  %@NL@%
  15372.  
  15373. By allowing conditional inclusion and exclusion of specific topics, you can
  15374. create multiple builds using the same topic files. This saves time and
  15375. effort for the Help development team. It also means that you can develop
  15376. Help topics that will help you maintain a higher level of consistency across
  15377. your product lines.%@CR:C6A00170012 @%%@NL@%
  15378.  
  15379.  
  15380. %@3@%%@CR:C6A00170013 @%%@AB@%17.3.2  Assigning Context Strings%@AE@%%@EH@%%@NL@%
  15381.  
  15382. Context strings identify each topic in the Help system. Each context string
  15383. must be unique. A given context string may be assigned to only one topic
  15384. within the Help project; it cannot be used for any other topic.%@CR:C6A00170014 @%%@NL@%
  15385.  
  15386. The context string provides the means for creating jumps between topics or
  15387. to display look-up boxes, such as word and phrase definitions. Though not
  15388. required, most topics in the Help system will have context-string
  15389. identifiers, Topics without context strings may not be accessed through
  15390. hypertext jumps. However, topics without context-string identifiers can be
  15391. accessed through browse sequences or key-word searches, if desired. It is up
  15392. to the Help writer to justify the authoring of topics that can be accessed
  15393. only in these manners. For information about assigning jumps, see Section
  15394. 17.3.6, "Creating Cross-References Between Topics." For information about
  15395. assigning browse sequences, see Section 17.3.5, "Assigning Browse Sequence
  15396. Numbers." For information about assigning key words, see Section 17.3.4,
  15397. "Assigning Key Words."  %@NL@%
  15398.  
  15399. To assign a context string to a Help topic:  %@NL@%
  15400.  
  15401.  
  15402.   1.  Place the cursor to the left of the topic heading.%@NL@%
  15403.  
  15404.   2.  Insert the pound sign (#) as the footnote reference mark.%@NL@%
  15405.  
  15406. %@STUB@%      Note that a superscript pound sign ( # ) appears next to the heading. %@NL@%
  15407.  
  15408.   3.  Type the context string as the footnote. %@NL@%
  15409.  
  15410. %@STUB@%      Be sure to allow only a single space between the pound sign (#) and
  15411.       the string. %@NL@%
  15412.  
  15413. %@STUB@%      Context strings are not case-sensitive. %@NL@%
  15414.  
  15415.  
  15416. Valid context strings may contain the alphabetic characters A-Z, the numeric
  15417. characters 0-9, and the period (.) and underscore (_) characters. The
  15418. following example shows the context string footnote that identifies a topic
  15419. called "Opening an Existing Text File":  %@NL@%
  15420.  
  15421. %@AS@%  #OpeningExistingTextFile%@AE@%
  15422.  
  15423. Although a context string has a practical limitation of about 255
  15424. characters, there is no good reason for approaching this value. Keep the
  15425. strings sensible and short so that they're easier to enter into the text
  15426. files.%@CR:C6A00170015 @%%@NL@%
  15427.  
  15428.  
  15429. %@3@%%@CR:C6A00170016 @%%@AB@%17.3.3  Assigning Titles%@AE@%%@EH@%%@NL@%
  15430.  
  15431. Title footnotes perform the following functions within the Help system:%@CR:C6A00170017 @%%@NL@%
  15432.  
  15433.  
  15434.   ■   They appear on the Bookmark menu.%@NL@%
  15435.  
  15436.   ■   They appear in the "Topics found " list that results from a key-word
  15437.       search. (Topics that do not have titles, but are accessible via key
  15438.       words are listed as >>Untitled Topic<< in the Topics found list.)%@NL@%
  15439.  
  15440.  
  15441. Although not required, most topics have a title. You might not assign a
  15442. title to topics containing low-level information that Help's search feature,
  15443. look-up boxes and system messages do not access.  %@NL@%
  15444.  
  15445. To assign a title to a topic:%@CR:C6A00170018 @%%@NL@%
  15446.  
  15447.  
  15448.   1.  Place the cursor to the left of the topic heading.%@NL@%
  15449.  
  15450.   2.  Insert a footnote with a dollar sign ($) as the footnote reference
  15451.       mark.%@NL@%
  15452.  
  15453. %@STUB@%      Note that a superscript dollar sign ( $ ) appears next to the heading.
  15454.       %@NL@%
  15455.  
  15456.   3.  Type the title as the footnote. %@NL@%
  15457.  
  15458. %@STUB@%      Be sure to allow only a single space between the dollar sign ($) and
  15459.       the title.%@NL@%
  15460.  
  15461.  
  15462. The following is an example of a footnote that defines the title for a
  15463. topic:  %@NL@%
  15464.  
  15465. %@AS@%  $ Help Keys%@AE@%
  15466.  
  15467. When adding titles, keep in mind the following restrictions:  %@NL@%
  15468.  
  15469. %@TH:  15   770 02 34 42 @%
  15470. Item                              Restrictions
  15471. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  15472. Characters                        Titles can be up to 128 characters in 
  15473.                                   length.
  15474.  
  15475.                                   The Help compiler truncates title 
  15476.                                   strings longer than 128 characters.
  15477.  
  15478.                                   The help system displays titles in a 
  15479.                                   list box when the user searches for a 
  15480.                                   key word or enters a bookmark.
  15481.  
  15482. Formatting                        Title footnote entries cannot be 
  15483.                                   formatted.%@CR:C6A00170019 @%
  15484.  
  15485. %@TE:  15   770 02 34 42 @%
  15486.  
  15487.  
  15488. %@3@%%@CR:C6A00170020 @%%@AB@%17.3.4  Assigning Key Words%@AE@%%@EH@%%@NL@%
  15489.  
  15490. Help allows the user to search for topics with the use of key words assigned
  15491. to the topics. When the user searches for a topic by key word, Help matches
  15492. the user-entered word to key words assigned to specific topics. Help then
  15493. lists matching topics by their titles in the Search dialog box. Because a
  15494. key-word search is often a fast way for users to access Help topics, you'll
  15495. probably want to assign key words to most topics in your Help system.%@CR:C6A00170021 @%%@CR:C6A00170022 @%%@NL@%
  15496.  
  15497. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15498. NOTE 
  15499.  
  15500. %@AI@%You should specify a key-word footnote only if the topic has a title
  15501. %@AI@%footnote since the title of the topic will appear in the search dialog when
  15502. %@AI@%the user searches for the key word.%@AE@%
  15503. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15504.  
  15505. To assign a key word to a topic:  %@NL@%
  15506.  
  15507.  
  15508.   1.  Place the cursor to the left of the topic heading.%@NL@%
  15509.  
  15510.   2.  Insert an uppercase K as the footnote reference mark.%@NL@%
  15511.  
  15512. %@STUB@%      Note that a superscript K ( K ) appears next to the heading.%@NL@%
  15513.  
  15514.   3.  Type the key word, or key words, as the footnote. %@NL@%
  15515.  
  15516. %@STUB@%      Be sure to allow only a single space between the K and the first key
  15517.       word.%@NL@%
  15518.  
  15519. %@STUB@%      If you add more than one key word, separate each with a semicolon.%@NL@%
  15520.  
  15521.  
  15522. The following is an example of key words for a topic:  %@NL@%
  15523.  
  15524. %@AS@%  K open;opening;text file;ASCII;existing;text only;documents;%@AE@%
  15525.  
  15526. Whenever the user performs a search on any of these key words, the
  15527. corresponding titles appear in a list box. More than one topic may have the
  15528. same key word.  %@NL@%
  15529.  
  15530. When adding key words, keep in mind the following restrictions:%@CR:C6A00170023 @%%@CR:C6A00170024 @%%@NL@%
  15531.  
  15532. %@TH:  21  1059 02 34 42 @%
  15533. Item                              Restrictions
  15534. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  15535. Characters                        Key words can include any ANSI character,
  15536.                                   including accented characters. The 
  15537.                                   maximum length for key words is 255 
  15538.                                   characters.
  15539.  
  15540.                                   A space imbedded in a key phrase is 
  15541.                                   considered to be a character, permitting
  15542.                                   phrases to be key words.
  15543.  
  15544. Phrases                           Help searches for any word in the 
  15545.                                   specified phrase.
  15546.  
  15547. Formatting                        Key words are unformatted.
  15548.  
  15549. Case sensitivity                  Key words are not case-sensitive.
  15550.  
  15551. Punctuation                       Except for semicolon delimiters, you can
  15552.                                   use punctuation. %@CR:C6A00170025 @%%@CR:C6A00170026 @%
  15553.  
  15554. %@TE:  21  1059 02 34 42 @%
  15555.  
  15556.  
  15557. %@4@%%@AB@%Creating Multiple Key-Word Tables%@AE@%%@EH@%%@NL@%
  15558.  
  15559. Multiple key-word tables are useful to allow a program to look up topics
  15560. that are defined in alternate key-word tables. You can use an additional
  15561. key-word table to allow users familiar with key words in a different
  15562. application to discover the matching key words in your application.  %@NL@%
  15563.  
  15564. Authoring additional key-word tables is a two-part process. First, the
  15565. %@AB@%MULTIKEY%@AE@% option must be placed in the [Options] section of the project file.
  15566. For information on the%@AB@% MULTIKEY%@AE@% option, see Section 18.4.8, "Multiple
  15567. Key-Word Tables: The Multikey Option."  %@NL@%
  15568.  
  15569. Second, the topics to be associated with the additional key-word table must
  15570. be authored and labeled. Footnotes are assigned in the same manner as the
  15571. normal key-word footnotes, except that the letter specified with the%@AB@%
  15572. %@AB@%MULTIKEY%@AE@% option is used. With this version of the Help Compiler, the
  15573. key-word footnote used is case-sensitive. Therefore, care should be taken to
  15574. use the same case, usually uppercase, for your key-word footnote. Be sure to
  15575. associate only one topic with a key word. Help does not display the normal
  15576. search dialog box for a multiple key-word search. Instead it displays the
  15577. first topic found with the specified key word. If you want the topics in
  15578. your additional key-word table to appear in the normal Help key-word table,
  15579. you must also specify a "K" footnote and the given key word.  %@NL@%
  15580.  
  15581. The application you are developing Help for can then display the Help topic
  15582. associated with a given string in a specified key-word table. Key words are
  15583. sorted without regard to case for the key-word table. For information on the
  15584. parameters passed by the application to call a topic found in alternate
  15585. key-word table, see Section 18.9.4, "Accessing Additional Key-Word Tables."%@CR:C6A00170027 @%%@CR:C6A00170028 @%%@NL@%
  15586.  
  15587.  
  15588. %@3@%%@CR:C6A00170029 @%%@AB@%17.3.5  Assigning Browse Sequence Numbers%@AE@%%@EH@%%@NL@%
  15589.  
  15590. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15591. NOTE 
  15592.  
  15593. %@AI@%In this version of Help, topics defined in browse sequences are accessed
  15594. %@AI@%using the Browse buttons at the top of the Help window. Future versions of
  15595. %@AI@%Help will not normally display browse buttons for the user. However, if your
  15596. %@AI@%Help resource file includes browse sequences authored in the format
  15597. %@AI@%described here, these versions will support the feature by automatically
  15598. %@AI@%displaying browse buttons for the user. %@CR:C6A00170030 @%%@AE@%
  15599. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15600.  
  15601. The Browse >> and Browse browse sequence." A browse sequence is determined
  15602. by sequence numbers, established by the Help writer.  %@NL@%
  15603.  
  15604. To build browse sequences into the Help topics, the writer must:  %@NL@%
  15605.  
  15606.  
  15607.   1.  Decide which topics should be grouped together and what order they
  15608.       should follow when viewed as a group. %@NL@%
  15609.  
  15610. %@STUB@%      Help supports multiple, discontiguous sequence lists.%@NL@%
  15611.  
  15612.   2.  Code topics to implement the sequence.
  15613. %@NL@%
  15614.  
  15615.  
  15616.  
  15617. %@4@%%@AB@%Organizing Browse Sequences%@AE@%%@EH@%%@NL@%
  15618.  
  15619. When organizing browse sequences, the writer must arrange the topics in an
  15620. order that will make sense to the user. Topics can be arranged in
  15621. alphabetical order within a subject, in order of difficulty, or in a
  15622. sensible order that seems natural to the application. The following example
  15623. illustrates browse sequences for the menu commands used in a given
  15624. application. The Help writer has subjectively defined the order that makes
  15625. the most sense from a procedural point of view. You may, of course, choose a
  15626. different order.%@CR:C6A00170031 @%%@NL@%
  15627.  
  15628. %@AS@%  SampleApp Commands 
  15629. %@AS@%   File Menu - commands:005 
  15630. %@AS@%    New Command - file_menu:005 
  15631. %@AS@%    Open Command - file_menu:010 
  15632. %@AS@%    Save Command - file_menu:015 
  15633. %@AS@%    Save As Command - file_menu:020 
  15634. %@AS@%    Print Command - file_menu:025 
  15635. %@AS@%     Printer Setup Command - file_menu:030 
  15636. %@AS@%    Exit Command - file_menu:035 
  15637. %@AS@%   Edit Menu - commands:010 
  15638. %@AS@%    Undo Command - edit_menu:025 
  15639. %@AS@%    Cut Command - edit_menu:015 
  15640. %@AS@%    Copy Command - edit_menu:010 
  15641. %@AS@%    Paste Command - edit_menu:020 
  15642. %@AS@%    Clear Command - edit_menu:005 
  15643. %@AS@%    Select All Command - edit_menu:030 
  15644. %@AS@%    Word Wrap Command - edit_menu:035 
  15645. %@AS@%    Type Face Command - edit_menu:040 
  15646. %@AS@%    Point Size Command - edit_menu:045 
  15647. %@AS@%   Search Menu - commands:015 
  15648. %@AS@%    Find Command - search_menu:005 
  15649. %@AS@%    Find Next Command - search_menu:010 
  15650. %@AS@%    Previous Command - search_menu:015 
  15651. %@AS@%   Window Menu - commands:020 
  15652. %@AS@%    Tile Command - window_menu:005 
  15653. %@AS@%    Cascade Command - window_menu:010 
  15654. %@AS@%    Arrange Icons Command - window_menu:015 
  15655. %@AS@%    Close All Command - window_menu:020 
  15656. %@AS@%    Document Names Command - window_menu:025%@AE@%
  15657.  
  15658. Each line consists of a sequence list name followed by a colon and a
  15659. sequence number. The sequence list name is optional. If the sequence does
  15660. not have a list name, as in the following example, the compiler places the
  15661. topic in a "null" list:  %@NL@%
  15662.  
  15663. %@AS@%  Window Menu - 120%@AE@%
  15664.  
  15665. Note that the numbers used in the browse sequence example begin at 005 and
  15666. advance in increments of 005. Generally, it is good practice to skip one or
  15667. more numbers in a sequence so you can add new topics later if necessary.
  15668. Skipped numbers are of no conseqence to the Help Compiler; only their order
  15669. is significant.%@CR:C6A00170032 @%%@NL@%
  15670.  
  15671. Sequence numbers establish the order of topics within a browse sequence
  15672. list. Sequence numbers can consist of any alphanumeric characters. During
  15673. the compiling process, strings are sorted using the ASCII sorting technique,
  15674. not a numeric sort.  %@NL@%
  15675.  
  15676. Both the alphabetic and numeric portions of a sequence can be several
  15677. characters long; however, their lengths should be consistent throughout all
  15678. topic files. If you use only numbers in the strings make sure the strings
  15679. are all the same length; otherwise a higher sequence number could appear
  15680. before a lower one in certain cases. For example, the number 100 is
  15681. numerically higher than 99, but 100 will appear before 99 in the sort used
  15682. by Help, because Help is comparing the first two digits in the strings. In
  15683. order to keep the topics in their correct numeric order, you would have to
  15684. make 99 a three-digit string: 099.  %@NL@%
  15685.  
  15686.  
  15687. %@4@%%@AB@%Coding Browse Sequences%@AE@%%@EH@%%@NL@%
  15688.  
  15689. After determining how to group and order topics, code the sequence by
  15690. assigning the appropriate sequence list name and number to each topic, as
  15691. follows:%@CR:C6A00170033 @%%@NL@%
  15692.  
  15693.  
  15694.   1.  Place the cursor to the left of the topic heading.%@NL@%
  15695.  
  15696.   2.  Insert the plus sign (+) as the footnote reference mark.%@NL@%
  15697.  
  15698. %@STUB@%      Note that a superscript plus sign ( + ) appears next to the heading.%@NL@%
  15699.  
  15700.   3.  Type the sequence number using alphanumeric characters.%@NL@%
  15701.  
  15702.  
  15703. For example, the following footnote defines the browse sequence number for
  15704. the Edit menu topic in the previous browse sequence example:  %@NL@%
  15705.  
  15706. %@AS@%  + commands:010%@AE@%
  15707.  
  15708. While it may be easier to list topics within the file in the same order that
  15709. they appear in a browse sequence, it is not necessary. The compiler orders
  15710. the sequence for you.%@CR:C6A00170034 @%%@NL@%
  15711.  
  15712.  
  15713. %@3@%%@CR:C6A00170035 @%%@AB@%17.3.6  Creating Cross-References Between Topics%@AE@%%@EH@%%@NL@%
  15714.  
  15715. Cross-references, or "jumps," are specially-coded words or phrases that are
  15716. linked to other topics. Although you indicate jump terms with strikethrough
  15717. or double-underlined text in the topic file, they appear underlined in the
  15718. Help window. In addition, jump terms appear in color on color systems. For
  15719. example, the strikethrough text (double-underlined in Word for Windows) New
  15720. Command appears as %@AU@%New Command%@AE@% in green text to the user.%@CR:C6A00170036 @%%@NL@%
  15721.  
  15722. To code a word or phrase as a jump in the topic file :  %@NL@%
  15723.  
  15724.  
  15725.   1.  Place the cursor at the point in the text where you want to enter the
  15726.       jump term.%@CR:C6A00170037 @%%@CR:C6A00170038 @%%@CR:C6A00170039 @%%@NL@%
  15727.  
  15728.   2.  Select the strikethrough (or double-underline) feature of your editor.%@NL@%
  15729.  
  15730.   3.  Type the jump word or words in strikethrough mode.%@NL@%
  15731.  
  15732.   4.  Turn off strikethrough and select the editor's hidden text feature.%@NL@%
  15733.  
  15734.   5.  Type the context string assigned to the topic that is the target of
  15735.       the jump. %@NL@%
  15736.  
  15737.  
  15738. When coding jumps, keep in mind that:  %@NL@%
  15739.  
  15740.  
  15741.   ■   No spaces can occur between the strikethrough (or double-underlined)
  15742.       text and the hidden text. %@NL@%
  15743.  
  15744.   ■   Coded spaces before or after the jump term are not permitted.%@NL@%
  15745.  
  15746.   ■   Paragraph marks must be entered as plain text.%@NL@%
  15747.  
  15748.  
  15749.  
  15750. %@3@%%@CR:C6A00170040 @%%@AB@%17.3.7  Defining Terms%@AE@%%@EH@%%@NL@%
  15751.  
  15752. Most topic files contain words or phrases that require further definition.
  15753. To get the definition of a word or phrase, the user first selects the word
  15754. and then holds down the mouse button or ENTER key, causing the definition to
  15755. appear in a box within the Help window. The Help writer decides which words
  15756. to define, considering the audience that will be using the application and
  15757. which terms might already be familiar.%@CR:C6A00170041 @%%@CR:C6A00170042 @%%@NL@%
  15758.  
  15759. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15760. NOTE 
  15761.  
  15762. %@AI@%The look-up feature need not be limited to definitions. With the capability
  15763. %@AI@%to temporarily display information in a box, you might want to show a hint
  15764. %@AI@%about a procedure, or other suitable information for the user.%@AE@%
  15765. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15766.  
  15767. Defining a term requires that you:  %@NL@%
  15768.  
  15769.  
  15770.   ■   Create a topic that defines the term.%@NL@%
  15771.  
  15772. %@STUB@%      The definition topic must include a context string. See Section
  15773.       17.3.2, "Assigning Context Strings."%@NL@%
  15774.  
  15775.   ■   Provide a cross-reference for the definition topic whenever the term
  15776.       occurs.%@NL@%
  15777.  
  15778. %@STUB@%      You don't need to define the same word multiple times in the same
  15779.       topic, just its first occurrence. Also, consider the amount of colored
  15780.       text you are creating in the Help window.%@NL@%
  15781.  
  15782. %@STUB@%      See the following "Coding Definitions" section.%@NL@%
  15783.  
  15784.  
  15785.  
  15786. %@4@%%@AB@%Creating Definition Topics%@AE@%%@EH@%%@NL@%
  15787.  
  15788. You can organize definition topics any way you want. For example, you can
  15789. include each definition topic in the topic file that mentions the term. Or
  15790. you can organize all definitions in one topic file and provide the user with
  15791. direct access to it. Helpex uses the latter method, with all definitions
  15792. residing in the TERMS.RTF file. Organizing definition topics into one file
  15793. provides you with a glossary and lets you make changes easily.%@CR:C6A00170043 @%%@CR:C6A00170044 @%%@NL@%
  15794.  
  15795.  
  15796. %@4@%%@AB@%Coding Definitions%@AE@%%@EH@%%@NL@%
  15797.  
  15798. After creating definition topics, code the terms as they occur, as follows:
  15799. %@NL@%
  15800.  
  15801.  
  15802.   1.  Place the insertion point where you want to place the term that
  15803.       requires definition.%@NL@%
  15804.  
  15805.   2.  Select the underline feature of your editor.%@NL@%
  15806.  
  15807.   3.  Type the term.%@NL@%
  15808.  
  15809.   4.  Turn off the underline feature, and select the editor's hidden-text
  15810.       feature.%@NL@%
  15811.  
  15812.   5.  Type the context string assigned to the topic that contains the
  15813.       definition of the term.%@NL@%
  15814.  
  15815.  
  15816. Figure 17.2 includes a definition of the term "Clipboard."  %@NL@%
  15817.  
  15818. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15819.  
  15820.  
  15821. %@2@%%@CR:C6A00170045 @%%@AB@%17.4  Inserting Graphic Images%@AE@%%@EH@%%@NL@%
  15822.  
  15823. Bitmapped graphic images can be placed in Help topics using either of two
  15824. methods. If your word processor supports the placement of Windows 2.1 or
  15825. Windows 3.0 graphics directly into a document, you can simply paste your
  15826. bitmaps into each topic file. Alternatively, you can save each bitmap in a
  15827. separate file and specify the file by name where you want it to appear in
  15828. the Help topic file. The latter method of placing graphics is referred to as
  15829. "bitmaps by reference." The following sections describe the process of
  15830. placing bitmaps directly or by reference into your Help topics.%@CR:C6A00170046 @%%@NL@%
  15831.  
  15832.  
  15833. %@3@%%@CR:C6A00170047 @%%@AB@%17.4.1  Creating and Capturing Bitmaps%@AE@%%@EH@%%@NL@%
  15834.  
  15835. You can create your bitmaps using any graphical tools, as long as the
  15836. resulting images can be displayed in the Windows environment. Each graphic
  15837. image can then be copied to the Windows clipboard. Once on the clipboard, a
  15838. graphic can be pasted into a graphics editor such as Paint, and modified or
  15839. cleaned up as needed.%@CR:C6A00170048 @%%@NL@%
  15840.  
  15841. Windows Help 3.0 supports color bitmaps. However, for future compatibility,
  15842. you might want to limit graphics to monochrome format. If you are producing
  15843. monochrome images, you might have to adjust manually the elements of your
  15844. source graphic that were originally different colors to either black, white,
  15845. or a pattern of black and white pixels.  %@NL@%
  15846.  
  15847. When you are satisfied with the appearance of your bitmap, you can either
  15848. save it as a file, to be used as a bitmap by reference, or you can copy it
  15849. onto the clipboard and paste it into your word processor. If you save the
  15850. graphic as a file, be sure to specify its size in your graphics editor
  15851. first, so that only the area of interest is saved for display in the Help
  15852. window. The tighter you crop your images, the more closely you will be able
  15853. to position text next to the image. Always save (or convert and save if
  15854. necessary) graphics in Windows' .BMP format.  %@NL@%
  15855.  
  15856. Bitmap images should be created in the same screen mode that you intend Help
  15857. to use when topics are displayed. If your Help files will be displayed in a
  15858. different mode, bitmaps might not retain the same aspect ratio or
  15859. information as their source images.%@CR:C6A00170049 @%%@NL@%
  15860.  
  15861.  
  15862. %@3@%%@CR:C6A00170050 @%%@AB@%17.4.2  Placing Bitmaps Using a Graphical Word Processor%@AE@%%@EH@%%@NL@%
  15863.  
  15864. The easiest way to precisely place bitmaps into Help topics is to use a
  15865. graphical word processor. Word for Windows supports the direct importation
  15866. of bitmaps from the clipboard. Simply paste the graphic image where you want
  15867. it to appear in the Help topic. You can format your text so that it is
  15868. positioned below or alongside the bitmap. When you save your Help topic file
  15869. in RTF, the pasted-in bitmap is converted as well and will automatically be
  15870. included in the Help resource file.%@CR:C6A00170051 @%%@NL@%
  15871.  
  15872.  
  15873. %@3@%%@CR:C6A00170052 @%%@AB@%17.4.3  Placing Bitmaps by Reference%@AE@%%@EH@%%@NL@%
  15874.  
  15875. If your word processor cannot import and display bitmaps directly, you can
  15876. specify the location of a bitmap that you have saved as a file. To insert a
  15877. bitmap reference in the Help topic file, insert one the following statements
  15878. where you want the bitmap to appear in the topic:  %@NL@%
  15879.  
  15880. {%@AB@%bmc%@AE@% %@AI@%filename%@AE@%.bmp} {%@AB@%bml%@AE@% %@AI@%filename%@AE@%.bmp} {%@AB@%bmr%@AE@% %@AI@%filename%@AE@%.bmp}  %@NL@%
  15881.  
  15882. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15883. NOTE 
  15884.  
  15885. %@AI@%Do not specify a full path for %@AI@%filename%@AE@%%@AI@%. If you need to direct the compiler
  15886. %@AI@%to a bitmap in a location other than the root directory for the build,
  15887. %@AI@%specify the absolute path for the bitmap in the [Bitmaps] section of the
  15888. %@AI@%project file.%@AE@%%@AE@%
  15889. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15890.  
  15891. The argument %@AB@%bmc%@AE@% stands for "bitmap character," indicating that the bitmap
  15892. referred to will be treated the same as a character placed in the topic file
  15893. at the same location on a line. Text can precede or follow the bitmap on the
  15894. same line, and line spacing will be determined based upon the size of the
  15895. characters (including the bitmap character) on the line. Do not specify
  15896. negative line spacing for a paragraph with a bitmap image, or the image may
  15897. inadvertently overwrite text above it when it is displayed in Help. When you
  15898. use the argument %@AB@%bmc%@AE@%, there is no automatic text wrapping around the graphic
  15899. image. Text will follow the bitmap, positioned at the baseline.%@CR:C6A00170053 @%%@NL@%
  15900.  
  15901. The argument %@AB@%bml%@AE@% specifies that the bitmap appear at the left margin, with
  15902. text wrapping automatically along the right edge of the image. The argument
  15903. %@AB@%bmr%@AE@% specifies that the bitmap appear at the right margin, with text to its
  15904. left. Bitmap filenames must be the same as those listed in the [Bitmaps]
  15905. section of the Help project file. The [Bitmaps] section is described in
  15906. Chapter 18, "Building the Help File."  %@NL@%
  15907.  
  15908. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15909. NOTE 
  15910.  
  15911. %@AI@%Multiple references to a bitmap of the same name refer to the same bitmap
  15912. %@AI@%when the Help file is displayed. This means that bitmap references can be
  15913. %@AI@%repeated in your Help system without markedly increasing the size of the
  15914. %@AI@%Help resource file.%@AE@%
  15915. ────────────────────────────────────────────────────────────────────────────%@NL@%
  15916.  
  15917. Figure 17.3 shows the placement of three bitmaps with related text in a
  15918. topic as displayed in Help.  %@NL@%
  15919.  
  15920. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15921.  
  15922.  
  15923. %@2@%%@CR:C6A00170054 @%%@AB@%17.5  Managing Topic Files%@AE@%%@EH@%%@NL@%
  15924.  
  15925. Help topic files can be saved in the default word-processor format or in
  15926. RTF. If you always save your files in RTF, and later need to make a change,
  15927. the word processor may take additional time to interpret the format as it
  15928. reloads the file. If you anticipate making numerous changes during Help
  15929. development, you might want to minimize this delay by saving topic files in
  15930. both default and RTF formats, with different file extensions to distinguish
  15931. them. The compiler needs only the RTF files, and you will have faster access
  15932. to the source files for changes. On a large project, this practice can save
  15933. a considerable amount of development time.%@CR:C6A00170055 @%%@NL@%
  15934.  
  15935.  
  15936. %@3@%%@CR:C6A00170056 @%%@AB@%17.5.1  Keeping Track of Files and Topics%@AE@%%@EH@%%@NL@%
  15937.  
  15938. It is important to keep track of all topic files for the following reasons:%@CR:C6A00170057 @%%@NL@%
  15939.  
  15940.  
  15941.   ■   To ensure that no topics are left out of the build process%@NL@%
  15942.  
  15943.   ■   To ensure that each topic has been assigned a unique context string%@NL@%
  15944.  
  15945.   ■   To double-check browse sequencing within general and specific lists%@NL@%
  15946.  
  15947.   ■   To show key-word and title matches%@NL@%
  15948.  
  15949.   ■   To allow writers to see where the text for each of the topics is
  15950.       located%@NL@%
  15951.  
  15952.   ■   To keep track of changes to files and the current status%@NL@%
  15953.  
  15954.   ■   To track any other aspect of the Help development process that you
  15955.       think essential%@NL@%
  15956.  
  15957.  
  15958. At a minimum, writers must keep track of their own topic files, and must
  15959. pass the filenames to the person who is responsible for creating the Help
  15960. project file.  %@NL@%
  15961.  
  15962.  
  15963. %@3@%%@CR:C6A00170058 @%%@AB@%17.5.2  Creating a Help Tracker%@AE@%%@EH@%%@NL@%
  15964.  
  15965. While it is important that you track topic files throughout the development
  15966. cycle, the tracking tool can be anything that suits your needs. You can
  15967. maintain a current list of topics in an ASCII text file, in a Microsoft
  15968. Excel worksheet (if available), or in another format.%@CR:C6A00170059 @%%@NL@%
  15969.  
  15970. When you or another writer creates or revises a topic, you should update the
  15971. Help tracking file to reflect the change. The contents of the tracking file
  15972. are not rigidly defined, but should contain entries for filename, context
  15973. string, title, browse sequence, and key words. If your application makes use
  15974. of the context-sensitive feature of Help, you may want to keep track of the
  15975. context-sensitive information as well. This entry is necessary only if you
  15976. are assigning context numbers to topics in the Help project file. You can
  15977. also include optional information, such as date created, date modified,
  15978. status, and author, if you want to keep track of all aspects of the Help
  15979. development process. How you organize this information is entirely up to
  15980. you.  %@NL@%
  15981.  
  15982. The following sample text file and worksheet illustrate how the tracker
  15983. might be organized for the Help system topics. The examples show both Help
  15984. menu and context-sensitive Help entries for the topic files. Typically, the
  15985. same topics that the user accesses when choosing commands from the Help
  15986. menus can be accessed by the context-sensitive Help feature. The topics with
  15987. entries in the context ID column are used for context-sensitive help as well
  15988. as for the Help menus. Notice that some topics have more than one
  15989. context-sensitive help number. This enables the topic to be displayed when
  15990. the user clicks on different regions of the screen.%@CR:C6A00170060 @%%@CR:C6A00170061 @%%@NL@%
  15991.  
  15992. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15993.  
  15994. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  15995.  
  15996. Of course, you are free to keep track of the topic files you produce in a
  15997. manner different from either of these two examples.  %@NL@%
  15998.  
  15999.  
  16000. %@2@%%@CR:C6A00170062 @%%@AB@%17.6  Summary%@AE@%%@EH@%%@NL@%
  16001.  
  16002. This chapter described how to write, code, and keep track of Help topic
  16003. files. For information about building a Help file, see Chapter 18, "Building
  16004. the Help File."  %@NL@%
  16005.  
  16006.  
  16007.  
  16008.  
  16009.  
  16010.  
  16011. %@CR:C6A00180001 @%%@1@%%@AB@%Chapter 18  Building the Help File%@AE@%%@EH@%%@NL@%
  16012. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16013.  
  16014. After the topic files for your Help system have been written, you are ready
  16015. to create a Help project file and run a build to test the Help file. The
  16016. Help project file contains all information the compiler needs to convert
  16017. help topic files into a binary Help resource file.%@CR:C6A00180002 @%%@NL@%
  16018.  
  16019. You use the Help project file to tell the Help Compiler which topic files to
  16020. include in the build process. Information in the Help project file also
  16021. enables the compiler to map specific topics to context numbers (for the
  16022. context-sensitive portion of Help).  %@NL@%
  16023.  
  16024. After you have compiled your Help file, the development team programs the
  16025. application so the user can access it.  %@NL@%
  16026.  
  16027. The chapter describes the following:  %@NL@%
  16028.  
  16029.  
  16030.   ■   Creating a Help project file%@NL@%
  16031.  
  16032.   ■   Compiling the Help file%@NL@%
  16033.  
  16034.   ■   Programming the application to access Help
  16035. %@NL@%
  16036.  
  16037.  
  16038.  
  16039. %@2@%%@CR:C6A00180003 @%%@AB@%18.1  Creating the Help Project File%@AE@%%@EH@%%@NL@%
  16040.  
  16041. You use the Help project file to control how the Help Compiler builds your
  16042. topic files. The Help project file can contain up to six sections that
  16043. perform the following functions:%@CR:C6A00180004 @%%@NL@%
  16044.  
  16045. %@TH:  24  1271 02 34 42 @%
  16046. Section                           Function
  16047. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16048. [Files]                           Specifies topic files to be included in 
  16049.                                   the build. This section is mandatory.
  16050.  
  16051. [Options]                         Specifies the level of error reporting, 
  16052.                                   topics to be included in the build, the 
  16053.                                   directory in which to find the files, 
  16054.                                   and the location of your Help index. 
  16055.                                   This section is optional.
  16056.  
  16057. [BuildTags]                       Specifies valid build tags. This section
  16058.                                   is optional.
  16059.  
  16060. [Alias]                           Assigns one or more context strings to 
  16061.                                   the same topic. This section is 
  16062.                                   optional.
  16063.  
  16064. [Map]                             Associates context strings with context 
  16065.                                   numbers. This section is optional.
  16066.  
  16067. [Bitmaps]                         Specifies bitmap files to be included in
  16068.                                   the build. This section is optional.
  16069.  
  16070. %@TE:  24  1271 02 34 42 @%
  16071.  
  16072. You can use any ASCII text editor to create your Help project file. The
  16073. extension of a Help project file is .HPJ. If you do not use the extension
  16074. .HPJ on the %@AB@%HC%@AE@% command line, the compiler looks for a project file with this
  16075. extension before loading the file. The .HLP output file will have the same
  16076. name as the .HPJ file.%@CR:C6A00180005 @%%@NL@%
  16077.  
  16078. The order of the various sections within the Help project file is arbitrary,
  16079. with one exception: under all circumstances an [Alias] section must precede
  16080. the [Map] section (if an [Alias] section is used).  %@NL@%
  16081.  
  16082. Section names are placed within square brackets using the following syntax:
  16083. %@NL@%
  16084.  
  16085. %@AS@%  [section-name]%@AE@%
  16086.  
  16087. You can use a semicolon to indicate a comment in the project file. The
  16088. compiler ignores all text from the semicolon to the end of the line on which
  16089. it occurs.  %@NL@%
  16090.  
  16091.  
  16092. %@2@%%@CR:C6A00180006 @%%@AB@%18.2  Specifying Topic Files: The Files Section%@AE@%%@EH@%%@NL@%
  16093.  
  16094. Use the [Files] section of the Help project file to list all topic files
  16095. that the Help Compiler should process to produce a Help resource file. A
  16096. Help project file must have a [Files] section.%@CR:C6A00180007 @%%@NL@%
  16097.  
  16098. The following sample shows the format of the [Files] section:  %@NL@%
  16099.  
  16100. %@AS@%  [FILES] 
  16101. %@AS@%  HELPEX.RTF ;Main topics for HelpEx application 
  16102. %@AS@%  TERMS.RTF  ;Lookup terms for HelpEx appliction%@AE@%
  16103.  
  16104. Using the path defined in the %@AB@%ROOT%@AE@% option, the Help Compiler finds and
  16105. processes all files listed in this section of the Help project file. If the
  16106. file is not on the defined path and cannot be found, the compiler generates
  16107. an error. For more information about the %@AB@%ROOT%@AE@% option, see Section 18.4.3,
  16108. "Specifying the Root Directory: The Root Option."  %@NL@%
  16109.  
  16110. You can include files in the build process using the C %@AB@%#include%@AE@% directive
  16111. command.  %@NL@%
  16112.  
  16113. The %@AB@%#include%@AE@% directive uses the following syntax:  %@NL@%
  16114.  
  16115. %@AS@%  #include <filename>%@AE@%
  16116.  
  16117. You must include the angle brackets around the filename. The pound sign ( #
  16118. ) must be the first character in the line. The filename must specify a
  16119. complete path, either the path defined by the %@AB@%ROOT %@AE@%option or an absolute
  16120. directory path to the file.  %@NL@%
  16121.  
  16122. You may find it easier to create a text file that lists all files in the
  16123. Help project and include that file in the build, as in this example:  %@NL@%
  16124.  
  16125. %@AS@%  [FILES] 
  16126. %@AS@%  #include <hlpfiles.inc>%@AE@%
  16127.  
  16128.  
  16129. %@2@%%@CR:C6A00180008 @%%@AB@%18.3  Specifying Build Tags: The BuildTags Section%@AE@%%@EH@%%@NL@%
  16130.  
  16131. If you code build tags in your topic files, use the [BuildTags] section of
  16132. the Help project file to define all the valid build tags for a particular
  16133. Help project. The [BuildTags] section is optional.%@CR:C6A00180009 @%%@NL@%
  16134.  
  16135. The following example shows the format of the [BuildTags] section in a
  16136. sample Help project file:  %@NL@%
  16137.  
  16138. %@AS@%  [BUILDTAGS] 
  16139. %@AS@%  WINENV  ;topics to include in Windows build 
  16140. %@AS@%  DEBUGBUILD ;topics to include in debugging build 
  16141. %@AS@%  TESTBUILD ;topics to include in a mini-build for testing%@AE@%
  16142.  
  16143. The [BuildTags] section can include up to 30 build tags. The build tags are
  16144. not case-sensitive and may not contain space characters. Only one build tag
  16145. is allowed per line in this section. The compiler will generate an error
  16146. message if anything other than a comment is listed after a build tag in the
  16147. [BuildTags] section.  %@NL@%
  16148.  
  16149. For information about coding build tags in topic files, see Section 17.3.3,
  16150. "Assigning Build Tags."%@CR:C6A00180010 @%%@NL@%
  16151.  
  16152.  
  16153. %@2@%%@CR:C6A00180011 @%%@AB@%18.4  Specifying Options: The Options Section%@AE@%%@EH@%%@NL@%
  16154.  
  16155. Use the [Options] section of the Help project file to specify the following
  16156. options:%@CR:C6A00180012 @%%@NL@%
  16157.  
  16158. %@TH:  29  1401 02 34 42 @%
  16159. Option                            Meaning
  16160. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16161. %@AB@%BUILD%@AE@%                             Determines what topics the compiler 
  16162.                                   includes in the build.
  16163.  
  16164. %@AB@%COMPRESS%@AE@%                          Specifies compression of the Help 
  16165.                                   resource file.
  16166.  
  16167. %@AB@%FORCEFONT%@AE@%                         Specifies the creation of a Help 
  16168.                                   resource file using only one font.
  16169.  
  16170. %@AB@%INDEX%@AE@%                             Specifies the context string of the Help
  16171.                                   index.
  16172.  
  16173. %@AB@%MAPFONTSIZE%@AE@%                       Determines the mapping of specified font
  16174.                                   sizes to different sizes.
  16175.  
  16176. %@AB@%MULTIKEY%@AE@%                          Specifies alternate key-word mapping for
  16177.                                   topics.
  16178.  
  16179. %@AB@%ROOT%@AE@%                              Designates the directory to be used for 
  16180.                                   the Help build.
  16181.  
  16182. %@AB@%TITLE%@AE@%                             Specifies the title shown for the Help 
  16183.                                   system.
  16184.  
  16185. %@AB@%WARNING%@AE@%                           Indicates the kind of error message the 
  16186.                                   compiler reports.
  16187.  
  16188. %@TE:  29  1401 02 34 42 @%
  16189.  
  16190. These options can appear in any order within the [Options] section. The
  16191. [Options] section is not required.  %@NL@%
  16192.  
  16193. Detailed explanations of the available options follow.%@CR:C6A00180013 @%%@NL@%
  16194.  
  16195.  
  16196. %@3@%%@CR:C6A00180014 @%%@AB@%18.4.1  Specifying Error Reporting: The Warning Option%@AE@%%@EH@%%@NL@%
  16197.  
  16198. Use the %@AB@%WARNING%@AE@% option to specify the amount of debugging information that
  16199. the compiler reports. The %@AB@%WARNING%@AE@% option has the following syntax:%@CR:C6A00180015 @%%@NL@%
  16200.  
  16201. %@AS@%  WARNING = level%@AE@%
  16202.  
  16203. You can set the %@AB@%WARNING%@AE@% option to any of the following levels:  %@NL@%
  16204.  
  16205. %@TH:   9   472 02 34 42 @%
  16206. Level                             Information Reported
  16207. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16208. 1                                 Only the most severe warnings.
  16209.  
  16210. 2                                 An intermediate level of warnings. 
  16211.  
  16212. 3                                 All warnings. This is the default level 
  16213.                                   if no %@AB@%WARNING%@AE@% option is specified.
  16214.  
  16215. %@TE:   9   472 02 34 42 @%
  16216.  
  16217. The following example specifies an intermediate level of error reporting:  %@NL@%
  16218.  
  16219. %@AS@%  [OPTIONS] 
  16220. %@AS@%  WARNING=2%@AE@%
  16221.  
  16222. The compiler reports errors to the standard output file, typically the
  16223. screen. You may want to redirect the errors to a disk file so that you can
  16224. browse it when you are debugging the Help system. The following example
  16225. shows the redirection of compiler screen output to a file.  %@NL@%
  16226.  
  16227. %@AS@%  HC HELPEX > errors.out%@AE@%
  16228.  
  16229. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16230. HINT 
  16231.  
  16232. %@AI@%Use the DOS CONTROL+PRINT SCREEN%@AI@% accelerator key before you begin your
  16233. %@AI@%compilation to echo errors which appear on the screen to your printer. Type
  16234. %@AI@%CONTROL+PRINT SCREEN%@AE@%%@AI@% again to stop sending information to the printer.%@CR:C6A00180016 @%%@AE@%%@AE@%
  16235. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16236.  
  16237.  
  16238. %@3@%%@CR:C6A00180017 @%%@AB@%18.4.2  Specifying Build Topics: The Build Option%@AE@%%@EH@%%@NL@%
  16239.  
  16240. If you have included build tags in your topic files, use the %@AB@%BUILD%@AE@% option to
  16241. specify which topics to conditionally include in the build. If your topic
  16242. files have no build tags, omit the %@AB@%BUILD%@AE@% option from the [Options] section.%@CR:C6A00180018 @%%@NL@%
  16243.  
  16244. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16245. NOTE 
  16246.  
  16247. %@AI@%All build tags must be listed in the [BuildTags] section of the project
  16248. %@AI@%file, regardless whether or not a given conditional compilation declares the
  16249. %@AI@%tags.%@AE@%
  16250. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16251.  
  16252. See Chapter 17, "Creating the Help Topic Files," for information on
  16253. assigning build tags to topics in the Help topic files.  %@NL@%
  16254.  
  16255. The %@AB@%BUILD%@AE@% option line uses the following syntax:  %@NL@%
  16256.  
  16257. %@AS@%  BUILD = expression%@AE@%
  16258.  
  16259. %@AB@%BUILD%@AE@% expressions cannot exceed 255 characters in length, and must be
  16260. entered on only one line. %@AB@%BUILD%@AE@% expressions use Boolean logic to specify
  16261. which topics within the specified Help topic files the compiler will include
  16262. in the build. The tokens of the language are:  %@NL@%
  16263.  
  16264. %@TH:   7   339 02 24 52 @%
  16265. Token                   Description
  16266. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16267. <tag>                   Build tag
  16268. ( )                     Parentheses
  16269. &                       AND operator
  16270. |                       OR operator
  16271. ~                       NOT operator
  16272. %@TE:   7   339 02 24 52 @%
  16273.  
  16274. The compiler evaluates all build expressions from left to right. The
  16275. operators have the following precedence:%@CR:C6A00180019 @%%@NL@%
  16276.  
  16277. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16278. 1. ( )
  16279. 2. ~
  16280. 3. &
  16281. 4. |
  16282.  
  16283. For example, if you coded build tags called WINENV, APP1, and TEST_BUILD in
  16284. your topic files, you could include one of the following build expressions
  16285. in the [Options] section:  %@NL@%
  16286.  
  16287. %@AB@%Build Expression%@AE@%                  %@AB@%Topics Built%@AE@%
  16288. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16289. BUILD = WINENV                    Only topics that have the WINENV tag 
  16290.  
  16291. BUILD = WINENV & APP1             Topics that have both the WINENV and 
  16292.                                   APP1 tags 
  16293.  
  16294. BUILD = WINENV | APP1             Topics that have either the WINENV tag 
  16295.                                   or the APP1 tag
  16296.  
  16297. BUILD = (WINENV | APP1) &         Topics that have either the WINENV or 
  16298. TESTBUILD                         the APP1 tags and that also have the 
  16299.                                   TESTBUILD tag
  16300.  
  16301. BUILD =~ APP1                     Topics that do not have a APP1 tag%@CR:C6A00180020 @%
  16302.  
  16303.  
  16304. %@3@%%@CR:C6A00180021 @%%@AB@%18.4.3  Specifying the Root Directory: The Root Option%@AE@%%@EH@%%@NL@%
  16305.  
  16306. Use the %@AB@%ROOT%@AE@% option to designate the root directory of the Help project. The
  16307. compiler searches for files in the specified root directory.%@CR:C6A00180022 @%%@NL@%
  16308.  
  16309. The %@AB@%ROOT%@AE@% option uses the following syntax:  %@NL@%
  16310.  
  16311. %@AS@%  ROOT = pathname%@AE@%
  16312.  
  16313. For example, the following root option specifies that the root directory is
  16314. \BUILD\TEST on drive D:  %@NL@%
  16315.  
  16316. %@AS@%  [OPTIONS] 
  16317. %@AS@%  ROOT=D:\BUILD\TEST%@AE@%
  16318.  
  16319. The %@AB@%ROOT%@AE@% option allows you to refer to all relative paths off the root
  16320. directory of the Help project. For example, the following entry in the
  16321. [Files] section refers to a relative path off the root directory:  %@NL@%
  16322.  
  16323. %@AS@%  TOPICS\FILE.RTF%@AE@%
  16324.  
  16325. To refer to a file in a fixed location, independent of the project root, you
  16326. must specify a fully qualified or "absolute" path, including a drive letter,
  16327. if necessary, as in the following line:  %@NL@%
  16328.  
  16329. %@AS@%  D:\HELPTEST\TESTFILE.RTF%@AE@%
  16330.  
  16331. If you do not include the %@AB@%ROOT%@AE@% option in your Help project file, all paths
  16332. are relative to the current DOS directory.%@CR:C6A00180023 @%%@NL@%
  16333.  
  16334.  
  16335. %@3@%%@CR:C6A00180024 @%%@AB@%18.4.4  Specifying the Index: The Index Option%@AE@%%@EH@%%@NL@%
  16336.  
  16337. Use the %@AB@%INDEX%@AE@% option to identify the context string of the Help index.
  16338. Because the Index button gives the user access to the index from anywhere in
  16339. the Help system, you will probably not want to author terms to jump to the
  16340. index. Users access this general index either from the Help menu of the
  16341. application or by choosing the Index button from the Help window.%@CR:C6A00180025 @%%@NL@%
  16342.  
  16343. Assigning a context string to the index topic in the [Options] section lets
  16344. the compiler know the location of the main index of Help topics for the
  16345. application's Help file. If you do not include the %@AB@%INDEX%@AE@% option in the
  16346. [Options] section, the compiler assumes that the first topic it encounters
  16347. is the index.  %@NL@%
  16348.  
  16349. The %@AB@%INDEX%@AE@% option uses the following syntax:  %@NL@%
  16350.  
  16351. %@AS@%  INDEX = context-string%@AE@%
  16352.  
  16353. The context string specified must match the context string you assigned to
  16354. the Help index topic. In the following example, the writer informs the
  16355. compiler that the context string of the Help index is "main_index":  %@NL@%
  16356.  
  16357. %@AS@%  [OPTIONS] 
  16358. %@AS@%  INDEX=main_index%@AE@%
  16359.  
  16360. For information about assigning context strings, see Section 17.3.2,
  16361. "Assigning Context Strings."%@CR:C6A00180026 @%%@NL@%
  16362.  
  16363.  
  16364. %@3@%%@CR:C6A00180027 @%%@AB@%18.4.5  Assigning a Title to the Help System: The Title Option%@AE@%%@EH@%%@NL@%
  16365.  
  16366. You can assign a title to your Help system with the %@AB@%TITLE%@AE@% option. The title
  16367. appears in the title bar of the Help window with the word "Help"
  16368. automatically appended, followed by the DOS filename of the Help resource
  16369. file.%@CR:C6A00180028 @%%@NL@%
  16370.  
  16371. The %@AB@%TITLE%@AE@% option uses the following syntax:  %@NL@%
  16372.  
  16373. %@AS@%  TITLE = Help-system-title-name%@AE@%
  16374.  
  16375. Titles are limited to 32 characters in length. If you do not specify a title
  16376. using the %@AB@%TITLE%@AE@% option, only the word Help followed by the Help system
  16377. filename will be displayed in the title bar. Because the compiler always
  16378. inserts the word Help, you should keep in mind not to duplicate it in your
  16379. title.Title option  %@NL@%
  16380.  
  16381.  
  16382. %@3@%%@CR:C6A00180029 @%%@AB@%18.4.6  Converting Fonts: The Forcefont Option%@AE@%%@EH@%%@NL@%
  16383.  
  16384. You can use the %@AB@%FORCEFONT%@AE@% option to create a Help resource file that is made
  16385. up of only one typeface or font. This is useful if you must compile a Help
  16386. system using topic files that include fonts not supported by your users'
  16387. systems.%@CR:C6A00180030 @%%@NL@%
  16388.  
  16389. The %@AB@%FORCEFONT%@AE@% option uses the following syntax:  %@NL@%
  16390.  
  16391. %@AS@%  FORCEFONT = fontname%@AE@%
  16392.  
  16393. The %@AI@%fontname%@AE@% parameter is any Windows system font. Windows ships with the
  16394. following fonts and sizes:  %@NL@%
  16395.  
  16396.  
  16397.   ■   Courier 10,12,15 %@NL@%
  16398.  
  16399.   ■   Helv 8,10,12,14,18,24 %@NL@%
  16400.  
  16401.   ■   Modern %@NL@%
  16402.  
  16403.   ■   Roman %@NL@%
  16404.  
  16405.   ■   Script %@NL@%
  16406.  
  16407.   ■   Symbol 8,10,12,14,18,24 %@NL@%
  16408.  
  16409.   ■   Tms Rmn 8,10,12,14,18,24%@NL@%
  16410.  
  16411.  
  16412. Font names must be spelled the same as they are in the Fonts dialog box in
  16413. Control Panel. Font names do not exceed 20 characters in length. If you
  16414. designate a font that is not recognized by the compiler, an error message is
  16415. generated and the compilation continues using the default Helv font.  %@NL@%
  16416.  
  16417. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16418. NOTE
  16419.  
  16420. %@AI@%The %@AI@%fontname%@AE@%%@AI@% used in the %@AE@%%@AI@%%@AB@%FORCEFONT%@AE@%%@AE@%%@AI@% option cannot contain spaces. Therefore,
  16421. %@AI@%Tms Rmn font cannot be used with %@AE@%%@AI@%%@AB@%FORCEFONT%@AE@%%@AE@%%@AI@%.%@CR:C6A00180031 @%%@AE@%%@AE@%
  16422. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16423.  
  16424.  
  16425. %@3@%%@CR:C6A00180032 @%%@AB@%18.4.7  Changing Font Sizes : The Mapfontsize Option%@AE@%%@EH@%%@NL@%
  16426.  
  16427. The font sizes specified in your topic files can be mapped to different
  16428. sizes using the %@AB@%MAPFONTSIZE%@AE@% option. In this manner, you can create and edit
  16429. text in a size chosen for easier viewing in the topic files and have them
  16430. sized by the compiler for the actual Help display. This may be useful if
  16431. there is a large size difference between your authoring monitor and your
  16432. intended display monitor.%@CR:C6A00180033 @%%@NL@%
  16433.  
  16434. The %@AB@%MAPFONTSIZE%@AE@% option uses the following syntax:  %@NL@%
  16435.  
  16436. %@AS@%  MAPFONTSIZE = m[-n]:p%@AE@%
  16437.  
  16438. The %@AI@%m%@AE@% parameter is the size of the source font, and the %@AI@%p%@AE@% parameter is the
  16439. size of the desired font for the Help resource file. All fonts in the topic
  16440. files that are size %@AI@%m%@AE@% are changed to size %@AI@%p%@AE@%. The optional parameter %@AI@%n%@AE@% allows
  16441. you to specify a font range to be mapped. All fonts in the topic files
  16442. falling between %@AI@%m%@AE@% and %@AI@%n%@AE@%, inclusive, are changed to size %@AI@%p%@AE@%. The following
  16443. examples illustrate the use of the %@AB@%MAPFONTSIZE%@AE@% option:  %@NL@%
  16444.  
  16445. %@AS@%  MAPFONTSIZE=12-24:16 ;make fonts from 12 to 24 come out 16.
  16446. %@AS@%  MAPFONTSIZE=8:12  ;make all size 8 fonts come out size 12.%@AE@%
  16447.  
  16448. Note that you can map only one font size or range with each %@AB@%MAPFONTSIZE%@AE@%
  16449. statement used in the Options section. If you use more than one %@AB@%MAPFONTSIZE%@AE@%
  16450. statement, the source font size or range specified in subsequent statements
  16451. cannot overlap previous mappings. For instance, the following mappings would
  16452. generate an error when the compiler encountered the second statement:  %@NL@%
  16453.  
  16454. %@AS@%  MAPFONTSIZE=12-24:16 MAPFONTSIZE=14:20%@AE@%
  16455.  
  16456. Because the second mapping shown in the first example contains a size
  16457. already mapped in the preceding statement, the compiler will ignore the
  16458. line. There is a maximum of five font ranges that can be specified in the
  16459. project file.%@CR:C6A00180034 @%%@NL@%
  16460.  
  16461.  
  16462. %@3@%%@CR:C6A00180035 @%%@AB@%18.4.8  Multiple Key-Word Tables: The Multikey Option%@AE@%%@EH@%%@NL@%
  16463.  
  16464. The %@AB@%MULTIKEY%@AE@% option specifies a character to be used for an additional
  16465. key-word table.%@CR:C6A00180036 @%%@NL@%
  16466.  
  16467. The %@AB@%MULTIKEY%@AE@% option uses the following syntax:  %@NL@%
  16468.  
  16469. %@AS@%  MULTIKEY = footnote-character%@AE@%
  16470.  
  16471. The %@AI@%footnote-character%@AE@% parameter is the case-sensitive letter to be used for
  16472. the key-word footnote. The following example illustrates the enabling of the
  16473. letter L for a key word-table footnote:  %@NL@%
  16474.  
  16475. %@AS@%  MULTIKEY=L%@AE@%
  16476.  
  16477. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16478. NOTE
  16479.  
  16480. %@AI@%You must be sure to limit your key word-table footnotes to one case, usually
  16481. %@AI@%uppercase. In the previous example, topics with the footnote L would have
  16482. %@AI@%their key words incorporated into the additional key word table, whereas
  16483. %@AI@%those assigned the letter l would not.%@AE@%
  16484. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16485.  
  16486. You may use any alphanumeric character for a key-word table except "K" and
  16487. "k" which are reserved for Help's normal key-word table. There is an
  16488. absolute limit of five key-word tables, including the normal table. However,
  16489. depending upon system configuration and the structure of your Help system, a
  16490. practical limit of only two or three may actually be the case. If the
  16491. compiler cannot create an additional table, the excess table is ignored in
  16492. the build.%@CR:C6A00180037 @%%@NL@%
  16493.  
  16494.  
  16495. %@3@%%@CR:C6A00180038 @%%@AB@%18.4.9  Compressing the File: The Compress Option%@AE@%%@EH@%%@NL@%
  16496.  
  16497. You can use the %@AB@%COMPRESS%@AE@% option to reduce the size of the Help resource file
  16498. created by the compiler. The amount of file compression realized will vary
  16499. according to the number, size and complexity of topics that are compiled. In
  16500. general, the larger the Help files, the more they can be compressed.%@CR:C6A00180039 @%%@NL@%
  16501.  
  16502. The %@AB@%COMPRESS%@AE@% option uses the following syntax:  %@NL@%
  16503.  
  16504. %@AS@%  COMPRESS = TRUE | FALSE%@AE@%
  16505.  
  16506. Because the Help application can load compressed files quickly, there is a
  16507. clear advantage in creating and shipping compressed Help files with your
  16508. application. Compiling with compression turned on, however, may increase the
  16509. compile time, because of the additional time required to assemble and sort a
  16510. key-phrase table. Thus, you may want to compile without compression in the
  16511. early stages of a project.  %@NL@%
  16512.  
  16513. The %@AB@%COMPRESS%@AE@% option causes the compiler to compress the system by combining
  16514. repeated phrases found within the source file(s). The compiler creates a
  16515. phrase-table file with the .PH extension if it does not find one already in
  16516. existence. If the compiler finds a file with the .PH extension, it will use
  16517. the file for the current compilation. This is in order to speed compression
  16518. when not a lot of text has changed since the last compilation.  %@NL@%
  16519.  
  16520. Deleting the key-phrase file before each compilation will prevent the
  16521. compiler from using the previous file. Maximum compression will result only
  16522. by forcing the compiler to create a new phrase table.%@CR:C6A00180040 @%%@NL@%
  16523.  
  16524.  
  16525. %@2@%%@CR:C6A00180041 @%%@AB@%18.5  Specifying Alternate Context Strings: The Alias Section%@AE@%%@EH@%%@NL@%
  16526.  
  16527. Use the [Alias] section to assign one or more context strings to the same
  16528. topic alias. Because context strings must be unique for each topic and
  16529. cannot be used for any other topic in the Help project, the [Alias] section
  16530. provides a way to delete or combine Help topics without recoding your files.
  16531. The [Alias] section is optional.%@CR:C6A00180042 @%%@CR:C6A00180043 @%%@NL@%
  16532.  
  16533. For example, if you create a topic that replaces the information in three
  16534. other topics, and you delete the three, you will have to search through your
  16535. files for invalid cross-references to the deleted topics. You can avoid this
  16536. problem by using the [Alias] section to assign the name of the new topic to
  16537. the deleted topics. The [Alias] section can also be used when your
  16538. application program has multiple context identifiers for which you have only
  16539. one topic. This can be the case with context-sensitive Help.  %@NL@%
  16540.  
  16541. Each expression in the [Alias] section has the following format:  %@NL@%
  16542.  
  16543. %@AI@%context_string%@AE@%=%@AI@%alias%@AE@%  %@NL@%
  16544.  
  16545. In the alias expression the %@AI@%alias%@AE@% parameter is the alternate string, or
  16546. alias name, and the %@AI@%context_string%@AE@% parameter is the context string
  16547. identifying a particular topic. An alias string has the same format and
  16548. follows the same conventions as the topic context string. That is, it is not
  16549. case-sensitive and may contain the alphabetic characters A-Z, numeric
  16550. characters 0-9, and the period and underscore characters.  %@NL@%
  16551.  
  16552. The following example illustrates an [Alias] section:  %@NL@%
  16553.  
  16554. %@AS@%  [ALIAS] 
  16555. %@AS@%  sm_key=key_shrtcuts 
  16556. %@AS@%  cc_key=key_shrtcuts 
  16557. %@AS@%  st_key=key_shrtcuts ;combined into keyboard shortcuts topic 
  16558. %@AS@%  clskey=us_dlog_bxs 
  16559. %@AS@%  maakey=us_dlog_bxs ;covered in using dialog boxes topic  
  16560. %@AS@%  chk_key=dlogprts 
  16561. %@AS@%  drp_key=dlogprts 
  16562. %@AS@%  lst_key=dlogprts 
  16563. %@AS@%  opt_key=dlogprts 
  16564. %@AS@%  tbx_key=dlogprts  ;combined into parts of dialog box topic 
  16565. %@AS@%  frmtxt=edittxt 
  16566. %@AS@%  wrptxt=edittxt 
  16567. %@AS@%  seltxt=edittxt  ;covered in editing text topic%@AE@%
  16568.  
  16569. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16570. NOTE
  16571.  
  16572. %@AI@%You can use alias names in the [Map] section of the Help project file. If
  16573. %@AI@%you do, however, the [Alias] section must precede the [Map] section.%@CR:C6A00180044 @%%@CR:C6A00180045 @%%@AE@%
  16574. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16575.  
  16576.  
  16577. %@2@%%@CR:C6A00180046 @%%@AB@%18.6  Mapping Context-Sensitive Topics: The Map Section%@AE@%%@EH@%%@NL@%
  16578.  
  16579. If your Help system supports context-sensitive Help, use the [Map] section
  16580. to associate either context strings or aliases to context numbers. The
  16581. context number corresponds to a value the parent application passes to the
  16582. Help application in order to display a particular topic. This section is
  16583. optional.%@CR:C6A00180047 @%%@CR:C6A00180048 @%%@NL@%
  16584.  
  16585. When writing the [Map] section, you can do the following:  %@NL@%
  16586.  
  16587.  
  16588.   ■   Use either decimal or hexadecimal numbers formatted in standard C
  16589.       notation to specify context numbers.%@NL@%
  16590.  
  16591.   ■   Assign no more than one context number to a context string or alias.%@NL@%
  16592.  
  16593. %@STUB@%      Assigning the same number to more than one context string will
  16594.       generate a compiler error. %@NL@%
  16595.  
  16596.   ■   Separate context numbers and context strings by an arbitrary amount of
  16597.       white space using either space characters or tabs.%@NL@%
  16598.  
  16599.  
  16600. You can use the C %@AB@%#include%@AE@% directive to include other files in the mapping.
  16601. In addition, the Map section supports an extended format that lets you
  16602. include C files with the .H extension directly. Entries using this format
  16603. must begin with the %@AB@%#define%@AE@% directive and may contain comments in C format,
  16604. as in this example:%@CR:C6A00180049 @%%@CR:C6A00180050 @%%@NL@%
  16605.  
  16606. %@AS@%  #define    context_string    context_number    /* comment */%@AE@%
  16607.  
  16608. The following example illustrates several formats you can use in the [Map]
  16609. section:  %@NL@%
  16610.  
  16611. %@AS@%  [MAP] 
  16612. %@AS@%  "
  16613. %@AS@%  Edit_Window  0x0001 
  16614. %@AS@%  Control_Menu  0x0002 
  16615. %@AS@%  Maximize_Icon  0x0003 
  16616. %@AS@%  Minimize_Icon  0x0004 
  16617. %@AS@%  Split_Bar  0x0005 
  16618. %@AS@%  Scroll_Bar  0x0006 
  16619. %@AS@%  Title_Bar  0x0007 
  16620. %@AS@%  Window_Border  0x0008 
  16621. %@AS@%  
  16622. %@AS@%  dcmb_scr  30 ; Document Control-menu Icon 
  16623. %@AS@%  dmxi_scr  31 ; Document Maximize Icon 
  16624. %@AS@%  dmni_scr  32 ; Document Minimize Icon 
  16625. %@AS@%  dri_scr   33 ; Document Restore Icon 
  16626. %@AS@%  dtb_scr   34 ; Document Title Bar 
  16627. %@AS@%   
  16628. %@AS@%  
  16629. %@AS@%  #define vscroll  0x010A /* Vertical Scroll Bar */ 
  16630. %@AS@%  #define hscroll  0x010E /* Horizontal Scroll Bar */ 
  16631. %@AS@%  #define scrollthm 0x0111 /* Scroll Thumb */ 
  16632. %@AS@%  #define upscroll 0x0112 /* Up Scroll Arrow */ 
  16633. %@AS@%  #define dnscroll 0x0113 /* Down Scroll Arrow */ 
  16634. %@AS@%   
  16635. %@AS@%  
  16636. %@AS@%  #include <sample.h>%@AE@%
  16637.  
  16638. In the example:%@CR:C6A00180051 @%%@CR:C6A00180052 @%%@NL@%
  16639.  
  16640. "
  16641.  
  16642. The first eight entries give hexadecimal equivalents for the context
  16643. numbers.%@NL@%
  16644.  
  16645.  
  16646.  
  16647. The next five entries show decimal context numbers.%@NL@%
  16648.  
  16649.  
  16650.  
  16651. The next five entries show how you might include topics defined in a C
  16652. include file.%@NL@%
  16653.  
  16654.  
  16655.  
  16656. This entry shows a C %@AB@%#include%@AE@% directive for some generic topics.%@NL@%
  16657.  
  16658. If context numbers use the %@AB@%#define%@AE@% directive, and the file containing the
  16659. %@AB@%#define%@AE@% statements is included in both the application code and the Help
  16660. file, then updates made to the context numbers by the application
  16661. programmers will automatically be reflected in the next Help build.  %@NL@%
  16662.  
  16663. You can define the context strings listed in the [Map] section either in a
  16664. Help topic or in the [Alias] section. The compiler generates a warning
  16665. message if a    context string appearing in the [Map] section is not defined
  16666. in any of the topic files or in the [Alias] section.  %@NL@%
  16667.  
  16668. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16669. NOTE
  16670.  
  16671. %@AI@%If you use an alias name, the [Alias] section must precede the [Map] section
  16672. %@AI@%in the Help project file. %@AE@%
  16673. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16674.  
  16675. For more information about context-sensitive Help, see Section 16.2.5,
  16676. "Displaying Context-Sensitive Help Topics."%@CR:C6A00180053 @%%@CR:C6A00180054 @%%@NL@%
  16677.  
  16678.  
  16679. %@2@%%@CR:C6A00180055 @%%@AB@%18.7  Including Bitmaps by Reference: The Bitmaps Section%@AE@%%@EH@%%@NL@%
  16680.  
  16681. If your Help system uses bitmaps by reference, the filenames of each of the
  16682. bitmaps must be listed in the [Bitmaps] section of the project file. The
  16683. following example illustrates the format of the [Bitmaps] section.%@CR:C6A00180056 @%%@CR:C6A00180057 @%%@NL@%
  16684.  
  16685. %@AS@%  [BITMAPS] 
  16686. %@AS@%  DUMP01.BMP 
  16687. %@AS@%  DUMP02.BMP
  16688. %@AS@%  DUMP03.BMP
  16689. %@AS@%  c:\PROJECT\HELP\BITMAPS\DUMP04.BMP%@AE@%
  16690.  
  16691. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16692. NOTE
  16693.  
  16694. %@AI@%The [Bitmaps] section uses the same rules as the [Files] section for
  16695. %@AI@%locating bitmap files. %@AE@%
  16696. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16697.  
  16698.  
  16699. %@2@%%@CR:C6A00180058 @%%@AB@%18.8  Compiling Help Files%@AE@%%@EH@%%@NL@%
  16700.  
  16701. After you have created a Help project file, you are ready to build a Help
  16702. file using the Help Compiler. The compiler generates the binary Help
  16703. resource file from the topic files listed in the Help project file. When the
  16704. build process is complete, your application can access the Help resource
  16705. file that results.%@CR:C6A00180059 @%%@CR:C6A00180060 @%%@NL@%
  16706.  
  16707. Before initiating a build operation to create the Help file, consider the
  16708. locations of the following files:  %@NL@%
  16709.  
  16710.  
  16711.   ■   The Help Compiler, HC.EXE. The compiler must be in a directory from
  16712.       which it can be executed. This could be the current working directory,
  16713.       on the path set with the PATH environment variable, or a directory
  16714.       specified by a full pathname, as follows:
  16715.  
  16716. %@AS@%      C:\BIN\HC HELPEX.HPJ%@AE@%
  16717. %@NL@%
  16718.  
  16719.   ■   The Help project file, %@AI@%filename%@AE@%.HPJ. The project file can be located
  16720.       either in the current directory or specified by a path, as follows:%@CR:C6A00180061 @%%@CR:C6A00180062 @%
  16721.  
  16722. %@AS@%      C:\BIN\HC D:\MYPROJ\HELPEX.HPJ%@AE@%
  16723. %@NL@%
  16724.  
  16725.   ■   The topic files named in the Help project file, saved as RTF. The
  16726.       topic files may be located in the current working directory, a
  16727.       subdirectory of the current working directory specified in the [Files]
  16728.       section, or the location specified in the Root option.%@NL@%
  16729.  
  16730.   ■   Files included with the %@AB@%#include%@AE@% directive in the Help project file.
  16731.       Since the %@AB@%#include%@AE@% directive can take pathnames, then any number of
  16732.       places will work for these files.%@NL@%
  16733.  
  16734.   ■   All bitmap files listed by reference in the topic files.%@NL@%
  16735.  
  16736.  
  16737. You must also place any files named in an %@AB@%#include%@AE@% directive in the path of
  16738. the project root directory or specify their path using the %@AB@%ROOT %@AE@%option. The
  16739. compiler searches only the directories specified in the Help project file.
  16740. For information about the %@AB@%ROOT%@AE@% option, see Section 18.4.3, "Specifying the
  16741. Root Directory: The Root Option."  %@NL@%
  16742.  
  16743. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16744. NOTE
  16745.  
  16746. %@AI@%If you use a RAM drive for temporary files (set with the DOS environment
  16747. %@AI@%variable TMP), it must be large enough to hold the compiled Help resource
  16748. %@AI@%file. If your Help file is larger than the size of the available RAM drive,
  16749. %@AI@%the compiler will generate an error message and the compilation will be
  16750. %@AI@%aborted. %@AE@%
  16751.  
  16752. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16753.  
  16754.  
  16755. %@3@%%@CR:C6A00180063 @%%@AB@%18.8.1  Using the Help Compiler%@AE@%%@EH@%%@NL@%
  16756.  
  16757. To run the Help Compiler, use the %@AB@%HC%@AE@% command. There are no options for %@AB@%HC%@AE@%.
  16758. All options are specified in the Help project file.%@CR:C6A00180064 @%%@CR:C6A00180065 @%%@NL@%
  16759.  
  16760. The %@AB@%HC%@AE@% command uses the following syntax:  %@NL@%
  16761.  
  16762. %@AS@%  HC filename.HPJ%@AE@%
  16763.  
  16764. As the compiler program runs, it displays sequential periods on the screen,
  16765. indicating its progress in the process. Error messages are displayed when
  16766. each error condition is encountered. When the Help Compiler has finished
  16767. compiling, it writes a Help resource file with an .HLP extension in the
  16768. current directory and returns to the DOS prompt. The Help resource file that
  16769. results from the build has the same name as does the Help project file.  %@NL@%
  16770.  
  16771. Compiler errors and status messages can be redirected to a file using
  16772. standard DOS redirection syntax. This is useful for a lengthy build where
  16773. you may not be monitoring the entire process. The redirected file is saved
  16774. as a text file that can be viewed with any ASCII editor.%@CR:C6A00180066 @%%@CR:C6A00180067 @%%@NL@%
  16775.  
  16776.  
  16777. %@2@%%@CR:C6A00180068 @%%@AB@%18.9  Programming the Application to Access Help%@AE@%%@EH@%%@NL@%
  16778.  
  16779. The application-development team must program the application so that the
  16780. user can access the Windows Help application and your Help file. The Help
  16781. application is a stand-alone Windows application, and your application can
  16782. ask Windows to run the Help application and specify the topic that Help is
  16783. to show the user. To the user, Help appears to be part of your application,
  16784. but it acts like any other Windows application.%@CR:C6A00180069 @%%@NL@%
  16785.  
  16786.  
  16787. %@3@%%@CR:C6A00180070 @%%@AB@%18.9.1  Calling WinHelp from an Application%@AE@%%@EH@%%@NL@%
  16788.  
  16789. An application makes a Help system available to the user by calling the %@AB@%
  16790. %@AB@%WinHelp%@AE@% function.%@CR:C6A00180071 @%%@NL@%
  16791.  
  16792. The %@AB@%WinHelp%@AE@% function uses the following syntax:  %@NL@%
  16793.  
  16794. %@AS@%  BOOL WinHelp (hWnd, lpHelpFile, wCommand, dwData)%@AE@%
  16795.  
  16796. The %@AI@%hWnd%@AE@% parameter identifies the window requesting Help. The Windows Help
  16797. application uses this identifier to keep track of which applications have
  16798. requested Help.  %@NL@%
  16799.  
  16800. The %@AI@%lpHelpFile%@AE@% parameter specifies the name (with optional directory path)
  16801. of the Help file containing the desired topic.  %@NL@%
  16802.  
  16803. The %@AI@%wCommand%@AE@% parameter specifies either the type of search that the Windows
  16804. Help application is to use to locate the specified topic, or that the
  16805. application no longer requires Help. It may be set to any one of the
  16806. following values:%@CR:C6A00180072 @%%@NL@%
  16807.  
  16808. %@TH:  23  1116 02 34 42 @%
  16809. Value                             Meaning
  16810. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16811. HELP_CONTEXT                      Displays Help for a particular topic 
  16812.                                   identified by a context number.
  16813.  
  16814. HELP_HELPONHELP                   Displays the Using Help index topic.
  16815.  
  16816. HELP_INDEX                        Displays the main Help index topic.
  16817.  
  16818. HELP_KEY                          Displays Help for a topic identified by 
  16819.                                   a key word.
  16820.  
  16821. HELP_MULTIKEY                     Displays Help for a topic identified by 
  16822.                                   a key word in an alternate key-word 
  16823.                                   table.
  16824.  
  16825. HELP_QUIT                         Informs the Help application that Help 
  16826.                                   is no longer needed. If no other 
  16827.                                   applications have asked for Help, 
  16828.                                   Windows closes the Help application.
  16829.  
  16830. HELP_SETINDEX                     Displays a designated Help index topic. 
  16831.  
  16832. %@TE:  23  1116 02 34 42 @%
  16833.  
  16834. The %@AI@%dwData%@AE@% parameter specifies the topic for which the application is
  16835. requesting Help. The format of %@AI@%dwData%@AE@% depends upon the value of %@AI@%wCommand%@AE@%
  16836. passed when your application calls %@AB@%WinHelp%@AE@%. The following list describes the
  16837. format of %@AI@%dwData%@AE@% for each value of %@AI@%wCommand%@AE@%.%@CR:C6A00180073 @%%@NL@%
  16838.  
  16839. %@TH:  25  1192 02 34 42 @%
  16840. wCommand Value                    dwData Format
  16841. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  16842. HELP_CONTEXT                      An unsigned long integer containing the 
  16843.                                   context number for the topic. Instead of
  16844.                                   using HELP_INDEX, HELP_CONTEXT can use 
  16845.                                   the value -1.
  16846.  
  16847. HELP_HELPONHELP                   Ignored.
  16848.  
  16849. HELP_INDEX                        Ignored.
  16850.  
  16851. HELP_KEY                          A long pointer to a string which 
  16852.                                   contains a key word for the desired 
  16853.                                   topic.
  16854.  
  16855. HELP_MULTIKEY                     A long pointer to the %@AB@%MULTIKEYHELP%@AE@% 
  16856.                                   structure, as defined in WINDOWS.H. This
  16857.                                   structure specifies the table footnote 
  16858.                                   character and the key word.
  16859.  
  16860. HELP_QUIT                         Ignored.
  16861.  
  16862. HELP_SETINDEX                     An unsigned long integer containing the 
  16863.                                   context number for the topic. 
  16864.  
  16865. %@TE:  25  1192 02 34 42 @%
  16866.  
  16867. Because it can specify either a context number or a key word, %@AB@%WinHelp%@AE@%
  16868. supports both context-sensitive and topical searches of the Help file.  %@NL@%
  16869.  
  16870. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16871. NOTE 
  16872.  
  16873. %@AI@%To ensure that the correct index remains set, the application should call
  16874. %@AB@%WinHelp%@AE@%%@AI@% with wCommand%@AE@%%@AI@% set to HELP_SETINDEX (with dwData%@AE@%%@AI@% specifying the
  16875. %@AI@%corresponding context identifier) following each call to %@AE@%%@AI@%%@AB@%WinHelp%@AE@%%@AE@%%@AI@% with a
  16876. %@AI@%command set to HELP_CONTEXT. HELP_INDEX should never be used with
  16877. %@AI@%HELP_SETINDEX.%@CR:C6A00180074 @%%@AE@%%@AE@%
  16878. ────────────────────────────────────────────────────────────────────────────%@NL@%
  16879.  
  16880.  
  16881. %@3@%%@CR:C6A00180075 @%%@AB@%18.9.2  Getting Context-Sensitive Help%@AE@%%@EH@%%@NL@%
  16882.  
  16883. Context-sensitive Help should be made available when a user wants to learn
  16884. about the purpose of a particular window or control. For example, the user
  16885. might pull down the File menu, select the Open command (by using the
  16886. DIRECTION keys), and then press F1 to get Help for the command.%@CR:C6A00180076 @%%@CR:C6A00180077 @%%@NL@%
  16887.  
  16888. Implementing certain types of context-sensitive help requires advanced
  16889. programming techniques. The Helpex sample application illustrates the use of
  16890. two techniques. These techniques are described in the following sections.  %@NL@%
  16891.  
  16892.  
  16893. %@4@%%@AB@%Shift+F1 Support%@AE@%%@EH@%%@NL@%
  16894.  
  16895. To implement a SHIFT+F1 mode, such as in Microsoft Excel or Microsoft Word
  16896. for Windows, Helpex responds to the SHIFT+F1 accelerator key by calling
  16897. %@AB@%SetCursor%@AE@% to change the shape of the cursor to an arrow pointer supplemented
  16898. by a question mark.%@CR:C6A00180078 @%%@CR:C6A00180079 @%%@NL@%
  16899.  
  16900. %@AS@%  case WM_KEYDOWN:
  16901. %@AS@%        if (wParam == VK_F1) {
  16902. %@AS@%  
  16903. %@AS@%            /* If Shift-F1, turn help mode on and set help cursor */ 
  16904. %@AS@%  
  16905. %@AS@%            if (GetKeyState(VK_SHIFT)) { 
  16906. %@AS@%                bHelp = TRUE;
  16907. %@AS@%                SetCursor(hHelpCursor);
  16908. %@AS@%                return (DefWindowProc(hWnd, message, wParam, lParam));
  16909. %@AS@%            }
  16910. %@AS@%  
  16911. %@AS@%            /* If F1 without shift, then call up help main index topic */
  16912. %@AS@%            else {
  16913. %@AS@%                WinHelp(hWnd,szHelpFileName,HELP_INDEX,0L);
  16914. %@AS@%            }
  16915. %@AS@%        }
  16916. %@AS@%  
  16917. %@AS@%        else if (wParam == VK_ESCAPE && bHelp) {
  16918. %@AS@%  
  16919. %@AS@%            /* Escape during help mode: turn help mode off */
  16920. %@AS@%            bHelp = FALSE;
  16921. %@AS@%            SetCursor((HCURSOR)GetClassWord(hWnd,GCW_HCURSOR));
  16922. %@AS@%        }
  16923. %@AS@%  
  16924. %@AS@%        break;%@AE@%
  16925.  
  16926. As long as the user is in Help mode (that is, until he clicks the mouse or
  16927. hits Escape), Helpex responds to WM_SETCURSOR messages by resetting the
  16928. cursor to the arrow and question mark combination.  %@NL@%
  16929.  
  16930. %@AS@%  
  16931. %@AS@%    case WM_SETCURSOR:
  16932. %@AS@%        /* In help mode it is necessary to reset the cursor in response */
  16933. %@AS@%        /* to every WM_SETCURSOR message.Otherwise, by default, Windows */
  16934. %@AS@%        /* will reset the cursor to that of the window class. */
  16935. %@AS@%  
  16936. %@AS@%        if (bHelp) {
  16937. %@AS@%            SetCursor(hHelpCursor);
  16938. %@AS@%            break;
  16939. %@AS@%        }
  16940. %@AS@%        return (DefWindowProc(hWnd, message, wParam, lParam));
  16941. %@AS@%        break;
  16942. %@AS@%  
  16943. %@AS@%    case WM_INITMENU:
  16944. %@AS@%        if (bHelp) {
  16945. %@AS@%            SetCursor(hHelpCursor);
  16946. %@AS@%        } 
  16947. %@AS@%        return (TRUE);%@AE@%
  16948.  
  16949. When the user is in SHIFT+F1 Help mode and clicks the mouse button, Helpex
  16950. will receive a WM_NCLBUTTONDOWN message if the click is in a nonclient area
  16951. of the application window. By examining the %@AI@%wParam%@AE@% value of this message,
  16952. the program can determine which context ID to pass to %@AB@%WinHelp%@AE@%.%@CR:C6A00180080 @%%@CR:C6A00180081 @%%@NL@%
  16953.  
  16954. %@AS@%  
  16955. %@AS@%    case WM_NCLBUTTONDOWN:
  16956. %@AS@%        /* If we are in help mode (Shift+F1) then display context- */
  16957. %@AS@%        /* sensitive help for nonclient area. */
  16958. %@AS@%  
  16959. %@AS@%        if (bHelp) {
  16960. %@AS@%            dwHelpContextId =
  16961. %@AS@%                (wParam == HTCAPTION)?(DWORD)HELPID_TITLE_BAR:
  16962. %@AS@%                (wParam == HTSIZE)? (DWORD)HELPID_SIZE_BOX:
  16963. %@AS@%                (wParam == HTREDUCE)? (DWORD)HELPID_MINIMIZE_ICON:
  16964. %@AS@%                (wParam == HTZOOM)? (DWORD)HELPID_MAXIMIZE_ICON:
  16965. %@AS@%                (wParam == HTSYSMENU)?(DWORD)HELPID_SYSTEM_MENU:
  16966. %@AS@%                (wParam == HTBOTTOM)? (DWORD)HELPID_SIZING_BORDER:
  16967. %@AS@%                (wParam == HTBOTTOMLEFT)? (DWORD)HELPID_SIZING_BORDER:
  16968. %@AS@%                (wParam == HTBOTTOMRIGHT)?(DWORD)HELPID_SIZING_BORDER:
  16969. %@AS@%                (wParam == HTTOP)?(DWORD)HELPID_SIZING_BORDER:
  16970. %@AS@%                (wParam == HTLEFT)?(DWORD)HELPID_SIZING_BORDER:
  16971. %@AS@%                (wParam == HTRIGHT)?(DWORD)HELPID_SIZING_BORDER:
  16972. %@AS@%                (wParam == HTTOPLEFT)?(DWORD)HELPID_SIZING_BORDER:
  16973. %@AS@%                (wParam == HTTOPRIGHT)? (DWORD)HELPID_SIZING_BORDER:
  16974. %@AS@%                (DWORD)0L;
  16975. %@AS@%  
  16976. %@AS@%            if (!((BOOL)dwHelpContextId))
  16977. %@AS@%                return (DefWindowProc(hWnd, message, wParam, lParam));
  16978. %@AS@%            bHelp = FALSE;
  16979. %@AS@%            WinHelp(hWnd,szHelpFileName,HELP_CONTEXT,dwHelpContextId);
  16980. %@AS@%            break;
  16981. %@AS@%        }
  16982. %@AS@%  
  16983. %@AS@%        return (DefWindowProc(hWnd, message, wParam, lParam));%@AE@%
  16984.  
  16985.  
  16986. %@4@%%@AB@%F1 Support%@AE@%%@EH@%%@NL@%
  16987.  
  16988. Context-sensitive F1 support for menus is relatively easy to implement in
  16989. your application. If a menu is open and the user presses F1 while one of the
  16990. menu items is highlighted, Windows sends a WM_ENTERIDLE message to the
  16991. application to indicate that the system is going back into an idle state
  16992. after having determined that F1 was not a valid key stroke for choosing a
  16993. menu item. You can take advantage of this idle state by looking at the
  16994. keyboard state at the time of the WM_ENTERIDLE message.%@CR:C6A00180082 @%%@CR:C6A00180083 @%%@NL@%
  16995.  
  16996. If the F1 key is down, then you can simulate the user's pressing the ENTER
  16997. key by posting a WM_KEYDOWN message using VK_RETURN. You don't really want
  16998. your application to execute the menu command. What you do is set a flag
  16999. (bHelp=TRUE) so that when you get the WM_COMMAND message for the menu item,
  17000. you don't execute the command. Instead, the topic for the menu item is
  17001. displayed by Windows Help.  %@NL@%
  17002.  
  17003. The following code samples illustrate F1 sensing for menu items.%@CR:C6A00180084 @%%@CR:C6A00180085 @%%@CR:C6A00180086 @%%@CR:C6A00180087 @%%@NL@%
  17004.  
  17005. %@AS@%  
  17006. %@AS@%    case WM_ENTERIDLE:
  17007. %@AS@%        if ((wParam == MSGF_MENU) && (GetKeyState(VK_F1) & 0x8000)) {
  17008. %@AS@%            bHelp = TRUE;
  17009. %@AS@%            PostMessage(hWnd, WM_KEYDOWN, VK_RETURN, 0L);
  17010. %@AS@%        }
  17011. %@AS@%        break;%@AE@%
  17012.  
  17013. %@AS@%  
  17014. %@AS@%    case WM_COMMAND:
  17015. %@AS@%        /* Was F1 just pressed in a menu, or are we in help mode */
  17016. %@AS@%        /* (Shift+F1)? */
  17017. %@AS@%  
  17018. %@AS@%        if (bHelp) {
  17019. %@AS@%            dwHelpContextId =
  17020. %@AS@%                (wParam == IDM_NEW)?(DWORD)HELPID_FILE_NEW:
  17021. %@AS@%                (wParam == IDM_OPEN)? (DWORD)HELPID_FILE_OPEN:
  17022. %@AS@%                (wParam == IDM_SAVE)? (DWORD)HELPID_FILE_SAVE:
  17023. %@AS@%                (wParam == IDM_SAVEAS)? (DWORD)HELPID_FILE_SAVE_AS:
  17024. %@AS@%                (wParam == IDM_PRINT)?(DWORD)HELPID_FILE_PRINT:
  17025. %@AS@%                (wParam == IDM_EXIT)? (DWORD)HELPID_FILE_EXIT:
  17026. %@AS@%                (wParam == IDM_UNDO)? (DWORD)HELPID_EDIT_UNDO:
  17027. %@AS@%                (wParam == IDM_CUT)?(DWORD)HELPID_EDIT_CUT:
  17028. %@AS@%                (wParam == IDM_CLEAR)?(DWORD)HELPID_EDIT_CLEAR:
  17029. %@AS@%                (wParam == IDM_COPY)? (DWORD)HELPID_EDIT_COPY:
  17030. %@AS@%                (wParam == IDM_PASTE)?(DWORD)HELPID_EDIT_PASTE:
  17031. %@AS@%                (DWORD)0L;
  17032. %@AS@%  
  17033. %@AS@%            if (!dwHelpContextId)
  17034. %@AS@%            {              Messagebox( hWnd, "Help not available for Help
  17035. %@AS@%Menu item",                          "Help Example", MB_OK
  17036. %@AS@%return (DefWindowProc(hWnd, message, wParam, lParam));
  17037. %@AS@%            }%@AE@%
  17038.  
  17039. %@AS@%  bHelp = FALSE;
  17040. %@AS@%            WinHelp(hWnd,szHelpFileName,HELP_CONTEXT,dwHelpContextId);
  17041. %@AS@%            break;
  17042. %@AS@%        }%@AE@%
  17043.  
  17044. Detecting F1 in dialog boxes is somewhat more difficult than in menus. You
  17045. must install a message filter, using the WH_MSGFILTER option of the
  17046. %@AB@%SetWindowsHook%@AE@% function. Your message filter function responds to WM_KEYDOWN
  17047. and WM_KEYUP messages for VK_F1 when they are sent to a dialog box, as
  17048. indicated by the MSGF_DIALOGBOX code. By examining the message structure
  17049. passed to the filter, you can determine the context of the F1 help─what the
  17050. dialog box is, and the specific option or item. You should not call %@AB@%WinHelp%@AE@%
  17051. while processing the filtered message, but rather post an
  17052. application-defined message to your application to call %@AB@%WinHelp%@AE@% at the first
  17053. available opportunity.%@CR:C6A00180088 @%%@CR:C6A00180089 @%%@CR:C6A00180090 @%%@CR:C6A00180091 @%%@NL@%
  17054.  
  17055.  
  17056. %@3@%%@CR:C6A00180092 @%%@AB@%18.9.3  Getting Help on an Item Listed on the Help Menu%@AE@%%@EH@%%@NL@%
  17057.  
  17058. Sometimes users may want information about a general concept in the
  17059. application rather than about a particular control or window. In these
  17060. cases, the application should provide Help for a particular topic that is
  17061. identified by a key word rather than a context identifier.%@CR:C6A00180093 @%%@CR:C6A00180094 @%%@NL@%
  17062.  
  17063. For example, if the Help file for your application contains a topic that
  17064. describes how the keyboard is used, you could place a "Keyboard" item in
  17065. your Help menu. Then, when the user selects that item, your application
  17066. would call %@AB@%WinHelp%@AE@% and request that topic:  %@NL@%
  17067.  
  17068. %@AS@%  case IDM_HELP_KEYBOARD:
  17069. %@AS@%     WinHelp (hWnd, lpHelpFile, HELP_KEY, (LPSTR) "Keyboard");
  17070. %@AS@%     break;%@AE@%
  17071.  
  17072.  
  17073. %@3@%%@CR:C6A00180095 @%%@AB@%18.9.4  Accessing Additional Key-Word Tables%@AE@%%@EH@%%@NL@%
  17074.  
  17075. Your application may have commands or terms that correspond to terms in a
  17076. similar, but different, application. Given a key word, the application can
  17077. call %@AB@%WinHelp%@AE@% and look up topics defined in an alternate key-word table. This
  17078. Multikey functionality is accessed through the %@AB@%WinHelp%@AE@% hook with the
  17079. %@AI@%wCommand%@AE@% parameter set to HELP_MULTIKEY.%@CR:C6A00180096 @%%@CR:C6A00180097 @%%@NL@%
  17080.  
  17081. You specify the footnote character for the alternate key-word table, and the
  17082. key word or phrase, via a %@AB@%MULTIKEYHELP%@AE@% structure which is passed as the
  17083. %@AI@%dwData%@AE@% parameter in the call to %@AB@%WinHelp%@AE@%. This structure is defined in
  17084. WINDOWS.H as:  %@NL@%
  17085.  
  17086. %@AS@%  typedef struct tag MULTIKEYHELP {
  17087. %@AS@%   WORD mdSize;
  17088. %@AS@%   BYTE mkKeyList;
  17089. %@AS@%   BYTE szKeyPhrase[1];
  17090. %@AS@%  } MULTIKEYHELP;%@AE@%
  17091.  
  17092. The following table lists the format of the fields of the %@AB@%MULTIKEYHELP%@AE@%
  17093. structure:  %@NL@%
  17094.  
  17095. %@AB@%Parameter%@AE@%                         %@AB@%Format%@AE@%
  17096. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  17097. %@AB@%mkSize%@AE@%                            The size of the structure, including the
  17098.                                   key word (or phrase) and the associated 
  17099.                                   key-table letter.
  17100.  
  17101. %@AB@%mkKeyList%@AE@%                         A single character which defines the 
  17102.                                   footnote character for the alternate 
  17103.                                   key-word table to be searched.
  17104.  
  17105. %@AB@%szKeyPhrase%@AE@%                       A null-terminated key word or phrase to 
  17106.                                   be looked up in the alternate key-word 
  17107.                                   table.
  17108.  
  17109. The following example illustrates a key-word search for the word "frame" in
  17110. the alternate key-word table designated with the footnote character "L":  %@NL@%
  17111.  
  17112. %@AS@%  MULTIKEYHELP mk;
  17113. %@AS@%  char szKeyword[]="frame";
  17114. %@AS@%  mk.mkSize=sizeof(MULTIKEYHELP)+(WORD)lstrlen(szKeyword);
  17115. %@AS@%  mk.mkKeylist="L";
  17116. %@AS@%  mk.szKeyphrase=szKeyword;
  17117. %@AS@%  WinHelp(hWnd,lpHelpfile,HELP_MULTIKEY,(LPSTR)&mk);%@AE@%
  17118.  
  17119.  
  17120. %@3@%%@CR:C6A00180098 @%%@AB@%18.9.5  Canceling Help%@AE@%%@EH@%%@NL@%
  17121.  
  17122. The Windows Help application is a shared resource that is available to all
  17123. Windows applications. In addition, since it is a stand-alone application,
  17124. the user can execute it like any other application. As a result, your
  17125. application has limited control over the Help application. While your
  17126. application cannot directly close the Help application window, your
  17127. application can inform the Help application that Help is no longer needed.
  17128. Before closing its main window, your application should call %@AB@%WinHelp%@AE@% with
  17129. the %@AI@%wCommand%@AE@% parameter set to HELP_QUIT, as shown in the following example,
  17130. to inform the Help application that your application will not need it again.%@CR:C6A00180099 @%%@NL@%
  17131.  
  17132. %@AS@%  case WM_DESTROY:
  17133. %@AS@%     WinHelp (hWnd, lpHelpFile, HELP_QUIT, NULL);   %@AE@%
  17134.  
  17135. An application that has called %@AB@%WinHelp%@AE@% at some point during its execution
  17136. must call %@AB@%WinHelp%@AE@% with the %@AI@%wCommand%@AE@% parameter set to HELP_QUIT before the
  17137. application exits from WinMain (typically during the WM_DESTROY message
  17138. processing).  %@NL@%
  17139.  
  17140. If an application opens more than one Help file, then it must call %@AB@%WinHelp%@AE@%
  17141. to quit help for each file.  %@NL@%
  17142.  
  17143. If an application or DLL has opened a Help file but no longer wants the
  17144. associated instance of the Help engine (WINHELP.EXE) to remain active, then
  17145. the application or DLL should call %@AB@%WinHelp%@AE@% with the %@AI@%wCommand%@AE@% parameter set
  17146. to HELP_QUIT to destroy the instance of the Help engine.  %@NL@%
  17147.  
  17148. Under no circumstances should an application or DLL terminate without
  17149. calling %@AB@%WinHelp%@AE@% for any of the opened Help files. A Help file is opened if
  17150. any other %@AB@%WinHelp%@AE@% call has been previously made using the Help filename.  %@NL@%
  17151.  
  17152. The Windows Help application does not exit until all windows that have
  17153. called %@AB@%WinHelp%@AE@% have called it with %@AI@%wCommand%@AE@% set to HELP_QUIT. If an
  17154. application fails to do so, then the Help application will continue running
  17155. after all applications that requested Help have terminated.%@CR:C6A00180100 @%%@NL@%
  17156.  
  17157.  
  17158. %@2@%%@CR:C6A00180101 @%%@AB@%18.10  Summary%@AE@%%@EH@%%@NL@%
  17159.  
  17160. This chapter described how to create a Help project file, build the Help
  17161. resource file, and program your application to access Help. For more
  17162. information, see the following:  %@NL@%
  17163.  
  17164. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  17165. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  17166. Planning a Help system            %@AI@%Tools%@AE@%: Chapter 16, "Planning the Help 
  17167.                                   System"
  17168.  
  17169. Writing Help topics               %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help 
  17170.                                   Topic Files"
  17171.  
  17172.  
  17173.  
  17174.  
  17175.  
  17176.  
  17177. %@CR:C6A00190001 @%%@1@%%@AB@%Chapter 19  Help Examples and Compiler Error Messages%@AE@%%@EH@%%@NL@%
  17178. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  17179.  
  17180. The first part of this chapter contains several examples of Help source
  17181. files and their corresponding topics as displayed in Help. Each example
  17182. shows a topic (or part of a topic) as it appears to the Help writer in the
  17183. RTF-capable word processor and as it appears to the user in the Help window.
  17184. You can use these examples as guides when creating your own topic files. The
  17185. examples should help you predict how a particular topic file created in a
  17186. word processor will appear to the user.  %@NL@%
  17187.  
  17188. The second part of this chapter contains a list of Help Compiler error
  17189. messages. Each message is shown as it appears when the compiler encounters
  17190. the specific error. A short explanation accompanies each message to aid you
  17191. in solving the problem in your Help system. Preceding the error message
  17192. listing is a short description of the error reporting behavior of the Help
  17193. Compiler. Understanding how the compiler reports and reacts to errors will
  17194. help you to debug your Help files.%@CR:C6A00190002 @%%@NL@%
  17195.  
  17196.  
  17197. %@2@%%@CR:C6A00190003 @%%@AB@%19.1  Help Topic Examples%@AE@%%@EH@%%@NL@%
  17198.  
  17199. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17200.  
  17201. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17202.  
  17203. <$R>  %@NL@%
  17204.  
  17205. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17206.  
  17207. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17208.  
  17209. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17210.  
  17211. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17212.  
  17213. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17214.  
  17215. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17216.  
  17217. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17218.  
  17219. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  17220.  
  17221. The following is the Helpex (sample Help) project file:  %@NL@%
  17222.  
  17223. %@AS@%  [OPTIONS]
  17224. %@AS@%  ROOT=c:\help
  17225. %@AS@%  INDEX=main_index
  17226. %@AS@%  TITLE=Help Example
  17227. %@AS@%  COMPRESS=true
  17228. %@AS@%   
  17229. %@AS@%  [FILES]
  17230. %@AS@%  helpex.rtf  ; jump topics
  17231. %@AS@%  terms.rtf   ; look-up terms
  17232. %@AS@%   
  17233. %@AS@%  [MAP]
  17234. %@AS@%  main_index 0xFFFF
  17235. %@AS@%  #define HELPID_EDIT_CLEAR     100
  17236. %@AS@%  #define HELPID_EDIT_COPY      101
  17237. %@AS@%  #define HELPID_EDIT_CUT       102
  17238. %@AS@%  #define HELPID_EDIT_PASTE     103
  17239. %@AS@%  #define HELPID_EDIT_UNDO      104
  17240. %@AS@%  #define HELPID_FILE_EXIT      200
  17241. %@AS@%  #define HELPID_FILE_NEW       201
  17242. %@AS@%  #define HELPID_FILE_OPEN      202
  17243. %@AS@%  #define HELPID_FILE_PRINT     203
  17244. %@AS@%  #define HELPID_FILE_SAVE      204
  17245. %@AS@%  #define HELPID_FILE_SAVE_AS   205
  17246. %@AS@%  #define HELPID_EDIT_WINDOW    300
  17247. %@AS@%  #define HELPID_MAXIMIZE_ICON  301
  17248. %@AS@%  #define HELPID_MINIMIZE_ICON  302
  17249. %@AS@%  #define HELPID_SPLIT_BAR      303
  17250. %@AS@%  #define HELPID_SIZE_BOX       304
  17251. %@AS@%  #define HELPID_SYSTEM_MENU    305
  17252. %@AS@%  #define HELPID_TITLE_BAR      306
  17253. %@AS@%  #define HELPID_SIZING_BORDER  307%@AE@%
  17254.  
  17255.  
  17256. %@2@%%@CR:C6A00190004 @%%@AB@%19.2  Help Compiler Error Messages%@AE@%%@EH@%%@NL@%
  17257.  
  17258. The Help Compiler displays messages when it encounters errors in building
  17259. the Help resource file. Errors during processing of the project file are
  17260. numbered beginning with the letter P and appear as in the following
  17261. examples:%@CR:C6A00190005 @%%@CR:C6A00190006 @%%@NL@%
  17262.  
  17263. %@AS@%  Error P1025: line...7 of filename.HPJ : Section heading sectionname
  17264. %@AS@%unrecognized.%@AE@%
  17265.  
  17266. %@AS@%  Warning P1039: line...38 of filename.HPJ : [BUILDTAGS] section missing.%@AE@%
  17267.  
  17268. Errors which occur during processing of the RTF topic file(s) are numbered
  17269. beginning with the letter R and appear as in the following examples:  %@NL@%
  17270.  
  17271. %@AS@%  Error R2025: File environment error.%@AE@%
  17272.  
  17273. %@AS@%  Warning R2501: Using old key-phrase table.%@AE@%
  17274.  
  17275. Whenever possible, the compiler will display the topic number and/or
  17276. filename that contains the error. Though topics are not numbered, the topic
  17277. number given with an error message refers to that topic's sequential
  17278. position in your RTF file (first, second, etc.). These numbers may be
  17279. identical to the page number shown by your word processor, depending on the
  17280. number of lines you have assigned to the hypothetical printed page. Remember
  17281. that topics are separated by hard page breaks, even though there is no such
  17282. thing as a "page" in the Help system.  %@NL@%
  17283.  
  17284. Messages beginning with the word "Error" are fatal errors. Errors are always
  17285. reported, and no usable Help resource file will result from the build.
  17286. Messages beginning with the word "Warning" are less serious in nature. A
  17287. build with warnings will produce a valid Help resource file which will load
  17288. under Windows, but the file may contain operational errors. You can specify
  17289. the amount of warning information to be reported by the compiler. See
  17290. section 17.4.1, "Specifying Error Reporting: The Warning Option," for more
  17291. information on choosing warning levels to be displayed.%@CR:C6A00190007 @%%@CR:C6A00190008 @%%@NL@%
  17292.  
  17293. The compiler's reaction to an error is described for each error in the
  17294. listing that follows. During processing of the project file, the compiler
  17295. ignores lines that contain errors and attempts to continue with the build.
  17296. This means that errors encountered early in a build may result in many more
  17297. errors being reported as the build continues. Similarly, errors during
  17298. processing of the RTF topic files will be reported and if not serious, the
  17299. compiler will continue with the build. A single error condition in the topic
  17300. file may result in more than one error message being reported by the
  17301. compiler. For instance, a misidentified topic will cause an error to be
  17302. reported every time jump terms refer to the correct topic identifier. Such a
  17303. mistake is easily rectified by simply correcting the footnote containing the
  17304. wrong context string.  %@NL@%
  17305.  
  17306.  
  17307. %@3@%%@CR:C6A00190009 @%%@AB@%19.2.1  Errors During Processing of Project File%@AE@%%@EH@%%@NL@%
  17308.  
  17309. %@AB@%P1001%@AE@%                             Unable to read file %@AI@%filename%@AE@%.
  17310.  
  17311.                                   The file specified in the project file 
  17312.                                   is unreadable. This is a DOS file error.
  17313.  
  17314. %@AB@%P1003%@AE@%                             Invalid path specified in Root option.
  17315.  
  17316.                                   The path specified by the Root option 
  17317.                                   cannot be found. The compiler uses the 
  17318.                                   current working directory.  
  17319.  
  17320. %@AB@%P1005%@AE@%                             Path and filename exceed limit of 79 
  17321.                                   characters.
  17322.  
  17323.                                   The absolute pathname, or the combined 
  17324.                                   root and relative pathname, exceed the 
  17325.                                   DOS limit of 79 characters. The file is 
  17326.                                   skipped.  
  17327.  
  17328. %@AB@%P1007%@AE@%                             Root path exceeds maximum limit of 66 
  17329.                                   characters.
  17330.  
  17331.                                   The specified root pathname exceeds the 
  17332.                                   DOS limit of 66 characters. The pathname
  17333.                                   is ignored and the compiler uses the 
  17334.                                   current working directory.  
  17335.  
  17336. %@AB@%P1009%@AE@%                             [FILES] section missing.
  17337.  
  17338.                                   The [Files] section is required. The 
  17339.                                   compilation is aborted.  
  17340.  
  17341. %@AB@%P1011%@AE@%                             Option %@AI@%optionname%@AE@% previously defined.
  17342.  
  17343.                                   The specified option was defined 
  17344.                                   previously. The compiler ignores the 
  17345.                                   attempted redefinition.%@CR:C6A00190010 @%%@CR:C6A00190011 @%  
  17346.  
  17347. %@AB@%P1013%@AE@%                             Project file extension cannot be .HLP.
  17348.  
  17349.                                   You cannot specify that the compiler use
  17350.                                   a project file with the .HLP extension. 
  17351.                                   Normally, project files are given the 
  17352.                                   .HPJ extension.  
  17353.  
  17354. %@AB@%P1015%@AE@%                             Unexpected end-of-file.
  17355.  
  17356.                                   The compiler has unexpectedly come to 
  17357.                                   the end of the project file. There might
  17358.                                   be an open comment in the project file 
  17359.                                   or an included file.  
  17360.  
  17361. %@AB@%P1017%@AE@%                             Parameter exceeds maximum length of 128 
  17362.                                   characters.
  17363.  
  17364.                                   An option, context name or number, build
  17365.                                   tag, or other parameter on the specified
  17366.                                   line exceeds the limit of 128 characters.
  17367.                                   The line is ignored.  
  17368.  
  17369. %@AB@%P1021%@AE@%                             Context number already used in [MAP] 
  17370.                                   section.
  17371.  
  17372.                                   The context number on the specified line
  17373.                                   in the project file was previously 
  17374.                                   mapped to a different context string. 
  17375.                                   The line is ignored.  
  17376.  
  17377. %@AB@%P1023%@AE@%                             Include statements nested too deeply.
  17378.  
  17379.                                   The %@AB@%#include%@AE@% statement on the specified 
  17380.                                   line has exceeded the maximum of five 
  17381.                                   include levels.  
  17382.  
  17383. %@AB@%P1025%@AE@%                             Section heading %@AI@%sectionname%@AE@% 
  17384.                                   unrecognized.
  17385.  
  17386.                                   A section heading that is not supported 
  17387.                                   by the compiler has been used. The line 
  17388.                                   is skipped.  
  17389.  
  17390. %@AB@%P1027%@AE@%                             Bracket missing from section heading %@AI@%%@AE@%
  17391.                                   %@AI@%sectionname%@AE@%.
  17392.  
  17393.                                   The right bracket (]) is missing from 
  17394.                                   the specified section heading. Insert 
  17395.                                   the bracket and compile again.  
  17396.  
  17397. %@AB@%P1029%@AE@%                             Section heading missing.
  17398.  
  17399.                                   The section heading on the specified 
  17400.                                   line is not complete. This error is also
  17401.                                   reported if the first entry in the 
  17402.                                   project file is not a section heading. 
  17403.                                   The compiler continues with the next 
  17404.                                   line.  
  17405.  
  17406. %@AB@%P1030%@AE@%                             Section %@AI@%sectionname%@AE@% previously defined.%@CR:C6A00190012 @%%@CR:C6A00190013 @%
  17407.  
  17408.                                   A duplicate section has been found in 
  17409.                                   the project file. The lines under the 
  17410.                                   duplicated section heading are ignored 
  17411.                                   and the compiler continues from the next
  17412.                                   valid section heading.  
  17413.  
  17414. %@AB@%P1031%@AE@%                             Maximum number of build tags exceeded.
  17415.  
  17416.                                   The maximum number of build tags that 
  17417.                                   can be defined is 30. The excess tags 
  17418.                                   are ignored.  
  17419.  
  17420. %@AB@%P1033%@AE@%                             Duplicate build tag in [BUILDTAGS] 
  17421.                                   section.
  17422.  
  17423.                                   A build tag in the [BuildTags] section 
  17424.                                   has been repeated unnecessarily  
  17425.  
  17426. %@AB@%P1035%@AE@%                             Build tag length exceeds maximum.
  17427.  
  17428.                                   The build tag on the specified line 
  17429.                                   exceeds the maximum of 32 characters. 
  17430.                                   The compiler skips this entry.  
  17431.  
  17432. %@AB@%P1037%@AE@%                             Build tag %@AI@%tagname%@AE@% contains invalid 
  17433.                                   characters.
  17434.  
  17435.                                   Build tags can contain only alphanumeric
  17436.                                   characters or the underscore (_) 
  17437.                                   character. The line is skipped.  
  17438.  
  17439. %@AB@%P1039%@AE@%                             [BUILDTAGS] section missing.
  17440.  
  17441.                                   The %@AB@%BUILD%@AE@% option declared a conditional 
  17442.                                   build, but there is no [BuildTags] 
  17443.                                   section in the project file. All topics 
  17444.                                   are included in the build.  
  17445.  
  17446. %@AB@%P1043%@AE@%                             Too many tags in Build expression.
  17447.  
  17448.                                   The Build expression on the specified 
  17449.                                   line has used more than the maximum of 
  17450.                                   20 build tags. The compiler ignores the 
  17451.                                   line.  
  17452.  
  17453. %@AB@%P1045%@AE@%                             [ALIAS] section found after [MAP] 
  17454.                                   section.
  17455.  
  17456.                                   When used, the [Alias] section must 
  17457.                                   precede the [Map] section in the project
  17458.                                   file. The [Alias] section is skipped 
  17459.                                   otherwise.  
  17460.  
  17461. %@AB@%P1047%@AE@%                             Context string %@AI@%contextname%@AE@% already 
  17462.                                   assigned an alias.
  17463.  
  17464.                                   You cannot do: a=b then a=c (A context 
  17465.                                   string can only have one alias.)  
  17466.  
  17467.                                   The specified context string has 
  17468.                                   previously been aliased in the [Alias] 
  17469.                                   section. The attempted reassignment on 
  17470.                                   this line is ignored.%@CR:C6A00190014 @%%@CR:C6A00190015 @%  
  17471.  
  17472. %@AB@%P1049%@AE@%                             Alias string aliasname already assigned.
  17473.  
  17474.                                   You cannot do: a=b then b=c (You can't 
  17475.                                   alias an alias.)  
  17476.  
  17477.                                   An alias string cannot, in turn, be 
  17478.                                   assigned another alias.  
  17479.  
  17480. %@AB@%P1051%@AE@%                             Context string %@AI@%contextname%@AE@% cannot be 
  17481.                                   used as alias string.
  17482.  
  17483.                                   You cannot do: a=b then c=a  
  17484.  
  17485.                                   A context string that has been assigned 
  17486.                                   an alias cannot be used later as an 
  17487.                                   alias for another context string.  
  17488.  
  17489. %@AB@%P1053%@AE@%                             Maximum number of font ranges exceeded.
  17490.  
  17491.                                   The maximum number of font ranges that 
  17492.                                   can be specified is five. The rest are 
  17493.                                   ignored.  
  17494.  
  17495. %@AB@%P1055%@AE@%                             Current font range overlaps previously 
  17496.                                   defined range.
  17497.  
  17498.                                   A font size range overlaps a previously 
  17499.                                   defined mapping. Adjust either font 
  17500.                                   range to remove any overlaps. The second
  17501.                                   mapping is ignored.  
  17502.  
  17503. %@AB@%P1056%@AE@%                             Unrecognized font name in Forcefont 
  17504.                                   option.
  17505.  
  17506.                                   A font name not supported by the 
  17507.                                   compiler has been encountered. The font 
  17508.                                   name is ignored and the compiler uses 
  17509.                                   the default Helv font.  
  17510.  
  17511. %@AB@%P1057%@AE@%                             Font name too long.
  17512.  
  17513.                                   Font names cannot exceed 20 characters. 
  17514.                                   The font is ignored.  
  17515.  
  17516. %@AB@%P1059%@AE@%                             Invalid multiple-key syntax.
  17517.  
  17518.                                   The syntax used with a %@AB@%MULTIKEY%@AE@% option 
  17519.                                   is unrecognized. See Chapter 18, 
  17520.                                   "Building the Help File," for the proper
  17521.                                   syntax.  
  17522.  
  17523. %@AB@%P1061%@AE@%                             Character already used.
  17524.  
  17525.                                   The specified key word-table identifier 
  17526.                                   is already in use. Choose another 
  17527.                                   character.%@CR:C6A00190016 @%%@CR:C6A00190017 @%  
  17528.  
  17529. %@AB@%P1063%@AE@%                             Characters 'K' and 'k' cannot be used.
  17530.  
  17531.                                   These characters are reserved for Help's
  17532.                                   normal key-word table. Choose another 
  17533.                                   character.  
  17534.  
  17535. %@AB@%P1065%@AE@%                             Maximum number of keyword tables 
  17536.                                   exceeded.
  17537.  
  17538.                                   The limit of five key-word tables has 
  17539.                                   been exceeded. Reduce the number. The 
  17540.                                   excess tables are ignored.  
  17541.  
  17542. %@AB@%P1067%@AE@%                             Equal sign missing.
  17543.  
  17544.                                   An option is missing its required equal 
  17545.                                   sign on the specified line. Check the 
  17546.                                   syntax for the option.  
  17547.  
  17548. %@AB@%P1069%@AE@%                             Context string missing.
  17549.  
  17550.                                   The line specified is missing a context 
  17551.                                   string before an equal sign.  
  17552.  
  17553. %@AB@%P1071%@AE@%                             Incomplete line in %@AI@%sectionname%@AE@% section.
  17554.  
  17555.                                   The entry on the specified line is not 
  17556.                                   complete. The line is skipped.  
  17557.  
  17558. %@AB@%P1073%@AE@%                             Unrecognized option in [OPTIONS] 
  17559.                                   section.
  17560.  
  17561.                                   An option has been used that is not 
  17562.                                   supported by the compiler. The line is 
  17563.                                   skipped.  
  17564.  
  17565. %@AB@%P1075%@AE@%                             Invalid build expression.
  17566.  
  17567.                                   The syntax used in the build expression 
  17568.                                   on the specified line contains one or 
  17569.                                   more logical or syntax errors.  
  17570.  
  17571. %@AB@%P1077%@AE@%                             Warning level must be 1, 2, or 3.
  17572.  
  17573.                                   The %@AB@%WARNING%@AE@% reporting level can only be 
  17574.                                   set to 1, 2, or 3. The compiler will 
  17575.                                   default to full reporting (level 3).  
  17576.  
  17577. %@AB@%P1079%@AE@%                             Invalid compression option.
  17578.  
  17579.                                   The %@AB@%COMPRESS%@AE@% option can only be set to 
  17580.                                   TRUE or FALSE. The compilation continues
  17581.                                   without compression.  
  17582.  
  17583. %@AB@%P1081%@AE@%                             Invalid title string.
  17584.  
  17585.                                   The %@AB@%TITLE%@AE@% option defines a string that 
  17586.                                   is null or contains more than 32 
  17587.                                   characters. The title is truncated.%@CR:C6A00190018 @%%@CR:C6A00190019 @%  
  17588.  
  17589. %@AB@%P1083%@AE@%                             Invalid context identification number.
  17590.  
  17591.                                   The context number on the specified line
  17592.                                   is null or contains invalid characters. 
  17593.  
  17594. %@AB@%P1085%@AE@%                             Unrecognized text.
  17595.  
  17596.                                   The unrecognizable text that follows 
  17597.                                   valid text in the specified line is 
  17598.                                   ignored.  
  17599.  
  17600. %@AB@%P1086%@AE@%                             Invalid font-range syntax.
  17601.  
  17602.                                   The font-range definition on the 
  17603.                                   specified line contains invalid syntax. 
  17604.                                   The compiler ignores the line. Check the
  17605.                                   syntax for the %@AB@%MAPFONTSIZE%@AE@% option.  
  17606.  
  17607. %@AB@%P1089%@AE@%                             Unrecognized sort ordering.
  17608.  
  17609.                                   You have specified an ordering that is 
  17610.                                   not supported by the compiler. Contact 
  17611.                                   Microsoft Product Support Services for 
  17612.                                   clarification of the error.  
  17613.  
  17614.  
  17615. %@3@%%@CR:C6A00190020 @%%@AB@%19.2.2  Errors During Processing of RTF Topic Files%@AE@%%@EH@%%@NL@%
  17616.  
  17617. %@AB@%R2001%@AE@%                             Unable to open bitmap file %@AI@%filename%@AE@%.
  17618.  
  17619.                                   The specified bitmap file is unreadable.
  17620.                                   This is a DOS file error.%@CR:C6A00190021 @%%@CR:C6A00190022 @%  
  17621.  
  17622. %@AB@%R2003%@AE@%                             Unable to include bitmap file %@AI@%filename%@AE@%.
  17623.  
  17624.                                   The specified bitmap file could not be 
  17625.                                   found or is unreadable. This is a DOS 
  17626.                                   file error or an out-of-memory condition.
  17627.  
  17628. %@AB@%R2005%@AE@%                             Disk full.
  17629.  
  17630.                                   The Help resource file could not be 
  17631.                                   written to disk. Create more space on 
  17632.                                   the destination drive.  
  17633.  
  17634. %@AB@%R2009%@AE@%                             Cannot use reserved DOS device name for 
  17635.                                   file %@AI@%filename%@AE@%.
  17636.  
  17637.                                   A file has been referred to as COM1, 
  17638.                                   LPT2, PRN, etc. Rename the file.  
  17639.  
  17640. %@AB@%R2013%@AE@%                             Output file %@AI@%filename%@AE@% already exists as a
  17641.                                   directory.
  17642.  
  17643.                                   There is a subdirectory in the Help 
  17644.                                   project root with the same name as the 
  17645.                                   desired Help resource file. Move or 
  17646.                                   rename the subdirectory.  
  17647.  
  17648. %@AB@%R2015%@AE@%                             Output file %@AI@%filename%@AE@% already exists as 
  17649.                                   read-only.
  17650.  
  17651.                                   The specified filename cannot be 
  17652.                                   overwritten by the Help resource file 
  17653.                                   because the file has a read-only 
  17654.                                   attribute. Rename the project file or 
  17655.                                   change the file's attribute.  
  17656.  
  17657. %@AB@%R2017%@AE@%                             Path for file %@AI@%filename%@AE@% exceeds limit of 
  17658.                                   79 characters.
  17659.  
  17660.                                   The absolute pathname, or the combined 
  17661.                                   root and relative pathname, to the 
  17662.                                   specified file exceed the DOS limit of 
  17663.                                   79 characters. The file is ignored.  
  17664.  
  17665. %@AB@%R2019%@AE@%                             Cannot open file %@AI@%filename%@AE@%.
  17666.  
  17667.                                   The specified file is unreadable. This 
  17668.                                   is a DOS file error.  
  17669.  
  17670. %@AB@%R2021%@AE@%                             Cannot find file %@AI@%filename%@AE@%.
  17671.  
  17672.                                   The specified file could not be found or
  17673.                                   is unreadable. This is a DOS file error 
  17674.                                   or an out-of-memory condition.  
  17675.  
  17676. %@AB@%R2023%@AE@%                             Not enough memory to build Help file.
  17677.  
  17678.                                   To free up memory, unload any unneeded 
  17679.                                   applications, device drivers, and 
  17680.                                   memory-resident programs.%@CR:C6A00190023 @%%@CR:C6A00190024 @%  
  17681.  
  17682. %@AB@%R2025%@AE@%                             File environment error.
  17683.  
  17684.                                   The compiler has insufficient available 
  17685.                                   file handles to continue. Increase the 
  17686.                                   values for FILES= and BUFFERS= in your 
  17687.                                   CONFIG.SYS file and reboot.  
  17688.  
  17689. %@AB@%R2027%@AE@%                             Build tag %@AI@%tagname%@AE@% not defined in 
  17690.                                   [BUILDTAGS] section of project file. 
  17691.  
  17692.                                   The specified build tag has been 
  17693.                                   assigned to a topic, but not declared in
  17694.                                   the project file. The tag is ignored for
  17695.                                   the topic.  
  17696.  
  17697. %@AB@%R2033%@AE@%                             Context string in Map section not 
  17698.                                   defined in any topic.
  17699.  
  17700.                                   There are one or more context strings 
  17701.                                   defined in the project file that the 
  17702.                                   compiler could not find topics for.  
  17703.  
  17704. %@AB@%R2035%@AE@%                             Build expression missing from project 
  17705.                                   file.
  17706.  
  17707.                                   The topics have build tags, but there is
  17708.                                   no Build= expression in the project file.
  17709.                                   The compiler includes all topics in the 
  17710.                                   build.  
  17711.  
  17712. %@AB@%R2037%@AE@%                             File %@AI@%filename%@AE@% cannot be created, due to 
  17713.                                   previous error(s).
  17714.  
  17715.                                   The Help resource file could not be 
  17716.                                   created because the compiler has no 
  17717.                                   topics remaining to be processed. 
  17718.                                   Correct the errors that preceded this 
  17719.                                   error and recompile.  
  17720.  
  17721. %@AB@%R2039%@AE@%                             Unrecognized table formatting in topic %@AI@%%@AE@%
  17722.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17723.  
  17724.                                   The compiler ignores table formatting 
  17725.                                   that is unsupported in Help.  Reformat 
  17726.                                   the entries as linear text if possible. 
  17727.  
  17728. %@AB@%R2041%@AE@%                             Jump %@AI@%context_string%@AE@% unresolved in topic %@AI@%%@AE@%
  17729.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17730.  
  17731.                                   The specified topic contains a context 
  17732.                                   string that identifies a nonexistent 
  17733.                                   topic. Check spelling, and that the 
  17734.                                   desired topic is included in the build. 
  17735.  
  17736. %@AB@%R2043%@AE@%                             Hotspot text cannot spread over 
  17737.                                   paragraphs.
  17738.  
  17739.                                   A jump term spans two paragraphs. Remove
  17740.                                   the formatting from the paragraph mark.%@CR:C6A00190025 @%%@CR:C6A00190026 @% 
  17741.  
  17742. %@AB@%R2045%@AE@%                             Maximum number of tab stops reached in 
  17743.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17744.  
  17745.                                   The limit of 32 tab stops has been 
  17746.                                   exceeded in the specified topic. The 
  17747.                                   default stops are used after the 32nd 
  17748.                                   tab.  
  17749.  
  17750. %@AB@%R2047%@AE@%                             File %@AI@%filename%@AE@% not created.
  17751.  
  17752.                                   There are no topics to compile, or the 
  17753.                                   build expression is false for all topics.
  17754.                                   There is no Help resource file created. 
  17755.  
  17756. %@AB@%R2049%@AE@%                             Context string text too long in topic %@AI@%%@AE@%
  17757.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17758.  
  17759.                                   Context string hidden text cannot exceed
  17760.                                   64 characters. The string is ignored.  
  17761.  
  17762. %@AB@%R2051%@AE@%                             File %@AI@%filename%@AE@% is not a valid RTF topic 
  17763.                                   file.
  17764.  
  17765.                                   The specified file is not an RTF file. 
  17766.                                   Check that you have saved the topic as 
  17767.                                   RTF from your word processor.  
  17768.  
  17769. %@AB@%R2053%@AE@%                             Font %@AI@%fontname%@AE@% in file %@AI@%filename%@AE@% not in 
  17770.                                   RTF font table.
  17771.  
  17772.                                   A font not defined in the RTF header has
  17773.                                   been entered into the topic. The 
  17774.                                   compiler uses the default system font.  
  17775.  
  17776. %@AB@%R2055%@AE@%                             File %@AI@%filename%@AE@% is not a usable RTF topic 
  17777.                                   file.
  17778.  
  17779.                                   The specified file contains a valid RTF 
  17780.                                   header, but the content is not RTF or is
  17781.                                   corrupted.  
  17782.  
  17783. %@AB@%R2057%@AE@%                             Unrecognized graphic format in topic %@AI@%%@AE@%
  17784.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17785.  
  17786.                                   The compiler supports only Windows 
  17787.                                   bitmaps. Check that metafiles or  
  17788.                                   Macintosh formats have not been used. 
  17789.                                   The graphic is ignored.  
  17790.  
  17791. %@AB@%R2059%@AE@%                             Context string identifier already 
  17792.                                   defined in topic %@AI@%topicnumber%@AE@% of file %@AI@%%@AE@%
  17793.                                   %@AI@%filename%@AE@%.
  17794.  
  17795.                                   There is more than one context-string 
  17796.                                   identifier footnote for the specified 
  17797.                                   topic. The compiler uses the identifier 
  17798.                                   defined in the first # footnote.%@CR:C6A00190027 @%%@CR:C6A00190028 @%  
  17799.  
  17800. %@AB@%R2061%@AE@%                             Context string %@AI@%contextname%@AE@% already used 
  17801.                                   in file %@AI@%filename%@AE@%.
  17802.  
  17803.                                   The specified context string was 
  17804.                                   previously assigned to another topic. 
  17805.                                   The compiler ignores the latter string 
  17806.                                   and the topic has no identifier.  
  17807.  
  17808. %@AB@%R2063%@AE@%                             Invalid context-string identifier for 
  17809.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17810.  
  17811.                                   The context-string footnote contains 
  17812.                                   nonalphanumeric characters or is null. 
  17813.                                   The topic is not assigned an identifier.
  17814.  
  17815. %@AB@%R2065%@AE@%                             Context string defined for index topic 
  17816.                                   is unresolved.
  17817.  
  17818.                                   The index topic defined in the project 
  17819.                                   file could not be found. The compiler 
  17820.                                   uses the first topic in the build as the
  17821.                                   index.  
  17822.  
  17823. %@AB@%R2067%@AE@%                             Footnote text too long in topic %@AI@%%@AE@%
  17824.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17825.  
  17826.                                   Footnote text cannot exceed the limit of
  17827.                                   1000 characters. The footnote is ignored.
  17828.  
  17829. %@AB@%R2069%@AE@%                             Build tag footnote not at beginning of 
  17830.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17831.  
  17832.                                   The specified topic contains a buildtag 
  17833.                                   footnote that is not the first character
  17834.                                   in the topic. The topic is not assigned 
  17835.                                   a build tag.  
  17836.  
  17837. %@AB@%R2071%@AE@%                             Footnote text missing in topic %@AI@%%@AE@%
  17838.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17839.  
  17840.                                   The specified topic contains a footnote 
  17841.                                   that has no characters.  
  17842.  
  17843. %@AB@%R2073%@AE@%                             Keyword string is null in topic %@AI@%%@AE@%
  17844.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17845.  
  17846.                                   A key-word footnote exists for the 
  17847.                                   specified topic, but contains no 
  17848.                                   characters.  
  17849.  
  17850. %@AB@%R2075%@AE@%                             Keyword string too long in topic %@AI@%%@AE@%
  17851.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17852.  
  17853.                                   The text in the key-word footnote in the
  17854.                                   specified topic exceeds the limit of 255
  17855.                                   characters. The excess characters are 
  17856.                                   ignored.  
  17857.  
  17858. %@AB@%R2077%@AE@%                             Keyword(s) defined without title in 
  17859.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17860.  
  17861.                                   Key word(s) have been defined for the 
  17862.                                   specified topic, but the topic has no 
  17863.                                   title assigned. Search Topics Found 
  17864.                                   displays Untitled Topic< for the topic.%@CR:C6A00190029 @%%@CR:C6A00190030 @% 
  17865.  
  17866. %@AB@%R2079%@AE@%                             Browse sequence string is null in topic %@AI@%%@AE@%
  17867.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17868.  
  17869.                                   The browse-sequence footnote for the 
  17870.                                   specified topic contains no sequence 
  17871.                                   characters.  
  17872.  
  17873. %@AB@%R2081%@AE@%                             Browse sequence string too long in topic
  17874.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17875.  
  17876.                                   The browse-sequence footnote for the 
  17877.                                   specified topic exceeds the limit of 128
  17878.                                   characters. The sequence is ignored.  
  17879.  
  17880. %@AB@%R2083%@AE@%                             Missing sequence number in topic %@AI@%%@AE@%
  17881.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17882.  
  17883.                                   A browse-sequence number ends in a colon
  17884.                                   (:) for the specified topic. Remove the 
  17885.                                   colon, or enter a "minor" sequence 
  17886.                                   number.  
  17887.  
  17888. %@AB@%R2085%@AE@%                             Sequence number already defined in topic
  17889.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17890.  
  17891.                                   There is already a browse-sequence 
  17892.                                   footnote for the specified topic. The 
  17893.                                   latter sequence is ignored.  
  17894.  
  17895. %@AB@%R2087%@AE@%                             Build tag too long.
  17896.  
  17897.                                   A build tag for the specified topic 
  17898.                                   exceeds the maximum of 32 characters. 
  17899.                                   The tag is ignored for the topic.  
  17900.  
  17901. %@AB@%R2089%@AE@%                             Title string null in topic %@AI@%topicnumber%@AE@% 
  17902.                                   of file %@AI@%filename%@AE@%.
  17903.  
  17904.                                   The title footnote for the specified 
  17905.                                   topic contains no characters. The topic 
  17906.                                   is not assigned a title.  
  17907.  
  17908. %@AB@%R2091%@AE@%                             Title too long in topic %@AI@%topicnumber%@AE@% of 
  17909.                                   file %@AI@%filename%@AE@%.
  17910.  
  17911.                                   The title for the specified topic 
  17912.                                   exceeds the limit of 128 characters. The
  17913.                                   excess characters are ignored.  
  17914.  
  17915. %@AB@%R2093%@AE@%                             Title titlename in topic %@AI@%topicnumber%@AE@% of 
  17916.                                   file %@AI@%filename%@AE@% used previously.
  17917.  
  17918.                                   The specified title has previously been 
  17919.                                   assigned to another topic. %@CR:C6A00190031 @%%@CR:C6A00190032 @%  
  17920.  
  17921. %@AB@%R2095%@AE@%                             Title defined more than once in topic %@AI@%%@AE@%
  17922.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  17923.  
  17924.                                   There is more than one title footnote in
  17925.                                   the specified topic. The compiler uses 
  17926.                                   the first title string.  
  17927.  
  17928. %@AB@%R2501%@AE@%                             Using old key-phrase table.
  17929.  
  17930.                                   Maximum compression can only result by 
  17931.                                   deleting the .PH file before each 
  17932.                                   recompilation of the Help topics.  
  17933.  
  17934. %@AB@%R2503%@AE@%                             Out of memory during text compression.
  17935.  
  17936.                                   The compiler encountered a memory 
  17937.                                   limitation during compression. 
  17938.                                   Compilation continues with the Help 
  17939.                                   resource file not compressed. Unload any
  17940.                                   unneeded applications, device drivers, 
  17941.                                   and memory-resident programs.  
  17942.  
  17943. %@AB@%R2505%@AE@%                             File environment error during text 
  17944.                                   compression. 
  17945.  
  17946.                                   The compiler has insufficient available 
  17947.                                   file handles for compression. 
  17948.                                   Compilation continues with the Help 
  17949.                                   resource file not compressed. Increase 
  17950.                                   the values for FILES= and BUFFERS= in 
  17951.                                   your CONFIG.SYS file and reboot.  
  17952.  
  17953. %@AB@%R2507%@AE@%                             DOS file error during text compression.
  17954.  
  17955.                                   The compiler encountered a problem 
  17956.                                   accessing a disk file during compression.
  17957.                                   Compilation continues with the Help 
  17958.                                   resource file not compressed.  
  17959.  
  17960. %@AB@%R2509%@AE@%                             Error during text compression.
  17961.  
  17962.                                   One of the three compression 
  17963.                                   errors─R2503, R2505, or R2507─has 
  17964.                                   occurred. Compilation continues with the
  17965.                                   Help resource file not compressed.  
  17966.  
  17967. %@AB@%R2701%@AE@%                             Internal error.
  17968.  
  17969.                                   Contact Microsoft Product Support 
  17970.                                   Services for clarification of the error.
  17971.  
  17972. %@AB@%R2703%@AE@%                             Internal error.
  17973.  
  17974.                                   Contact Microsoft Product Support 
  17975.                                   Services for clarification of the error.
  17976.  
  17977. %@AB@%R2705%@AE@%                             Internal error.
  17978.  
  17979.                                   Contact Microsoft Product Support 
  17980.                                   Services for clarification of the error.%@CR:C6A00190033 @%
  17981.                                   %@CR:C6A00190034 @%  
  17982.  
  17983. %@AB@%R2707%@AE@%                             Internal error.
  17984.  
  17985.                                   Contact Microsoft Product Support 
  17986.                                   Services for clarification of the error.
  17987.  
  17988. %@AB@%R2709%@AE@%                             Internal error.
  17989.  
  17990.                                   Contact Microsoft Product Support 
  17991.                                   Services for clarification of the error.%@CR:C6A00190035 @%
  17992.                                   %@CR:C6A00190036 @%  
  17993.  
  17994.  
  17995.  
  17996. %@CR:GeneralIndex@%
  17997. %@1@%%@AB@%INDEX%@AE@%%@EH@%%@NL@%
  17998. %@AB@%──────────────────────────────────────────────────────────────────────────
  17999.  
  18000.  
  18001.  
  18002. { } (brackets), in symbol map display%@BO:       5dffd@%
  18003. { } (curly braces), as document convention%@BO:        acc7@%
  18004. ( ) (parentheses), as document convention%@BO:        9ea9@%
  18005. " " (quotation marks), as document convention%@BO:        ac17@%
  18006. -? option%@BO:       1cab1@%
  18007. * (asterisk)
  18008.   wildcard character%@BO:       5ebd4@%%@BO:       64f19@%%@BO:       7225b@%
  18009.   with commands%@BO:       71e51@%
  18010. @ (at symbol), with commands%@BO:       65002@%
  18011. : (colon), use of with doubleword values%@BO:       6d471@%
  18012. , (comma), as parameter separator%@BO:       13eba@%
  18013. $ (dollar sign), as symbol with commands%@BO:       65002@%
  18014. - (hyphen), as SYMDEB option designator%@BO:       5c450@%
  18015. . (period), as ASCII value%@BO:       69bfd@%
  18016. + (plus sign), as filename separator%@BO:       13bd5@%
  18017. ? (question mark), with commands%@BO:       64f19@%%@BO:       71e51@%
  18018. ; (semicolon), in SYMDEB command list%@BO:       5c31d@%%@BO:       6914b@%
  18019. / (slash), as SYMDEB option designator%@BO:       5c450@%
  18020. _ (underscore), with commands%@BO:       64f19@%
  18021. | (vertical bar), as document convention%@BO:        a9f4@%
  18022. . . . (ellipses), as document convention%@BO:        a57c@%
  18023. {{ }} (double brackets), as document convention%@BO:        a7d9@%
  18024.  
  18025. %@2@%%@AB@%    A%@AE@%%@EH@%%@NL@%
  18026. Address arguments, SYMDEB%@BO:       65577@%%@BO:       66362@%
  18027. Allocating memory%@BO:       96391@%%@BO:       980b4@%
  18028. Allocation granularity%@BO:       980b4@%
  18029. ANSI character set%@BO:       39526@%
  18030. Applications
  18031.   and creating import libraries%@BO:       12f54@%
  18032.   and linking files%@BO:        f836@%%@BO:       1383a@%
  18033.   and starting SYMDEB%@BO:       5ee16@%
  18034.   building%@BO:        8d63@%
  18035.   C language%@BO:        c0a9@%
  18036.   compiling options for%@BO:        d47a@%
  18037.   development options for%@BO:        e4df@%
  18038.   executable%@BO:        f836@%
  18039.   memory model for%@BO:        dab7@%
  18040.   memory movement in%@BO:       97ad6@%
  18041.   module-definition (.DEF) files for%@BO:       11818@%
  18042.   optimizing performance of%@BO:       9eeca@%
  18043.   passing to Windows%@BO:       5cee3@%
  18044.   resource script (.RC) file%@BO:       27307@%
  18045.   startup routines for%@BO:       165fc@%
  18046. Arguments
  18047.   address%@BO:       65577@%%@BO:       66362@%
  18048.   SYMDEB command%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  18049. ASCII
  18050.   byte values, displaying%@BO:       697a5@%
  18051.   characters, displaying%@BO:       697a5@%
  18052.   strings, entering into memory%@BO:       6cd6d@%
  18053. Assembling instruction mnemonics%@BO:       6714f@%
  18054. Assembly-language symbol files%@BO:       58c05@%
  18055. Asterisk (*)
  18056.   wildcard character%@BO:       5ebd4@%%@BO:       639de@%%@BO:       7225b@%
  18057.   with commands%@BO:       71e51@%
  18058. At symbol (@), with commands%@BO:       65002@%
  18059.  
  18060. %@2@%%@AB@%    B%@AE@%%@EH@%%@NL@%
  18061. Binary resource file%@BO:        913a@%
  18062. Bitmap (.BMP) files
  18063.    %@AI@%see also%@AE@% Bitmaps%@NL@%
  18064.   and File menu%@BO:       20b17@%
  18065.   and Image menu%@BO:       20e65@%
  18066.   and SDKPAINT process%@BO:       1f5b2@%
  18067.   creating%@BO:       21bce@%
  18068.   described%@BO:       1f93b@%
  18069.   working with colors%@BO:       249c2@%
  18070. BITMAP resource statement%@BO:       18971@%
  18071. Bitmaps
  18072.    %@AI@%see also%@AE@% Bitmap (.BMP) files%@NL@%
  18073.   creating%@BO:       21a67@%
  18074.   described%@BO:       1f93b@%
  18075.   editing colors for%@BO:       2549c@%
  18076.   editing%@BO:       216c6@%%@BO:       23ddc@%
  18077.   opaque color options%@BO:       249c2@%
  18078.   using colors with%@BO:       21bce@%%@BO:       23a83@%
  18079. %@AB@%Bold text%@AE@%, as document convention%@BO:        9d83@%
  18080. Braces, curly ({ }), as document convention%@BO:        acc7@%
  18081. Brackets ({ }), in symbol map display%@BO:       5dffd@%
  18082. Brackets, double ({{ }}), as document convention%@BO:        a75c@%
  18083. Breakpoints
  18084.   "sticky", defined%@BO:       68cca@%
  18085.   clearing%@BO:       68318@%
  18086.   disabling%@BO:       686b1@%
  18087.   immediate%@BO:       5d55c@%
  18088.   interrupt key%@BO:       5fd0f@%
  18089.   restoring disabled%@BO:       687bb@%
  18090.   setting%@BO:       5fa48@%%@BO:       68cca@%
  18091.   virtual%@BO:       5fa48@%
  18092. Byte values
  18093.   displaying 4-byte values as hexadecimal%@BO:       69cf0@%
  18094.   displaying hexadecimal and ASCII values%@BO:       69a02@%
  18095.   searching for%@BO:       70981@%
  18096.  
  18097. %@2@%%@AB@%    C%@AE@%%@EH@%%@NL@%
  18098. C Compiler
  18099.   default option%@BO:        e94e@%
  18100.   options (table)%@BO:        d2ab@%%@BO:        d47a@%
  18101.   versions supported by Windows%@BO:        c0a9@%
  18102. C language
  18103.   applications%@BO:        c0a9@%
  18104.   libraries%@BO:        f19b@%%@BO:       165fc@%
  18105. C run-time libraries%@BO:       165fc@%%@BO:       16c58@%
  18106. Callback function%@BO:        f19b@%
  18107. CAPITAL LETTERS, SMALL, as document convention%@BO:        adf2@%
  18108. Character information%@BO:       34b21@%
  18109. Character mapping%@BO:       374f5@%
  18110. Character window
  18111.   clearing%@BO:       3649b@%
  18112.   described%@BO:       347ee@%
  18113. Character-viewing window%@BO:       34a3b@%
  18114. Characters
  18115.   adding columns to%@BO:       3545c@%
  18116.   adding rows to%@BO:       3545c@%
  18117.   canceling changes to%@BO:       3703e@%
  18118.   changing character pixels%@BO:       351b8@%
  18119.   changing width of%@BO:       366c8@%
  18120.   deleting columns from%@BO:       35ae1@%
  18121.   deleting rows from%@BO:       35ae1@%
  18122.   displayed in Font Editor window%@BO:       345ed@%
  18123.   editing blocks of pixels%@BO:       35d6a@%
  18124.   editing%@BO:       34ddc@%%@BO:       3562a@%
  18125.   first of font%@BO:       37a44@%
  18126.   last of font%@BO:       37cd0@%
  18127.   pasting to and from Clipboard%@BO:       36418@%
  18128.   width restriction of%@BO:       36c7b@%
  18129. Check box control%@BO:       2ce85@%
  18130. Choosing messages%@BO:       9173f@%
  18131. CL command%@BO:        d47a@%
  18132. CL Compiler
  18133.    %@AI@%see%@AE@% C Compiler%@NL@%
  18134. Clearing breakpoints%@BO:       68318@%
  18135. CODE statement%@BO:       10443@%
  18136. Code, instruction%@BO:       70d58@%
  18137. CodeView for Windows (CVW)
  18138.   application development option for%@BO:        e4df@%
  18139.   breakpoints
  18140.     examples of%@BO:       4eb51@%
  18141.     on lines, functions, and addresses%@BO:       4d518@%
  18142.     on values%@BO:       4dc9d@%
  18143.     on Windows messages%@BO:       4e3dd@%
  18144.     removing%@BO:       4db7b@%
  18145.   calling functions%@BO:       53033@%
  18146.   commands
  18147.     Help on CVW commands%@BO:       45dd2@%
  18148.     new, in CVW%@BO:       3c634@%
  18149.   compared with
  18150.     CodeView for DOS%@BO:       3bd6d@%
  18151.     SYMDEB%@BO:       3b583@%
  18152.   compiling source code for use with%@BO:       3dd3a@%
  18153.   continuous execution%@BO:       4cdbc@%
  18154.   controlling program execution%@BO:       4c7c3@%
  18155.   customizing%@BO:       5429c@%
  18156.   debugging multiple instances of an application%@BO:       3efa6@%
  18157.   described%@BO:       3a59b@%%@BO:       3a7d8@%
  18158.   display windows
  18159.     adjusting%@BO:       43926@%
  18160.     described%@BO:       428e6@%
  18161.     opening%@BO:       42f6b@%
  18162.     selecting%@BO:       431d7@%
  18163.     using multiple Source windows%@BO:       52e05@%
  18164.     using the mouse with%@BO:       43547@%
  18165.   displaying memory
  18166.     dereferencing memory handles%@BO:       4b27a@%
  18167.     in the Memory window%@BO:       49285@%
  18168.     live expressions%@BO:       4a975@%
  18169.     local and global memory objects%@BO:       4991d@%
  18170.     register contents%@BO:       4b92f@%
  18171.   displaying variables
  18172.     arrays and structures%@BO:       47303@%%@BO:       47989@%%@BO:       47b10@%%@BO:       484a7@%
  18173.     expressions%@BO:       46e5a@%
  18174.     single values%@BO:       462af@%%@BO:       46ce9@%
  18175.     summarized%@BO:       45f52@%
  18176.     using the Quick Watch command%@BO:       486ed@%
  18177.   ending%@BO:       5262a@%
  18178.   Help in CVW%@BO:       45e31@%
  18179.   interrupting a session%@BO:       5046b@%
  18180.   menus%@BO:       43dc6@%%@BO:       44911@%
  18181.   preparing Windows applications%@BO:       3e1c2@%
  18182.   recording session information%@BO:       4212e@%
  18183.   redirecting input and output%@BO:       53d9b@%
  18184.   register variables%@BO:       53a0a@%
  18185.   requirements for use%@BO:       3afe6@%
  18186.   restarting%@BO:       529f5@%
  18187.   secondary monitor, setting up%@BO:       3cb1a@%
  18188.   setting
  18189.     breakpoints%@BO:       4d037@%
  18190.   single-step execution
  18191.     described%@BO:       4ca33@%
  18192.     stepping%@BO:       4f8c0@%
  18193.     tracing%@BO:       4f9db@%
  18194.   starting a CVW session%@BO:       3e3ac@%
  18195.   tracing
  18196.     program execution. See single-step execution.%@BO:       4f9db@%
  18197.     Windows messages%@BO:       48bf9@%
  18198.   undefined pointers%@BO:       537a4@%
  18199.   values, changing
  18200.     for program data%@BO:       4c13d@%
  18201.     for variables, memory locations and registers%@BO:       4c6d5@%
  18202.   windows-specific features%@BO:       3c7a3@%
  18203. Colon (:), use of with doubleword values%@BO:       6d471@%
  18204. Colors
  18205.   and bitmaps%@BO:       23ddc@%
  18206.   dithered%@BO:       23a83@%
  18207.   inverse%@BO:       24532@%
  18208.   opaque%@BO:       24358@%
  18209.   screen%@BO:       24417@%
  18210.   true%@BO:       23d1a@%
  18211. Combo box control%@BO:       2d798@%
  18212. Comma (, ), as parameter separator%@BO:       13eba@%
  18213. Command arguments, SYMDEB%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  18214. Comparing bytes in memory locations%@BO:       69249@%
  18215. Compiler options
  18216.   memory-model%@BO:        d880@%
  18217.   recommended for
  18218.     dynamic-link libraries%@BO:        eff1@%
  18219.     Windows applications%@BO:        d2ab@%
  18220. CompilersC Compiler
  18221.    %@AI@%see%@AE@% Resource Compiler%@NL@%
  18222. CONTROL+C key%@BO:       5d71a@%
  18223. CONTROL+S%@AI@% key%@AE@%%@ACKC6A00080034 @%
  18224. Controls
  18225.   changing identifiers%@BO:       2eff5@%
  18226.   changing styles of%@BO:       2f18c@%
  18227.   changing text%@BO:       2f498@%
  18228.   custom%@BO:       29740@%%@BO:       29e79@%%@BO:       2dd86@%
  18229.   displaying information about%@BO:       2b6ca@%
  18230.   positions of%@BO:       2b6ca@%
  18231.   predefined identifiers%@BO:       29580@%
  18232.   symbolic names of%@BO:       28d60@%
  18233.   temporary%@BO:       29cc9@%
  18234. Copying
  18235.   dialog-box controls%@BO:       2f86d@%
  18236.   file or disk contents into memory%@BO:       6f07a@%
  18237. CPU registers, displaying contents of%@BO:       706ec@%
  18238. Creating
  18239.   cursor (.CUR) files%@BO:       227d7@%
  18240.   cursors%@BO:       227d7@%
  18241.   icon (.ICO) files%@BO:       2228f@%
  18242.   import libraries%@BO:       12f54@%
  18243.   map files%@BO:       57967@%
  18244.   module-definition (.DEF) files%@BO:        f971@%%@BO:       1020e@%%@BO:       11423@%%@BO:       116bc@%%@BO:       120e6@%%@BO:       12b53@%
  18245.   resource script (.RC) files%@BO:       17ccd@%%@BO:       18801@%
  18246.   symbol files%@BO:       57967@%
  18247.   Windows applications%@BO:        8d63@%
  18248. Curly braces ({ }), as document convention%@BO:        acc7@%
  18249. Cursor (.CUR) files
  18250.   and File menu%@BO:       20b17@%
  18251.   and Image menu%@BO:       20e65@%
  18252.   and SDKPAINT process%@BO:       1f5b2@%
  18253.   creating%@BO:       227d7@%
  18254.   described%@BO:       1fb2e@%
  18255.   working with colors%@BO:       24ae5@%
  18256. CURSOR resource statement%@BO:       18971@%
  18257. Cursor
  18258.    %@AI@%see also%@AE@% Cursor (.CUR) files%@NL@%
  18259.   creating%@BO:       2202a@%%@BO:       227d7@%
  18260.   cursor images, and creating icons%@BO:       25fdc@%
  18261.   defining%@BO:       24126@%
  18262.   displaying%@BO:       1fcfd@%%@BO:       2066e@%
  18263.   editing%@BO:       2400c@%
  18264.   hotspot%@BO:       215a1@%%@BO:       25ce4@%
  18265.   inverse colors with%@BO:       25061@%
  18266.   opaque color options%@BO:       24ae5@%
  18267.   screen colors with%@BO:       24c5c@%
  18268.   with clipboard%@BO:       262db@%
  18269.   with color%@BO:       24358@%
  18270. Custom control%@BO:       2dd86@%
  18271. Custom controls%@BO:       298e6@%%@BO:       29a0d@%
  18272.  
  18273. %@2@%%@AB@%    D%@AE@%%@EH@%%@NL@%
  18274. -D option%@BO:       1b3ff@%
  18275. DATA statement%@BO:       1057f@%
  18276. Debugging toolsCodeView for Windows (CVW) Spy
  18277.    %@AI@%see%@AE@% Symbolic Debugger (SYMDEB) %@NL@%
  18278. Debugging
  18279.   adding line-number information%@BO:        e4df@%
  18280.   entering into memory;ASCII strings%@BO:       6cd6d@%
  18281.   in protected mode. See CodeView for Windows(CVW)%@BO:       3a7d8@%
  18282.   in real mode. See Symbolic Debugger (SYMDEB)%@BO:       56efd@%
  18283. .DEF file
  18284.    %@AI@%see%@AE@% Module-definition (.DEF) files%@NL@%
  18285. Defining macros%@BO:       6f856@%
  18286. Deleting dialog-box controls%@BO:       2fae7@%
  18287. DESCRIPTION statement%@BO:       105dd@%
  18288. Dialog boxes
  18289.   adding group marker to%@BO:       3047c@%
  18290.   controls
  18291.     changing order of%@BO:       30bee@%
  18292.     editing%@BO:       2c648@%
  18293.     using custom%@BO:       29740@%%@BO:       29c08@%
  18294.   creating new%@BO:       27307@%%@BO:       2c648@%
  18295.   defining styles of%@BO:       312b9@%
  18296.   deleting group marker from%@BO:       3079f@%
  18297.   editing
  18298.     canceling edits%@BO:       31867@%
  18299.     include files%@BO:       31d78@%%@BO:       32622@%%@BO:       32b0a@%%@BO:       32e2b@%%@BO:       333e7@%%@BO:       336ec@%
  18300.     methods of%@BO:       2888a@%
  18301.   modifying%@BO:       27391@%
  18302.   moving between resources%@BO:       31976@%
  18303.   opening existing%@BO:       2c599@%
  18304.   renaming%@BO:       311b2@%
  18305.   resizing%@BO:       30fdb@%
  18306.   setting memory flags for%@BO:       3145b@%
  18307. Dialog Editor
  18308.   controls, groups of
  18309.     moving%@BO:       2eb4d@%%@BO:       2fdd3@%
  18310.     specifying%@BO:       3047c@%
  18311.   controls, order of%@BO:       30bee@%
  18312.   described%@BO:       27307@%
  18313.   dialog unit%@BO:       2bd04@%
  18314.   editing include files%@BO:       333e7@%
  18315.   group marker%@BO:       3047c@%
  18316.   mouse requirement for%@BO:       275d2@%
  18317.   opening
  18318.     dialog boxes%@BO:       2c486@%
  18319.     include files%@BO:       2c17f@%
  18320.     resource files%@BO:       2c027@%
  18321.   sizing handle%@BO:       2ec95@%
  18322.   tab stop for%@BO:       308aa@%
  18323.   toolbox
  18324.     described%@BO:       2b461@%
  18325.     enabling%@BO:       2e053@%
  18326.   using Clipboard format%@BO:       31c78@%
  18327.   window%@BO:       29fc4@%
  18328.   working with files
  18329.     dialog script%@BO:       276f4@%%@BO:       2824a@%
  18330.     include%@BO:       27baf@%%@BO:       28d60@%%@BO:       2c17f@%
  18331.     resource%@BO:       279d6@%%@BO:       2888a@%%@BO:       2bf48@%
  18332. Dialog script (.DLG) files%@BO:       276f4@%%@BO:       27d74@%
  18333. Dialog unit, described%@BO:       2bd04@%
  18334. Dialog-box controls
  18335.   adding
  18336.     custom%@BO:       2e4f4@%
  18337.     standard%@BO:       2df55@%
  18338.   custom%@BO:       2dd86@%
  18339.   defining symbolic names for%@BO:       32f69@%
  18340.   deleting%@BO:       2fae7@%
  18341.   duplicating%@BO:       2f86d@%
  18342.   identifiers for changing%@BO:       2eff5@%
  18343.   input focus
  18344.     specifying%@BO:       30125@%
  18345.     using tab stops%@BO:       308aa@%
  18346.   moving
  18347.     groups of%@BO:       2fdd3@%
  18348.     individual%@BO:       2e8fe@%
  18349.   resizing%@BO:       2ec95@%
  18350.   static text%@BO:       2d402@%
  18351.   styles, changing%@BO:       2f18c@%
  18352.   text, changing%@BO:       2f498@%
  18353.   types of
  18354.     check box%@BO:       2ce85@%
  18355.     combo box%@BO:       2d798@%
  18356.     edit%@BO:       2d2b0@%
  18357.     frame%@BO:       2d8de@%
  18358.     group box%@BO:       2d55b@%
  18359.     horizontal scroll bar%@BO:       2d0b0@%
  18360.     icon%@BO:       2db36@%
  18361.     list box%@BO:       2d67b@%
  18362.     push button%@BO:       2c94e@%
  18363.     radio button%@BO:       2cb88@%
  18364.     rectangle%@BO:       2dc2c@%
  18365.     vertical scroll bar%@BO:       2d0b0@%
  18366. Directives, resource%@BO:       18801@%
  18367. Disabling breakpoints%@BO:       6856c@%
  18368. Displaying
  18369.   ASCII characters within a given range%@BO:       697a5@%
  18370.   CPU registers, contents of%@BO:       7063f@%
  18371.   cursor hotspot%@BO:       215a1@%
  18372.   expression, value of%@BO:       72a06@%
  18373.   hexadecimal values
  18374.     of bytes in given range%@BO:       69a02@%
  18375.     of doublewords%@BO:       69cf0@%
  18376.     of words%@BO:       6c834@%
  18377.   instruction code%@BO:       70d58@%
  18378.   instructions, of program being debugged%@BO:       71320@%
  18379.   list of
  18380.     global free memory objects in global heap%@BO:       69f8b@%%@BO:       79d9d@%
  18381.     global memory objects in global heap%@BO:       6a1dc@%%@BO:       7a16b@%
  18382.     global modules in global heap%@BO:       6b378@%%@BO:       7b3aa@%
  18383.     local memory objects in local heap%@BO:       6acf2@%%@BO:       7af51@%
  18384.     LRU global memory objects%@BO:       6bf9f@%%@BO:       7bb7a@%
  18385.     SYMDEB commands and operators%@BO:       7277d@%
  18386.   long floating-point numbers%@BO:       6b124@%
  18387.   memory objects%@BO:       954b1@%
  18388.   memory, contents of%@BO:       694d4@%
  18389.   one byte from the input port%@BO:       6e67a@%
  18390.   short floating-point numbers%@BO:       6bb1f@%
  18391.   source line
  18392.     actual program%@BO:       711d9@%%@BO:       715cc@%
  18393.     current%@BO:       72b18@%
  18394.   stack frame
  18395.     current%@BO:       6e82d@%%@BO:       852ae@%%@BO:       85764@%
  18396.     for a specified task%@BO:       6eb8a@%%@BO:       85a9e@%
  18397.     stack location and frame-pointer values%@BO:       6eed8@%%@BO:       860a8@%
  18398.   statements, of program being debugged%@BO:       714f8@%
  18399.   sum and difference of two hexadecimal numbers%@BO:       6e50a@%
  18400.   symbol map information%@BO:       71bd1@%
  18401.   symbol maps%@BO:       5ddd1@%
  18402.   symbols%@BO:       5e808@%
  18403.   task-queue information%@BO:       6b6a7@%%@BO:       7b6ea@%
  18404.   ten-byte floating-point numbers%@BO:       6bd69@%
  18405.   variables%@BO:       5ffac@%
  18406. DLLs
  18407.    %@AI@%see%@AE@% Dynamic-link libraries%@NL@%
  18408. Document conventions%@BO:        9d83@%%@BO:        9ea9@%%@BO:        a149@%%@BO:        a21c@%%@BO:        a33c@%%@BO:        a57c@%%@BO:        a7d9@%%@BO:        a9f4@%%@BO:        ac17@%%@BO:        acc7@%%@BO:        adf2@%
  18409. Dollar sign ($), with commands%@BO:       65002@%
  18410. DOS commands
  18411.   CL%@BO:        d47a@%
  18412.   command processor%@BO:       733b5@%
  18413.   exit%@BO:       733b5@%
  18414.   mode%@BO:       59428@%
  18415.   RC%@BO:       1aa71@%
  18416. Double brackets ({{ }}), as document convention%@BO:        a75c@%
  18417. Doubleword values%@BO:       6d471@%
  18418. Dynamic-link Libraries (DLLs)
  18419.   custom control%@BO:       298e6@%
  18420. Dynamic-link libraries (DLLs)
  18421.   module-definition (.DEF) files, requirements%@BO:       120e6@%
  18422.   options for compiling%@BO:        eff1@%%@BO:        f4e1@%
  18423.   written in C language, requirements%@BO:        f19b@%
  18424.  
  18425. %@2@%%@AB@%    E%@AE@%%@EH@%%@NL@%
  18426. -E option%@BO:       1bc93@%
  18427. Echoing comment on output devices%@BO:       734c7@%
  18428. Edit control%@BO:       2d2b0@%
  18429. Editing
  18430.   canceling dialog box edits%@BO:       31867@%
  18431.   dialog box controls%@BO:       2c648@%
  18432.   dialog box%@BO:       27307@%
  18433.   include files%@BO:       333e7@%
  18434. Ellipses, as document convention
  18435.   horizontal%@BO:        a57c@%
  18436.   vertical%@BO:        a33c@%
  18437. EMS (Expanded Memory Specification)
  18438.   defined%@BO:       9350c@%
  18439.   walking%@BO:       94f7f@%
  18440. Enabling breakpoints%@BO:       687bb@%
  18441. Enabling toolbox%@BO:       2e053@%
  18442. Epilog (Windows)%@BO:        f19b@%
  18443. Executable files%@BO:       1740b@%
  18444. Executing
  18445.   instructions%@BO:       70163@%%@BO:       711d9@%
  18446.   macros%@BO:       6f856@%
  18447. Execution control%@BO:       6e423@%%@BO:       703e5@%%@BO:       711d9@%%@BO:       733b5@%
  18448. EXETYPE statement%@BO:       106b4@%
  18449. EXETYPE WINDOWS statement%@BO:       11818@%%@BO:       1245f@%
  18450. Expanded Memory Specification
  18451.    %@AI@%see%@AE@% EMS%@NL@%
  18452. Exported function%@BO:        f19b@%
  18453. EXPORTS statement%@BO:       1090d@%%@BO:       12363@%
  18454. Expressions
  18455.   displaying value of%@BO:       72a06@%
  18456.   SYMDEB commands%@BO:       665df@%
  18457.  
  18458. %@2@%%@AB@%    F%@AE@%%@EH@%%@NL@%
  18459. Fatal exit message%@BO:       60d2e@%
  18460. -Fe option%@BO:       1b499@%
  18461. File headers, executable%@BO:       1740b@%
  18462. Filenames, setting for load and write commands%@BO:       6fbd9@%
  18463. Files
  18464.   dialog script (.DLG)%@BO:       276f4@%%@BO:       27d74@%
  18465.   executable file headers%@BO:       1740b@%
  18466.   icon (.ICO)%@BO:       1f5b2@%%@BO:       1fb2e@%%@BO:       20b17@%%@BO:       20e65@%%@BO:       2228f@%%@BO:       24a7e@%
  18467.   include (.H)%@BO:       27baf@%%@BO:       28d60@%
  18468.   loading%@BO:       6f55b@%
  18469.   module-definition (.DEF)%@BO:       1027c@%
  18470.   resource (.R)%@BO:       279d6@%%@BO:       2888a@%
  18471.   resource script (.RC)%@BO:       17ccd@%%@BO:       27307@%
  18472.   symbol%@BO:       57720@%
  18473. Filling addresses in a given range%@BO:       6df29@%
  18474. Floating-point numbers%@BO:       6b25b@%%@BO:       6bc57@%%@BO:       6bd69@%
  18475. Floating-point values%@BO:       6d73d@%%@BO:       6d9b8@%
  18476. -Fo option%@BO:       1b440@%%@BO:       1dc08@%
  18477. Font Editor
  18478.   adding
  18479.     columns to a character%@BO:       3545c@%
  18480.     rows to a character%@BO:       3545c@%
  18481.   canceling changes%@BO:       370c8@%
  18482.   changing
  18483.     character pixels%@BO:       351b8@%
  18484.     character width%@BO:       366c8@%%@BO:       374f5@%
  18485.     font file header information%@BO:       3827f@%
  18486.   character information display%@BO:       34b21@%
  18487.   character window
  18488.     clearing%@BO:       3649b@%
  18489.     described%@BO:       347ee@%
  18490.   character-viewing window%@BO:       34a3b@%
  18491.   Clipboard characters, using%@BO:       36418@%
  18492.   deleting
  18493.     columns from characters%@BO:       35ae1@%
  18494.     rows from characters%@BO:       35ae1@%
  18495.   described%@BO:       33eeb@%
  18496.   editing
  18497.     blocks of pixels%@BO:       35d6a@%
  18498.     characters%@BO:       34ddc@%%@BO:       3562a@%%@BO:       35ae1@%
  18499.   fixed-pitch font%@BO:       37dcc@%
  18500.   Font Editor window%@BO:       345ed@%
  18501.   font family names%@BO:       39720@%
  18502.   font window%@BO:       34bfd@%
  18503.   mouse requirement for%@BO:       3420f@%
  18504.   opening fonts%@BO:       343a3@%
  18505.   resizing fonts%@BO:       374f5@%
  18506.   variable-pitch font%@BO:       37dcc@%
  18507.   window%@BO:       345ed@%
  18508. Font EditorFonts
  18509.    %@AI@%see also%@AE@% Pixels%@NL@%
  18510. Font file header, editing%@BO:       3827f@%
  18511. FONT resource statement%@BO:       18971@%
  18512. Fonts
  18513.   break character of%@BO:       391a6@%
  18514.   canceling changes to%@BO:       36dc2@%%@BO:       370c8@%
  18515.   copyright of%@BO:       385ce@%
  18516.   creating%@BO:       33f1e@%%@BO:       345ed@%%@BO:       34ddc@%%@BO:       351b8@%%@BO:       3545c@%%@BO:       3562a@%%@BO:       36418@%%@BO:       36814@%%@BO:       36c7b@%
  18517.   default character of%@BO:       38fda@%
  18518.   editing%@BO:       374f5@%%@BO:       37a44@%%@BO:       38136@%%@BO:       38fda@%
  18519.   face name of%@BO:       3847c@%
  18520.   filename of%@BO:       384d9@%
  18521.   first character of%@BO:       37a44@%
  18522.   font character set%@BO:       39526@%
  18523.   font face name %@AI@%vs%@AE@%. filename%@BO:       3827f@%
  18524.   font families%@BO:       39720@%
  18525.   font file header%@BO:       3827f@%%@BO:       38fda@%
  18526.   height of
  18527.     ascent%@BO:       387f8@%
  18528.     character pixel%@BO:       3768f@%
  18529.   height%@BO:       374f5@%
  18530.   last character of%@BO:       37cd0@%
  18531.   leading of
  18532.     external%@BO:       38bbe@%
  18533.     internal%@BO:       38e08@%
  18534.   nominal point size of%@BO:       386b1@%
  18535.   nominal resolution of
  18536.     horizontal%@BO:       38930@%
  18537.     vertical%@BO:       38894@%
  18538.   opening, in Font Editor%@BO:       343a3@%
  18539.   options
  18540.     strikeout%@BO:       39c2a@%
  18541.     underline%@BO:       39b41@%
  18542.   pitches of%@BO:       37dcc@%
  18543.   saving changes to%@BO:       36dc2@%
  18544.   types of
  18545.     fixed-pitch%@BO:       37dcc@%
  18546.     raster%@BO:       3412b@%
  18547.     variable-pitch%@BO:       36b2e@%%@BO:       37dcc@%
  18548.     vector%@BO:       3412b@%
  18549.   weights of%@BO:       38136@%
  18550.   width of
  18551.     fixed-pitch%@BO:       3788d@%
  18552.     variable-pitch%@BO:       37768@%
  18553. Frame control%@BO:       2d8de@%
  18554. Functions
  18555.   callback%@BO:        f19b@%
  18556.   exported%@BO:        f19b@%%@BO:       1740b@%
  18557.   imported%@BO:       1740b@%
  18558.   WinMain%@BO:       5fb2e@%
  18559.  
  18560. %@2@%%@AB@%    G%@AE@%%@EH@%%@NL@%
  18561. GDI library, symbol files%@BO:       5c8bb@%
  18562. Global heap
  18563.   allocating memory to examine%@BO:       96391@%
  18564.   defining displayed objects%@BO:       954b1@%
  18565.   displaying lists of
  18566.     free global memory objects in%@BO:       69f8b@%%@BO:       79d9d@%
  18567.     global memory objects in%@BO:       6a26e@%%@BO:       7a411@%
  18568.     global modules in%@BO:       6b40d@%%@BO:       7b44b@%
  18569.     LRU global memory objects in%@BO:       6bf9f@%%@BO:       7bb7a@%
  18570.   protected mode%@BO:       93249@%
  18571.   real mode%@BO:       9334b@%%@BO:       9350c@%
  18572.   saving lists of objects on%@BO:       93ca8@%
  18573.   sorting displayed objects%@BO:       9510c@%
  18574.   total size of examined objects%@BO:       96d66@%
  18575.   viewing%@BO:       92ee7@%
  18576.   walking EMS%@BO:       94f7f@%
  18577.   walking%@BO:       942e4@%
  18578. Group box control%@BO:       2d55b@%
  18579. Group marker
  18580.   adding%@BO:       3047c@%
  18581.   deleting%@BO:       3079f@%
  18582.  
  18583. %@2@%%@AB@%    H%@AE@%%@EH@%%@NL@%
  18584. .H file
  18585.    %@AI@%see%@AE@% Include (.H) files%@NL@%
  18586. -H option%@BO:       1cab1@%
  18587. Heap Walker
  18588.   allocating memory examined by%@BO:       96391@%
  18589.   defining objects displayed by%@BO:       954b1@%
  18590.   described%@BO:       92ee7@%
  18591.   displaying selected objects%@BO:       942e4@%
  18592.   file operation commands%@BO:       93ca8@%
  18593.   information displayed by%@BO:       937b4@%
  18594.   memory allocation commands%@BO:       96391@%
  18595.   memory object commands%@BO:       954b1@%
  18596.   saving object lists%@BO:       93ca8@%
  18597.   sorting displayed objects%@BO:       9510c@%
  18598.   total size of objects examined by%@BO:       96d66@%
  18599.   window%@BO:       935fc@%
  18600. HEAPSIZE statement%@BO:       10a02@%
  18601. Height, font%@BO:       374f5@%
  18602. Help compiler%@BO:       b925a@%%@BO:       b94a7@%%@BO:       b9bc7@%%@BO:       b9f26@%
  18603. Help graphics%@BO:       a7d98@%%@BO:       a80ed@%
  18604.   bitmaps
  18605.     creating, capturing%@BO:       afa51@%%@BO:       afef6@%
  18606.     placing%@BO:       b015f@%%@BO:       b07e0@%
  18607. Help Project file
  18608.   accessing from an application%@BO:       ba165@%
  18609.   Alias section%@BO:       b7686@%%@BO:       b7e0b@%
  18610.   Bitmaps section%@BO:       b8edd@%
  18611.   bitmaps, including by reference%@BO:       b8edd@%
  18612.   Build option%@BO:       b4374@%%@BO:       b4914@%%@BO:       b4d2b@%
  18613.   Build Tags section%@BO:       b30d8@%%@BO:       b33f2@%
  18614.   compiling%@BO:       b925a@%%@BO:       b94a7@%%@BO:       b9bc7@%%@BO:       b9f26@%
  18615.   Compress option%@BO:       b6fd6@%%@BO:       b749c@%
  18616.   context strings, alternate%@BO:       b7686@%%@BO:       b7e0b@%
  18617.   context-sensitive Help%@BO:       bb44e@%%@BO:       bb6be@%%@BO:       bbeba@%%@BO:       bc93d@%%@BO:       bd31c@%
  18618.   context-sensitive topics%@BO:       b8066@%%@BO:       b83f2@%%@BO:       b8838@%%@BO:       b8d83@%
  18619.   creating%@BO:       b2104@%%@BO:       b2789@%
  18620.   F1 support%@BO:       bc743@%%@BO:       bc93d@%%@BO:       bd31c@%
  18621.   Files section%@BO:       b2a9d@%
  18622.   Forcefont option%@BO:       b5be0@%%@BO:       b5fc4@%
  18623.   Index option%@BO:       b53c5@%%@BO:       b5728@%
  18624.   keyword table, accessing%@BO:       bd863@%
  18625.   Map section%@BO:       b8066@%%@BO:       b83f2@%%@BO:       b8838@%%@BO:       b8d83@%
  18626.   Mapfontsize option%@BO:       b6270@%%@BO:       b6860@%
  18627.   Multikey option%@BO:       b6943@%%@BO:       b6e5c@%
  18628.   on Help menu item%@BO:       bd4c5@%
  18629.   Options section%@BO:       b34d0@%%@BO:       b3afd@%
  18630.   Root option%@BO:       b4e46@%%@BO:       b51ec@%
  18631.   Title option%@BO:       b58b3@%
  18632.   Warning option%@BO:       b3c0e@%%@BO:       b41a1@%
  18633. Help system
  18634.    %@AI@%see also%@AE@% Help%@NL@%
  18635.   appearance to programmer%@BO:       a2f58@%
  18636.   appearance to user%@BO:       a25a6@%%@BO:       a28df@%
  18637.   appearance to writer%@BO:       a2b20@%%@BO:       a2dc6@%
  18638.   calling WinHelp%@BO:       ba25c@%%@BO:       ba546@%%@BO:       baaf7@%%@BO:       bb292@%
  18639.   development cycle described%@BO:       a1fa6@%%@BO:       a2528@%
  18640.   graphics. See Help graphics%@BO:       a7d98@%
  18641.   hypertext links summarized%@BO:       a30e9@%
  18642.   topics. See Help topics%@BO:       a3e4c@%
  18643. Help text
  18644.   fonts%@BO:       a789e@%%@BO:       a7b0c@%
  18645.   layout%@BO:       a62a3@%%@BO:       a6946@%%@BO:       a75c7@%
  18646. Help tools
  18647.    %@AI@%see%@AE@% Help%@NL@%
  18648. Help topic files
  18649.   authoring tool%@BO:       a8de2@%
  18650.   browse sequence numbers%@BO:       ad2cd@%%@BO:       ad76f@%%@BO:       adeac@%%@BO:       ae30f@%%@BO:       ae5a0@%
  18651.   build tags%@BO:       aa061@%%@BO:       aa40f@%%@BO:       aac72@%
  18652.   context strings%@BO:       aad89@%%@BO:       ab534@%
  18653.   control codes%@BO:       a9473@%
  18654.   cross references%@BO:       ae89a@%
  18655.   definitions%@BO:       aed21@%%@BO:       af31b@%
  18656.   graphics%@BO:       af875@%
  18657.   jumps%@BO:       ae89a@%
  18658.   key words%@BO:       abf56@%%@BO:       ac475@%%@BO:       ac8aa@%%@BO:       ad012@%
  18659.   managing%@BO:       b0f06@%
  18660.   title footnotes%@BO:       ab5a0@%%@BO:       ab7e6@%%@BO:       abd31@%
  18661.   tracking%@BO:       b0fa7@%%@BO:       b19a0@%
  18662. Help topics
  18663.   content%@BO:       a3e4c@%
  18664.   context-sensitivity%@BO:       a4eef@%%@BO:       a50dd@%%@BO:       a55c7@%%@BO:       a56e1@%
  18665.   cross-references%@BO:       ae7ad@%
  18666.   definitions%@BO:       aed21@%%@BO:       af31b@%
  18667.   file structure%@BO:       a5899@%%@BO:       a5b64@%%@BO:       a5e93@%
  18668.   files. See Help topic files%@BO:       a90b5@%
  18669.   jumps%@BO:       ae89a@%
  18670.   structure of%@BO:       a441b@%%@BO:       a4d25@%
  18671.   text. See Help text%@BO:       a62a3@%
  18672. Help Tracker%@BO:       b1409@%%@BO:       b19a0@%
  18673. Help
  18674.   audience definition%@BO:       a38dc@%%@BO:       a3d79@%
  18675.   cancelling%@BO:       be237@%%@BO:       be7ae@%
  18676.   compiler error messages%@BO:       bf7e5@%%@BO:       bfe17@%%@BO:       c0930@%%@BO:       c155b@%%@BO:       c2246@%%@BO:       c2cfc@%%@BO:       c382e@%%@BO:       c3e7c@%%@BO:       c4a86@%%@BO:       c5730@%%@BO:       c63a0@%%@BO:       c71fc@%%@BO:       c7db4@%%@BO:       c89f0@%
  18677.   context-sensitive%@BO:       a4eef@%%@BO:       a50dd@%%@BO:       a55c7@%%@BO:       a56e1@%%@BO:       bb44e@%%@BO:       bb6be@%%@BO:       bbeba@%%@BO:       bc93d@%%@BO:       bd31c@%
  18678.   control codes%@BO:       a9473@%
  18679.   error messages%@BO:       bf7e5@%%@BO:       bfe17@%%@BO:       c0930@%%@BO:       c155b@%%@BO:       c2246@%%@BO:       c2cfc@%%@BO:       c382e@%%@BO:       c3e7c@%%@BO:       c4a86@%%@BO:       c5730@%%@BO:       c63a0@%%@BO:       c71fc@%%@BO:       c7db4@%%@BO:       c8a4e@%
  18680.   F1 support%@BO:       bc743@%%@BO:       bc93d@%%@BO:       bd31c@%
  18681.   file structure%@BO:       a5899@%%@BO:       a5b64@%%@BO:       a5e93@%
  18682.   file. See Help Project file%@BO:       b1d92@%
  18683.   key words%@BO:       abf56@%%@BO:       ac475@%%@BO:       ac8aa@%%@BO:       ad012@%
  18684.   keyword table, accessing%@BO:       bd863@%
  18685.   on Help menu item%@BO:       bd4c5@%
  18686.   planning
  18687.     overview%@BO:       a3601@%
  18688.   topic files
  18689.     examples%@BO:       bef1b@%
  18690.     links summarized%@BO:       a3284@%
  18691. Hexadecimal values
  18692.   of bytes in the given range%@BO:       69a02@%
  18693.   of double words%@BO:       69cf0@%
  18694.   of floating-point numbers in the given range%@BO:       6b25b@%%@BO:       6bc57@%
  18695.   of words in the given range%@BO:       6c929@%
  18696. Hits, defined%@BO:       9e0b0@%
  18697. Hotspot, cursor
  18698.   defining%@BO:       25ce4@%
  18699.   displaying%@BO:       215a1@%
  18700. Hyphen (-), as SYMDEB option designator%@BO:       5c450@%
  18701.  
  18702. %@2@%%@AB@%    I%@AE@%%@EH@%%@NL@%
  18703. -I option%@BO:       1b593@%%@BO:       1df17@%%@BO:       1e3bf@%
  18704. Icon (.ICO) files
  18705.   and File menu%@BO:       20b17@%
  18706.   and Image menu%@BO:       20e65@%
  18707.   and SDKPAINT process%@BO:       1f5b2@%
  18708.   creating%@BO:       2228f@%
  18709.   described%@BO:       1fb2e@%
  18710.   working with colors%@BO:       24a7e@%
  18711. Icon control%@BO:       2db94@%
  18712. ICON resource statement%@BO:       18971@%
  18713. Icons
  18714.    %@AI@%see also%@AE@% Icon (.ICO) files%@NL@%
  18715.   colors with%@BO:       23a83@%
  18716.   creating, with cursor images%@BO:       25fdc@%
  18717.   editing colors for%@BO:       2549c@%
  18718.   editing%@BO:       23f19@%
  18719.   inverse colors with%@BO:       25061@%
  18720.   opaque color options%@BO:       24a7e@%
  18721.   screen colors with%@BO:       24c5c@%
  18722. Identifiers, dialog-box control%@BO:       2eff5@%
  18723. Immediate breakpoint%@BO:       5d4d8@%
  18724. IMPLIB utility%@BO:       12b53@%
  18725. IMPORTS statement%@BO:       10cba@%%@BO:       12b53@%
  18726. Include (.H) files
  18727.   creating%@BO:       32622@%
  18728.   editing%@BO:       32e2b@%%@BO:       333e7@%
  18729.   loading%@BO:       32b0a@%
  18730.   saving%@BO:       336ec@%
  18731.   working with%@BO:       28c34@%
  18732. Input focus, dialog-box control%@BO:       30125@%
  18733. Input port%@BO:       6e67a@%
  18734. Input, redirecting input commands%@BO:       72c3a@%
  18735. Instruction code, displaying%@BO:       70d58@%
  18736. Interrupt key%@BO:       5fd0f@%
  18737. %@AI@%Italic text%@AE@%, as document convention%@BO:        a149@%
  18738.  
  18739. %@2@%%@AB@%    K%@AE@%%@EH@%%@NL@%
  18740. -K option%@BO:       1c1c9@%
  18741. Kernel library, symbol files%@BO:       5c8bb@%
  18742. Keys
  18743.   CONTROL+C%@BO:       5d71a@%
  18744.   CONTROL+S%@AI@%%@AE@%%@ACKC6A00080033 @%
  18745.   SCROLL LOCK%@BO:       5d36a@%
  18746.   SYS REQ%@BO:       5d4d8@%
  18747.  
  18748. %@2@%%@AB@%    L%@AE@%%@EH@%%@NL@%
  18749. -L option%@BO:       1b8a2@%
  18750. Leading%@BO:       38bbe@%%@BO:       38e08@%
  18751. LIBRARY statement%@BO:       10d94@%%@BO:       121cc@%
  18752. Library symbol files%@BO:       5c8b9@%%@BO:       5c8ba@%%@BO:       5c8bb@%
  18753. -LIM 32 option%@BO:       1b900@%
  18754. Linker
  18755.   command options
  18756.     described%@BO:       143a0@%%@BO:       14f7a@%%@BO:       159eb@%%@BO:       15f3f@%
  18757.     not allowed%@BO:       1622b@%
  18758.     not recommended%@BO:       1622b@%
  18759.   creating import libraries%@BO:       12f54@%
  18760.   LINK command, using%@BO:       1388e@%
  18761.   linking
  18762.     applications files%@BO:       1383a@%
  18763.     dynamic-link libraries%@BO:        f836@%%@BO:       120e6@%%@BO:       1253d@%%@BO:       1274b@%%@BO:       12f54@%
  18764.     module-definition (.DEF) files%@BO:        f836@%
  18765.     source files%@BO:        f836@%
  18766.     Windows applications%@BO:       13611@%
  18767.   module-definition (.DEF) files
  18768.     creating for applications%@BO:       11423@%%@BO:       116bc@%
  18769.     creating for libraries%@BO:       116bc@%%@BO:       120e6@%%@BO:       12b53@%
  18770.     importing dynamic-link libraries%@BO:       12cf6@%
  18771.     module statements%@BO:       1027c@%%@BO:       116bc@%
  18772.     requirements for creating%@BO:        f971@%
  18773. Linking
  18774.    %@AI@%see%@AE@% Linker%@NL@%
  18775. List box control%@BO:       2d67b@%
  18776. Listing breakpoint information%@BO:       68a2d@%
  18777. Loading
  18778.   files%@BO:       6f55b@%
  18779.   logical records%@BO:       6f55b@%
  18780. Local heap%@BO:       6ae1e@%%@BO:       7b087@%
  18781. Logical records, loading%@BO:       6f55b@%
  18782.  
  18783. %@2@%%@AB@%    M%@AE@%%@EH@%%@NL@%
  18784. -M option%@BO:       1bb66@%
  18785. Macro
  18786.   defining%@BO:       6f856@%
  18787.   executing%@BO:       6f856@%
  18788. Managing output%@BO:       9b123@%
  18789. Map files%@BO:       13d33@%%@BO:       57967@%%@BO:       57d29@%
  18790. Maps
  18791.    %@AI@%see%@AE@% Symbol maps%@NL@%
  18792. MAPSYM program
  18793.   creating symbol files%@BO:       57967@%
  18794.   sample symbol file%@BO:       58a25@%%@BO:       58f4a@%
  18795. MASM assembler%@BO:        923d@%
  18796. Math coprocessor/emulator, with Windows%@BO:       170d8@%
  18797. Memory flags, setting dialog box%@BO:       3145b@%
  18798. Memory models%@BO:        dab7@%%@BO:       16751@%
  18799. Memory
  18800.   comparing bytes in memory locations%@BO:       69249@%
  18801.   copying file or disk contents into%@BO:       6f07a@%
  18802.   determining size%@BO:       96d66@%
  18803.   displaying contents of within a given range%@BO:       694d4@%
  18804.   entering
  18805.     ASCII strings into%@BO:       6cd6d@%
  18806.     byte values into%@BO:       6cfce@%
  18807.     doubleword values into%@BO:       6d2ca@%
  18808.     long floating-point values into%@BO:       6d596@%
  18809.     short floating-point values into%@BO:       6d80d@%
  18810.     ten-byte real values into%@BO:       6da8b@%
  18811.     values into%@BO:       6ca11@%
  18812.     word values into%@BO:       6dcf7@%
  18813.   moving blocks of%@BO:       6f67b@%
  18814.   testing movable%@BO:       97ad6@%
  18815. Menu bar%@BO:       2a027@%
  18816. Messages
  18817.   choosing%@BO:       9173f@%
  18818.   fatal-exit%@BO:       60d2e@%
  18819.   information Spy monitors%@BO:       9173f@%
  18820.   memory-allocation%@BO:       5f1e5@%
  18821.   monitoring%@BO:       908ec@%%@BO:       9173f@%
  18822. Microsoft QuickC%@BO:        c0a9@%%@BO:        f971@%
  18823. Mnemonics, instruction%@BO:       67323@%
  18824. Mode display%@BO:       2b2e1@%
  18825. Module statements
  18826.    %@AI@%see%@AE@% Module-definition (.DEF) files%@NL@%
  18827. Module-definition ( DEF) files
  18828.   for applications
  18829.     described%@BO:       11818@%
  18830. Module-definition (.DEF) files
  18831.   creating%@BO:       1020e@%%@BO:       11423@%%@BO:       120e6@%%@BO:       12b53@%
  18832.   described%@BO:        9191@%%@BO:       1020e@%
  18833.   for applications
  18834.     described%@BO:       11423@%
  18835.     sample file%@BO:       11817@%%@BO:       11818@%%@BO:       12013@%
  18836.   for dynamic-link libraries
  18837.     described%@BO:       120e6@%
  18838.     sample file%@BO:       1253d@%
  18839.   linking applications%@BO:       13e65@%
  18840.   module statements
  18841.     list%@BO:       1027c@%
  18842.     required%@BO:       116bc@%
  18843. Monitor, secondary, for debugging%@BO:       5975f@%
  18844. %@AS@%Monospaced type%@AE@%, as document convention%@BO:        a21c@%
  18845. Moving blocks of memory%@BO:       6f67b@%
  18846. MS-DOS
  18847.    %@AI@%see%@AE@% DOS commands%@NL@%
  18848.  
  18849. %@2@%%@AB@%    N%@AE@%%@EH@%%@NL@%
  18850. NAME statement%@BO:       10e36@%%@BO:       11818@%
  18851. Naming
  18852.   modules%@BO:       11818@%
  18853.   symbol files%@BO:       5ca2f@%%@BO:       5db90@%
  18854. Non-maskable interrupts%@BO:       5b5ec@%
  18855. Notational conventions%@BO:        98c4@%%@BO:        adf2@%
  18856.  
  18857. %@2@%%@AB@%    O%@AE@%%@EH@%%@NL@%
  18858. OEM character set%@BO:       39526@%
  18859. Oil can%@BO:       22c80@%
  18860. Optimization toolsHeap Walker Profiler Shaker
  18861.    %@AI@%see%@AE@% Swap%@NL@%
  18862. Options
  18863.   compiler
  18864.     application development%@BO:        e2b2@%%@BO:        eab9@%
  18865.     dynamic-link library%@BO:        eb88@%%@BO:        f4e1@%
  18866.     memory-model%@BO:        d880@%%@BO:        e148@%
  18867.   LINK command
  18868.     described%@BO:       143a0@%%@BO:       14f7a@%%@BO:       159eb@%%@BO:       15f3f@%
  18869.     options not allowed%@BO:       1622b@%
  18870.     options not recommended%@BO:       16333@%
  18871.   option designator%@BO:       5c450@%
  18872.   RC command line%@BO:       1d234@%
  18873.   Resource Compiler (table)%@BO:       1b0fa@%
  18874.   SYMDEB%@BO:       5a414@%%@BO:       5ab08@%%@BO:       5ba4a@%
  18875. Output device, choosing (Spy)%@BO:       9173f@%
  18876. Output port
  18877.   sending bytes to%@BO:       6ffbd@%
  18878. Output
  18879.   redirecting output commands%@BO:       72e3c@%
  18880.   suspending and restoring%@BO:       5d36a@%
  18881.  
  18882. %@2@%%@AB@%    P%@AE@%%@EH@%%@NL@%
  18883. -P option%@BO:       1bf68@%
  18884. Packed structure%@BO:        d2ab@%
  18885. Paintbrush%@BO:       22c80@%
  18886. Parentheses ( ), as document convention%@BO:        9ea9@%
  18887. PC-DOS
  18888.    %@AI@%see%@AE@% DOS commands%@NL@%
  18889. Period (.), as ASCII value%@BO:       69bfd@%
  18890. Pixels
  18891.   adding rows or columns of%@BO:       3562a@%
  18892.   changing character%@BO:       351b8@%
  18893.   copying to Clipboard%@BO:       36418@%
  18894.   deleting rows or columns of%@BO:       35ae1@%
  18895.   pasting from Clipboard%@BO:       36418@%
  18896.   selecting and changing blocks of%@BO:       35d6a@%
  18897. Plus sign (+), as filename separator%@BO:       13bd5@%
  18898. Preprocessor, defining names for%@BO:       1d44f@%
  18899. PROF.COM program%@BO:       9c31d@%
  18900. Profiler
  18901.   checking if installed%@BO:       9a5ec@%
  18902.   described%@BO:       988c3@%%@BO:       99128@%
  18903.   displaying samples%@BO:       9e0b0@%
  18904.   ensuring compatibility with your system%@BO:       99839@%
  18905.   functions%@BO:       99a5d@%%@BO:       99f55@%%@BO:       9a5ec@%%@BO:       9b123@%%@BO:       9bd38@%
  18906.   managing output (example)%@BO:       9baa9@%
  18907.   sampling
  18908.     real-mode Windows applications%@BO:       9c31d@%%@BO:       9cf0e@%
  18909.     setting rate of%@BO:       9a7eb@%
  18910.     starting and stopping%@BO:       99f55@%
  18911.     Windows 386 enhanced mode applications%@BO:       9c433@%%@BO:       9d187@%
  18912.   starting and stopping%@BO:       9bd38@%
  18913. Program descriptor block (pdb)%@BO:       6a852@%%@BO:       6b878@%%@BO:       6c631@%%@BO:       6eb8a@%%@BO:       7aaa9@%%@BO:       7b8cb@%%@BO:       7c2d6@%%@BO:       85a9e@%
  18914. Program execution%@BO:       703e5@%%@BO:       711d9@%%@BO:       733b5@%
  18915. Program input and output, redirecting%@BO:       72c3a@%
  18916. Programming tools
  18917.    %@AI@%see%@AE@% Tools%@NL@%
  18918. Programs
  18919.   CL%@BO:        c0a9@%
  18920.   RC%@BO:       1a75b@%
  18921.   setting arguments for program execution%@BO:       6fbd9@%
  18922. Prolog (Windows)%@BO:        f19b@%
  18923. Protected mode
  18924.   debugging in. See CodeView for Windows(CVW)%@BO:       3a7d8@%
  18925. Public symbols%@BO:       58d23@%
  18926. Push button control%@BO:       2c94e@%
  18927.  
  18928. %@2@%%@AB@%    Q%@AE@%%@EH@%%@NL@%
  18929. Question mark (?), with commands%@BO:       64f19@%%@BO:       71e51@%
  18930. Quitting SYMDEB%@BO:       60a35@%
  18931. Quotation marks (" "), as document convention%@BO:        ac17@%
  18932.  
  18933. %@2@%%@AB@%    R%@AE@%%@EH@%%@NL@%
  18934. -R option%@BO:       1b18c@%%@BO:       1d352@%
  18935. Radio button control%@BO:       2cb88@%
  18936. Raster fonts%@BO:       3412b@%
  18937. RC command%@BO:       1cdc6@%
  18938. RC Compiler
  18939.   described%@BO:       1a75b@%
  18940. RC compiler
  18941.   options (table)%@BO:       1b0fa@%
  18942. .RC file
  18943.    %@AI@%see%@AE@% Resource script (.RC) files%@NL@%
  18944. Real mode
  18945.   debugging in. See Symbolic Debugger (SYMDEB)%@BO:       56efd@%
  18946. Real-mode Windows applications%@BO:       99128@%%@BO:       99500@%%@BO:       99c88@%%@BO:       9aed0@%%@BO:       9c31d@%
  18947. REC command%@BO:       1aa71@%
  18948. Rectangle control%@BO:       2dc2c@%
  18949. Redirecting program input and output%@BO:       72c3a@%%@BO:       73023@%
  18950. Registers, CPU, displaying contents of%@BO:       706ec@%
  18951. Reporting utility%@BO:       991f6@%%@BO:       9d56d@%
  18952. .RES file
  18953.    %@AI@%see%@AE@% Resource (.RES) files%@NL@%
  18954. Resource (.RES) files%@BO:       1f5b2@%%@BO:       2864e@%
  18955. Resource Compiler
  18956.   described%@BO:       1a75b@%
  18957.   RC command line options%@BO:       1d234@%
  18958. Resource directives%@BO:       18801@%
  18959. Resource editorsDialog Editor Font Editor
  18960.    %@AI@%see%@AE@% SDKPaint%@NL@%
  18961. Resource script (.RC) files
  18962.   .RC extension%@BO:       183d6@%
  18963.   and Dialog Editor%@BO:       2824a@%
  18964.   creating%@BO:       17ccd@%%@BO:       18801@%
  18965.   described%@BO:        908f@%%@BO:       17ccd@%%@BO:       18801@%
  18966.   for applications%@BO:       1a4b3@%
  18967.   resource statements%@BO:       18801@%%@BO:       18971@%
  18968. Resource statements
  18969.    %@AI@%see%@AE@% Resource script (.RC) files%@NL@%
  18970. Resources
  18971.   defining%@BO:       17ccd@%
  18972.   dialog box%@BO:       27307@%
  18973.  
  18974. %@2@%%@AB@%    S%@AE@%%@EH@%%@NL@%
  18975. Sampling
  18976.   buffer%@BO:       99f55@%
  18977.   displaying samples%@BO:       9d56d@%%@BO:       9e0b0@%
  18978.   minimizing loss when sampling buffer fills%@BO:       9c31d@%
  18979.   real-mode Windows applications%@BO:       9c31d@%%@BO:       9cf0e@%
  18980.   setting rate of code%@BO:       9a7eb@%
  18981.   standard-mode Windows applications%@BO:       9cf0e@%
  18982.   starting and stopping%@BO:       99f55@%
  18983.   utilities for%@BO:       99128@%%@BO:       9c31d@%%@BO:       9d187@%
  18984.   Windows 386 enhanced mode applications%@BO:       9c433@%%@BO:       9d116@%
  18985. Scroll bar control%@BO:       2d0b0@%
  18986. SCROLL LOCK key%@BO:       5d36a@%
  18987. SDKPaint
  18988.   .DAT file, described%@BO:       1fcfd@%
  18989.   color palette, described%@BO:       23ddc@%%@BO:       2400c@%
  18990.   converting files%@BO:       217cf@%
  18991.   cursor hotspot
  18992.     defining%@BO:       25ce4@%
  18993.     showing the current%@BO:       25ce4@%
  18994.   described%@BO:       1f1f6@%
  18995.   loading images into%@BO:       229f2@%
  18996.   menu commands (list)%@BO:       20847@%%@BO:       20e65@%
  18997.   tools, described (table)%@BO:       22c80@%
  18998.   transferring images to and from clipboard%@BO:       25f18@%
  18999.   window, described%@BO:       2075c@%
  19000.   working with colors
  19001.     customizing the color palette%@BO:       252ba@%
  19002.     editing colors%@BO:       2549c@%
  19003.     inverse colors%@BO:       25061@%
  19004.     loading a customized palette%@BO:       25a14@%
  19005.     opaque colors%@BO:       248c0@%
  19006.     saving a palette%@BO:       25850@%
  19007.     screen colors%@BO:       24c5c@%
  19008.     true colors%@BO:       23d1a@%
  19009.     types of%@BO:       23a83@%%@BO:       24358@%
  19010. Secondary monitor, setting up for debugging%@BO:       5975f@%
  19011. SEGMENTS statement%@BO:       10ee4@%
  19012. Selected Item Status window%@BO:       2b6ca@%
  19013. Semicolon (
  19014.   ), in SYMDEB command list%@BO:       5c31d@%
  19015. Serial port%@BO:       59210@%
  19016. Setting
  19017.   active symbol maps and/or segments%@BO:       72360@%
  19018.   breakpoint address%@BO:       678e5@%
  19019.   breakpoints%@BO:       5fa48@%%@BO:       68cca@%
  19020.   display mode%@BO:       70bc1@%
  19021.   filenames for load and write commands%@BO:       6fbd9@%
  19022.   program arguments for program execution%@BO:       6fbd9@%
  19023. Shaker
  19024.   allocation granularity%@BO:       980b4@%
  19025.   commands (list)%@BO:       985d7@%
  19026.   described%@BO:       97ad6@%
  19027. SHOWHITS.EXE utility
  19028.   described%@BO:       9d56d@%%@BO:       9e0b0@%
  19029.   sample display%@BO:       9e8db@%
  19030. SKERNEL.EXE file%@BO:       9f376@%
  19031. SKERNEL.SYM file%@BO:       9f58b@%
  19032. Slash (/), as SYMDEB option designator%@BO:       5c450@%
  19033. SMALL CAPTIAL LETTERS, as document convention%@BO:        adf2@%
  19034. Sorting memory objects%@BO:       9510c@%
  19035. Source file, compiling%@BO:        e148@%
  19036. Source lines, displaying%@BO:       711d9@%
  19037. Spy
  19038.   choosing a window%@BO:       91ef5@%
  19039.   choosing options
  19040.     message type%@BO:       91116@%%@BO:       9173f@%
  19041.     output device%@BO:       91834@%
  19042.     output frequency%@BO:       91c4e@%%@BO:       91e07@%
  19043.   described%@BO:       908ec@%
  19044.   starting%@BO:       90c10@%
  19045.   turning on and off%@BO:       92730@%
  19046. Stack frame%@BO:       6eaa0@%%@BO:       6edb8@%%@BO:       8551c@%%@BO:       85f9f@%
  19047. Stack probes%@BO:        e4df@%
  19048. STACK statement%@BO:       12b53@%
  19049. STACKSIZE statement%@BO:       10fe8@%
  19050. Starting applications with Windows%@BO:       5ee16@%
  19051. Statements
  19052.   CODE%@BO:       10443@%
  19053.   DATA%@BO:       1057f@%
  19054.   DESCRIPTION%@BO:       105dd@%
  19055.   EXETYPE WINDOWS%@BO:       11818@%%@BO:       1245f@%
  19056.   EXETYPE%@BO:       106b4@%
  19057.   EXPORTS%@BO:       1090d@%%@BO:       12363@%
  19058.   HEAPSIZE%@BO:       10a02@%
  19059.   IMPORTS%@BO:       10cba@%%@BO:       12b53@%
  19060.   LIBRARY%@BO:       10d94@%%@BO:       121cc@%
  19061.   NAME%@BO:       10e36@%%@BO:       11818@%
  19062.   SEGMENTS%@BO:       10ee4@%
  19063.   STACK%@BO:       12b53@%
  19064.   STACKSIZE%@BO:       10fe8@%
  19065.   STUB%@BO:       11150@%
  19066. Static text control%@BO:       2d402@%
  19067. Static variables%@BO:       5ffac@%
  19068. STUB statement%@BO:       11150@%
  19069. Styles
  19070.   dialog box%@BO:       312b9@%
  19071.   dialog-box control%@BO:       2f18c@%
  19072. SWAP.EXE file%@BO:       9f50c@%
  19073. Swap
  19074.   command line options%@BO:       9fcfe@%
  19075.   described%@BO:       9eeca@%
  19076.   output format%@BO:       a08d5@%%@BO:       a0dd2@%
  19077.   reducing processing time%@BO:       a0582@%
  19078.   starting and stopping%@BO:       9f6bd@%
  19079. .SYM files%@BO:       9f499@%
  19080. Symbol files
  19081.   for assembly-language applications%@BO:       58c05@%
  19082.   for C-language applications%@BO:       5872e@%
  19083.   library%@BO:       5c8b9@%%@BO:       5c8ba@%%@BO:       5c8bb@%
  19084.   loading%@BO:       5c6e6@%
  19085.   naming%@BO:       5ca2f@%%@BO:       5db90@%
  19086.   setting up%@BO:       57720@%
  19087. Symbol maps
  19088.   defined%@BO:       5d8da@%
  19089.   displaying symbols%@BO:       5e808@%
  19090.   listing%@BO:       5ddd1@%
  19091.   opening%@BO:       5dffd@%%@BO:       5e5db@%
  19092.   using symbols from%@BO:       5e67d@%
  19093. Symbolic Debugger (SYMDEB)
  19094.   and IBM-compatible computers%@BO:       5bf81@%
  19095.   application development option for%@BO:        e4df@%
  19096.   arguments
  19097.     address (list)%@BO:       65577@%%@BO:       66362@%
  19098.     command (list)%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  19099.   commands
  19100.     canceling current%@BO:       5d71a@%
  19101.     command options%@BO:       59ded@%%@BO:       5b2a3@%%@BO:       5c31d@%
  19102.     executing at startup%@BO:       5c31d@%
  19103.     list of%@BO:       60f40@%%@BO:       62ac5@%
  19104.     redirect input and output%@BO:       73023@%
  19105.     set source mode%@BO:       70bc1@%
  19106.   debugging terminal
  19107.     remote%@BO:       59210@%
  19108.     secondary%@BO:       59bc7@%
  19109.   described%@BO:       57275@%
  19110.   displaying
  19111.     application source statements%@BO:       6069c@%
  19112.     variables%@BO:       5ffac@%
  19113.   expressions (list)%@BO:       665df@%
  19114.   for Assembly-language applications%@BO:       58c05@%
  19115.   for C-language applications%@BO:       5872e@%
  19116.   loading macro definitions%@BO:       5b2a3@%
  19117.   messages
  19118.     fatal exit%@BO:       60d2e@%
  19119.     memory-allocation%@BO:       5f1e5@%
  19120.   option designator%@BO:       5c450@%
  19121.   option%@BO:       5a414@%%@BO:       5ab08@%%@BO:       5ba4a@%
  19122.   passing control to command.com%@BO:       733b5@%
  19123.   preparing symbol files for%@BO:       57720@%
  19124.   quitting%@BO:       60a35@%
  19125.   redirecting output from%@BO:       5a6e4@%
  19126.   returning control to DOS%@BO:       704d6@%
  19127.   setting
  19128.     breakpoints%@BO:       5fa48@%
  19129.     memory-allocation reporting level%@BO:       5b071@%
  19130.   special keys%@BO:       5d177@%
  19131.   specifying symbol files%@BO:       5c6e6@%
  19132.   starting applications%@BO:       5ee16@%
  19133.   starting%@BO:       59ca2@%
  19134.   suspending and restoring output%@BO:       5d36a@%
  19135.   symbol maps
  19136.     opening%@BO:       5e5db@%
  19137.     using symbols from%@BO:       5e67d@%
  19138.     working with%@BO:       5d8da@%%@BO:       5ddd1@%%@BO:       5dffd@%
  19139.   terminating%@BO:       704d6@%
  19140.   use of, with Windows%@BO:       59ded@%%@BO:       5a39a@%%@BO:       5ba4a@%%@BO:       5c8bb@%%@BO:       5cee3@%%@BO:       5d71a@%
  19141. Symbolic Debugger(SYMDEB)
  19142.   debugging terminal
  19143.     secondary%@BO:       5975f@%
  19144. Symbols
  19145.   declaring public%@BO:       58d23@%
  19146.   displaying%@BO:       5e808@%
  19147. SYS REQ key%@BO:       5d4d8@%
  19148.  
  19149. %@2@%%@AB@%    T%@AE@%%@EH@%%@NL@%
  19150. Tab stop, setting for dialog-box control%@BO:       308aa@%
  19151. Task descriptor block%@BO:       6b878@%%@BO:       7b8cb@%
  19152. Task queue, displaying information about%@BO:       6b6a7@%%@BO:       7b6ea@%
  19153. Terminal
  19154.    remote, for debugging%@BO:       5929c@%
  19155.    secondary, for debugging%@BO:       5975f@%
  19156. Terminating SYMDEB%@BO:       704d6@%
  19157. Text editors
  19158.   creating applications%@BO:        8e6a@%
  19159.   creating resource script files%@BO:       18600@%
  19160. Text, changing%@BO:       2f498@%
  19161. Toolbox
  19162.   described%@BO:       2b461@%
  19163.   enabling%@BO:       2e053@%
  19164. Tools
  19165.    %@AI@%see%@AE@% Help.%@NL@%
  19166.   compilers. See C Compiler; Resource Compiler%@BO:        7be6@%
  19167.   debugging tools. See CodeView for Windows ; Spy; Symbolic Debugger%@BO:        7be6@%
  19168.   linkers. See Linker%@BO:        7be6@%
  19169.   optimization tools. See Heap Walker; Profiler; Shaker; Swap%@BO:        7be6@%
  19170.   resource editors. See Dialog Editor; Font Editor; SDKPaint%@BO:        7be6@%
  19171. Turning off stack probes%@BO:        eab9@%
  19172.  
  19173. %@2@%%@AB@%    U%@AE@%%@EH@%%@NL@%
  19174. Underscore (_), with commands%@BO:       64f19@%
  19175. User library, symbol files%@BO:       5c8bb@%
  19176. User-defined resource statement%@BO:       18971@%
  19177. Utilities
  19178.    %@AI@%see%@AE@% Tools%@NL@%
  19179.  
  19180. %@2@%%@AB@%    V%@AE@%%@EH@%%@NL@%
  19181. -V option%@BO:       1e677@%
  19182. Variable-pitch fonts%@BO:       34e91@%%@BO:       37dcc@%
  19183. Variables
  19184.   displaying%@BO:       5ffac@%
  19185.   static%@BO:       5ffac@%
  19186. Vector fonts%@BO:       3412b@%
  19187. Vertical bar (|), as document convention%@BO:        a9f4@%
  19188. Virtual breakpoint, defined%@BO:       68bec@%
  19189. VPROD.386 device driver%@BO:       9d187@%
  19190.  
  19191. %@2@%%@AB@%    W%@AE@%%@EH@%%@NL@%
  19192. Walking the heap%@BO:       942e4@%
  19193. Width, font%@BO:       36814@%%@BO:       374f5@%
  19194. Wildcard character (*), with SYMDEB commands%@BO:       64f19@%%@BO:       7225b@%
  19195. Window, monitoring messages to%@BO:       91ef5@%
  19196. Windows 386 enhanced mode applications
  19197.   using PROFILER with%@BO:       99128@%%@BO:       99500@%%@BO:       99c88@%
  19198.   Using PROFILER with%@BO:       9a6dc@%
  19199.   using PROFILER with%@BO:       9d187@%
  19200. Windows 386 mode applications
  19201.   using PROFILER with%@BO:       9aed0@%
  19202. Windows applications
  19203.   compiler option, example%@BO:        d712@%
  19204.   creating%@BO:        8d63@%
  19205. Windows enhanced mode applications
  19206.   using PROFILER with%@BO:       9c433@%
  19207. Windows version stamp%@BO:       1a929@%
  19208. Windows
  19209.   epilog%@BO:        f19b@%
  19210.   fatal exit message%@BO:       60d2e@%
  19211.   import libraries%@BO:       12f54@%
  19212.   prolog%@BO:        f19b@%
  19213. WinMain function%@BO:       5fb2e@%
  19214. Writing
  19215.   to logical records on disk%@BO:       7173b@%
  19216.   to named files%@BO:       7173b@%
  19217.  
  19218. %@2@%%@AB@%    X%@AE@%%@EH@%%@NL@%
  19219. -X option%@BO:       1b75a@%%@BO:       1e3bf@%
  19220.  
  19221.