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 @%Convention                        Description of Convention%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%Bold text%@AE@%                         Bold text indicates a specific term or                                   punctuation mark intended to be used                                   literally: language key words or                                   functions (such as %@AB@%EXETYPE%@AE@% or %@AB@%%@AE@%                                  %@AB@%CreateWindow%@AE@%), DOS commands, and                                   command-line options (such as %@AB@%/Zi%@AE@%). You                                   must type these terms and punctuation                                   marks exactly as shown. However, the use                                  of uppercase or lowercase letters is not                                  always significant. For instance, you                                   can invoke the linker by typing either %@AB@%%@AE@%                                  %@AB@%LINK%@AE@%, %@AB@%link%@AE@%, or %@AB@%Link%@AE@% at the DOS prompt. %@CR:C6A00000018 @% %@CR:C6A00000019 @%( )                               In syntax statements, parentheses                                   enclose one or more parameters that you                                   pass to a function. %@CR:C6A00000020 @% %@CR:C6A00000021 @% %@CR:C6A00000022 @% %@AI@%Italic text%@AE@%                       Italic text indicates a placeholder; you                                  are expected to provide the actual value.                                  For example, the following syntax for                                   the %@AB@%Set-%@AE@%                                  %@AB@%CursorPos%@AE@% function indicates that you                                   must substitute values for the %@AI@%X%@AE@% and %@AI@%Y%@AE@%                                   coordinates, separated by a comma: %@AB@%%@AE@%                                  %@AB@%SetCursorPos(%@AE@%%@AI@%X, Y%@AE@%%@AB@%)%@AE@% %@CR:C6A00000023 @% %@CR:C6A00000024 @% %@AS@%Monospaced type%@AE@%                   Code examples are displayed in a                                   nonproportional typeface. %@CR:C6A00000025 @% %@CR:C6A00000026 @% %@AS@%BEGIN%@RR@% .%@RR@% .%@RR@% .%@RR@%END%@AE@%                    A vertical ellipsis in a program example                                  indicates that a portion of the program                                   is omitted. %@CR:C6A00000027 @% %@CR:C6A00000028 @%. . .                             An ellipsis following an item indicates                                   that more items having the same form may                                  appear. In the following example, the                                   horizontal ellipsis indicates that you                                   can specify more than one %@AI@%breakaddress%@AE@%                                   value for the %@AB@%g%@AE@% command:                                                                     %@AB@%g%@AE@% «=%@AI@%startaddress%@AE@%» «%@AI@%breakaddress%@AE@%»...%@CR:C6A00000029 @%%@CR:C6A00000030 @%%@CR:C6A00000031 @%« »                               Double brackets enclose optional fields                                   or parameters in command lines and                                   syntax statements. In the following                                   example, %@AI@%option%@AE@% and %@AI@%executable-file%@AE@% are                                   optional parameters of the %@AB@%RC%@AE@% command: %@CR:C6A00000032 @% %@CR:C6A00000033 @%                                  %@CR:C6A00000034 @% %@CR:C6A00000035 @%                                  %@AB@%RC%@AE@% «%@AI@%option%@AE@%» %@AI@%filename%@AE@% «%@AI@%executable-file%@AE@%»|                                 A vertical bar indicates that you may                                   enter one of the entries shown on either                                  side of the bar. The following                                   command-line syntax illustrates the use                                   of a vertical bar:                                   %@CR:C6A00000036 @% %@CR:C6A00000037 @% %@CR:C6A00000038 @%%@AB@%%@AE@%                                  %@AB@%DB%@AE@% «%@AI@%address%@AE@% | %@AI@%range%@AE@%»                                  The bar indicates that following the %@AB@%%@AE@%                                  %@AB@%Dump Bytes%@AE@% command (%@AB@%DB%@AE@%), you can specify                                  either an %@AI@%address%@AE@% or a %@AI@%range%@AE@%. " "                               Quotation marks set off terms defined in                                  the text. %@CR:C6A00000039 @% %@CR:C6A00000040 @% %@CR:C6A00000041 @%{ }                               Curly braces indicate that you must                                   specify one of the enclosed items.%@CR:C6A00000042 @% %@CR:C6A00000043 @% %@CR:C6A00000044 @% %@CR:C6A00000045 @%SMALL CAPITAL LETTERS             Small capital letters indicate the names                                  of keys and key sequences, such as: ALT                                   + SPACEBAR %@CR:C6A00000046 @% %@CR:C6A00000047 @% %@CR:C6A00000048 @% %@CR:C6A00000049 @%%@TE:  75  5380 02 34 42 @%
  788.  
  789.  
  790. %@4@%%@AB@%Microsoft Windows Software Development Kit Documentation Set%@AE@%%@EH@%%@NL@%
  791.  
  792. Throughout this documentation set "SDK" refers specifically to the Microsoft
  793. Windows Software Development Kit and its contents. The SDK includes the
  794. following manuals:  %@NL@%
  795.  
  796. %@AB@%Title%@AE@%                             %@AB@%Contents%@AE@%
  797. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  798. %@AI@%Installation and%@AE@%                  Provides an orientation to the SDK, 
  799. %@AI@%Update Guide %@AE@%                     explains how to install the SDK software,
  800.                                   and highlights the changes for version 
  801.                                   3.0.%@AI@%%@AE@%
  802.  
  803. %@AI@%Guide to Programming%@AE@%              Explains how to write Windows 
  804.                                   applications, and provides sample 
  805.                                   applications that you can use as 
  806.                                   templates for writing your own programs.
  807.                                   The %@AI@%Guide to Programming%@AE@% also addresses 
  808.                                   some advanced Windows programming 
  809.                                   topics.
  810.  
  811. %@AI@%Tools%@AE@%                             Explains how to use the 
  812.                                   software-development tools you'll need 
  813.                                   to build Windows applications, such as 
  814.                                   debuggers and specialized SDK editors.
  815.  
  816. %@AI@%Reference%@AE@%                         Is a comprehensive guide to all the 
  817.                                   details of the Microsoft Windows 
  818.                                   application program interface (API). The
  819.                                   %@AI@%Reference%@AE@% lists in alphabetical order 
  820.                                   all the current functions, messages, and
  821.                                   data structures of the API, and provides
  822.                                   extensive overviews on how to use the 
  823.                                   API.
  824.  
  825. %@AI@%System Application Architecture,%@AE@%  Provides guidelines and recommendations 
  826. %@AI@%Common User Access: Advanced %@AE@%     for writing programs that appear and act
  827. %@AI@%Interface Design Guide%@AE@%            consistently like other Microsoft 
  828.                                   Windows applications. 
  829.  
  830.  
  831. %@2@%%@CR:C6A00000050 @%%@AB@%Summary%@AE@%%@EH@%%@NL@%
  832.  
  833. This introductory chapter explained the organization of %@AI@%Tools%@AE@%, and briefly
  834. described the tools and processes you use to build Windows applications.  %@NL@%
  835.  
  836. For more information about building Windows applications, see %@AI@%Guide to
  837. %@AI@%Programming%@AE@%.  %@NL@%
  838.  
  839.  
  840.  
  841.  
  842.  
  843.  
  844. %@CR:C6A-Part 01 @%%@1@%%@AB@%PART I  Compilers and Linkers%@AE@%%@EH@%%@NL@%
  845. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  846.  
  847. Part 1 describes how to use the C Compiler to compile your C-language source
  848. code modules, the linker to link your compiled or assembled source files
  849. with your Microsoft Windows and C run-time libraries, and the Resource
  850. Compiler to produce an executable Windows application.  %@NL@%
  851.  
  852.  
  853.  
  854.  
  855.  
  856.  
  857. %@CR:C6A00010001 @%%@1@%%@AB@%Chapter 1  Compiling Applications: The C Compiler%@AE@%%@EH@%%@NL@%
  858. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  859.  
  860. Many Microsoft Windows applications are written in the C programming
  861. language and are compiled using the Microsoft C Compiler (%@AB@%CL%@AE@%). This chapter
  862. describes the following topics:  %@NL@%
  863.  
  864.  
  865.   ■   A brief overview of how to write C-language Windows applications%@NL@%
  866.  
  867.   ■   How to use the Microsoft C Compiler to compile C-language Windows
  868.       applications%@NL@%
  869.  
  870.  
  871. This chapter deals only with the special compilation requirements of
  872. C-language Windows applications. For complete information on using the C
  873. Compiler, see the Microsoft C documentation. For information on writing
  874. Windows applications using the C language, see the %@AI@%Guide to Programming%@AE@%.  %@NL@%
  875.  
  876.  
  877. %@2@%%@CR:C6A00010002 @%%@AB@%1.1  Compiling C-Language Windows Applications%@AE@%%@EH@%%@NL@%
  878.  
  879. To compile a C-language Windows application, use the Microsoft C Compiler.
  880. The compiler comes with Microsoft C; it is not included in the Microsoft
  881. Windows Software Development Kit (SDK). Microsoft Windows requires version
  882. 5.1 or later of Microsoft C, or version 2.0 or later of Microsoft QuickC
  883. (R). To start the Microsoft C Compiler, use the %@AB@%CL%@AE@% command. Table 1.1, "C
  884. Compiler Options for Windows Applications," lists and describes the options
  885. commonly used for compiling Windows applications.%@CR:C6A00010003 @%%@CR:C6A00010004 @%%@CR:C6A00010005 @%%@CR:C6A00010006 @%%@CR:C6A00010007 @%%@NL@%
  886.  
  887. Table 1.1  C Compiler Options for Windows Applications
  888.  
  889. %@TH:  10   609 02 08 34 34 @%Option  What It Does                      When to Use It%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%-AC%@AE@%     Compiles the application for the  Used when an application has one        compact memory model.             code segment but multiple data                                           segments.%@AB@%-AL%@AE@%     Compiles the application for the  Used when an application has         large memory model.               multiple segments for both code                                           and data.%@TE:  10   609 02 08 34 34 @%
  890.  
  891. Table 1.1  C Compiler Options for Windows Applications (continued)
  892.  
  893. %@TH:  65  3904 02 08 34 34 @%Option  What It Does                      When to Use It%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%-AM%@AE@%     Compiles the application for the  Used when an application has         medium memory model.              multiple code segments but one                                           data segment. Can also be used                                           to create applications using the                                          mixed memory model. See %@AI@%Guide to%@AE@%                                          %@AI@%Programming%@AE@% for a description of                                          the mixed memory model.%@AB@%-AS%@AE@%     Compiles the application for the  Used when an application has         small memory model.               only one code and one data                                           segment. Can also be used to                                           create applications using the                                           mixed memory model.%@AB@%-Aw%@AE@%     Ensures that pointers receive     Used when compiling a         their proper segment addresses    dynamic-link library (DLL).        when cast to 32-bit addresses.    %@AB@%-c%@AE@%      Compiles only.                    Required if you have more than                                           one C source module and you want                                          to separate linking from                                           compiling.%@AB@%-Gs%@AE@%     Removes stack probes, thereby     Recommended for all Windows         improving performance.            applications after the                                           development process is complete.%@AB@%-Gw%@AE@%     Adds the Windows prolog and       Required for all Windows source         epilog to all functions.          code modules. (May be used for                                           source code modules that do not                                           contain exported (callback)                                           functions; but -%@AB@%GW%@AE@% is                                           recommended in this case.)%@AB@%-GW%@AE@%     Substitutes a reduced Windows     Recommended for Windows source         prolog and epilog to functions    code modules that do not contain        that are far calls within the     exported or callback functions.         application. (Available only              with C version 6.0 and later.)    %@AB@%-Os%@AE@%     Optimizes for code size instead   Recommended for all Windows         of speed.                         source code modules.%@AB@%-Ow%@AE@%     Relaxes alias checking within     Recommended instead of         certain constraints imposed by    non-Windows %@AB@%-Oa%@AE@% relax-alias-        the Windows environment.          checking option.        (Available only with C version             6.0 and later.)                   %@AB@%-Zd%@AE@%     Creates an object file for use    Required for debugging the         with the Symbolic Debugger (%@AB@%%@AE@%      source-code module using %@AB@%SYMDEB%@AE@%         %@AB@%SYMDEB%@AE@%) or the 80386 Debugger (%@AB@%%@AE@%   or %@AB@%WDEB386%@AE@%.        %@AB@%WDEB386%@AE@%).                         %@AB@%-Zi%@AE@%     Creates an object file for use    Required for debugging the         with CodeView for Windows (%@AB@%CVW%@AE@%).  source-code module using %@AB@%CVW%@AE@%.%@AB@%-Zp%@AE@%     Packs structures on single-byte   Required for all Windows source         boundaries.                       code modules that use structures.                                          %@CR:C6A00010008 @%%@CR:C6A00010009 @% %@CR:C6A00010010 @%%@AB@% %@AE@%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  65  3904 02 08 34 34 @%
  894.  
  895. In addition to the options in Table 1.1, "C Compiler Options for Windows
  896. Applications," which most Windows applications use, you can supply other
  897. compiler options as necessary. Section 1.2, "Compiler Options," describes
  898. more fully many of the options you may want to use.%@CR:C6A00010011 @%%@CR:C6A00010012 @%%@CR:C6A00010013 @%%@CR:C6A00010014 @%%@NL@%
  899.  
  900. In the following example, the source file TEST.C is compiled using the
  901. recommended %@AB@%CL%@AE@% options for a small-model Windows application source file
  902. during application development.  %@NL@%
  903.  
  904. %@AS@%  CL -c -Os -Gw -AS -Zdp TEST.C%@AE@%
  905.  
  906. With these options, the compiler suppresses linking (%@AB@%-c%@AE@%), optimizes for size
  907. (%@AB@%-Os%@AE@%), adds the Windows prolog and epilog to exported functions (%@AB@%-Gw%@AE@%), uses
  908. the small memory model (%@AB@%-AS%@AE@%), provides line-number information (%@AB@%-Zd%@AE@%), and
  909. packs structures (%@AB@%-Zp%@AE@%).%@CR:C6A00010015 @%%@NL@%
  910.  
  911.  
  912. %@2@%%@CR:C6A00010016 @%%@AB@%1.2  Compiler Options%@AE@%%@EH@%%@NL@%
  913.  
  914. This section describes some compiler options you may want to use when
  915. compiling a Windows application. For a complete description of the C
  916. Compiler options, see the %@AI@%Microsoft C Optimizing Compiler User's Guide.%@AE@%  %@NL@%
  917.  
  918. This section describes the following types of compiler options:%@CR:C6A00010017 @%%@CR:C6A00010018 @%%@NL@%
  919.  
  920.  
  921.   ■   Memory-model options, which let you compile medium, compact, and
  922.       large-model applications. (By default, the compiler uses the small
  923.       memory model.)%@NL@%
  924.  
  925.   ■   Options you may want to set during application development.%@NL@%
  926.  
  927.   ■   Options for compiling dynamic-link libraries.
  928. %@NL@%
  929.  
  930.  
  931.  
  932. %@3@%%@CR:C6A00010019 @%%@AB@%1.2.1  Memory-Model Options%@AE@%%@EH@%%@NL@%
  933.  
  934. Windows applications can use the small, medium, compact, or large memory
  935. model. (Windows does not support the huge memory model.)%@CR:C6A00010020 @%%@CR:C6A00010021 @%%@NL@%
  936.  
  937. You specify a programming model by supplying the appropriate compiler option
  938. on the %@AB@%CL%@AE@% command line when you compile the application source files. You
  939. base your choice on the application's need for data and code. The
  940. memory-model compiler options are:  %@NL@%
  941.  
  942. %@AB@%Memory Model%@AE@%                      %@AB@%Compiler Option%@AE@%
  943. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  944. Small                             %@AB@%-AS%@AE@%
  945.  
  946. Medium                            %@AB@%-AM%@AE@%
  947.  
  948. Compact                           %@AB@%-AC%@AE@%
  949.  
  950. Large                             %@AB@%-AL%@AE@%
  951.  
  952. The compact and large memory models are not recommended for Windows
  953. applications, unless you're creating a Windows application by porting an
  954. existing compact or large-model application from the DOS environment. This
  955. is because Windows requires that all data segments of compact and
  956. large-model applications be fixed, and Windows can run only one instance of
  957. an application with far data segments. The following statement must be in
  958. the module-definition (.DEF) file of any compact or large-model application:
  959. %@NL@%
  960.  
  961. %@AS@%  DATA FIXED%@AE@%
  962.  
  963. When compiling medium, compact, and large-model source files for Windows
  964. applications, you can specify the names of the code and data segments to
  965. which each source belongs. Use the %@AB@%-NT%@AE@% option to specify code segments; use
  966. the %@AB@%-ND%@AE@% option for data segments. If you do not use these options, the C
  967. Compiler assumes that the source belongs to the standard code and data
  968. segments, _TEXT and _DATA.%@CR:C6A00010022 @%%@CR:C6A00010023 @%%@NL@%
  969.  
  970. For more information on memory models, see %@AI@%Guide to Programming%@AE@% and the
  971. appropriate Microsoft C documentation.  %@NL@%
  972.  
  973.  
  974. %@3@%%@CR:C6A00010024 @%%@AB@%1.2.2  Application Development Options%@AE@%%@EH@%%@NL@%
  975.  
  976. To make application development and debugging easier, the C Compiler
  977. includes options for the following:%@CR:C6A00010025 @%%@NL@%
  978.  
  979.  
  980.   ■   Provides line-number information so you can display program lines%@NL@%
  981.  
  982.   ■   Lets you turn off optimization to make debugging easier%@NL@%
  983.  
  984.   ■   Lets you disable stack probes 
  985. %@NL@%
  986.  
  987.  
  988.  
  989. %@4@%%@AB@%Preparing for Debugging%@AE@%%@EH@%%@NL@%
  990.  
  991. Windows applications written in C are easier to debug if the compiler adds
  992. debugging information to the object file. You can then use the Symbolic
  993. Debugger (%@AB@%SYMDEB%@AE@%) utility or CodeView for Windows (%@AB@%CVW%@AE@%) to help you debug
  994. your application.%@CR:C6A00010026 @%%@CR:C6A00010027 @%%@CR:C6A00010028 @%%@CR:C6A00010029 @%%@CR:C6A00010030 @%%@NL@%
  995.  
  996. To add debugging information used by %@AB@%SYMDEB%@AE@%, compile your application  with
  997. the %@AB@%-Zd%@AE@% option. This option produces an object file containing line-number
  998. records corresponding to the line numbers of the source file, as well as
  999. global-symbol information which %@AB@%SYMDEB%@AE@% uses. For more information on %@AB@%SYMDEB%@AE@%,
  1000. see Chapter 8, "Debugging in Real Mode: Symbolic Debugger."  %@NL@%
  1001.  
  1002. To add debugging information used by %@AB@%CVW%@AE@%, use the %@AB@%-Zi%@AE@% option when you
  1003. compile. The resulting object file contains full symbolic-debugging
  1004. information, including local function-variable information, full
  1005. symbol-table information, and line numbers. For more information on %@AB@%CVW%@AE@%, see
  1006. Chapter 7, "Debugging in Protected Mode: CodeView for Windows."  %@NL@%
  1007.  
  1008.  
  1009. %@4@%%@AB@%Turning Off Optimization%@AE@%%@EH@%%@NL@%
  1010.  
  1011. While an application is in development, you may want to turn off optimizing
  1012. to make debugging easier. (By default, the C Compiler optimizes for speed.)
  1013. To turn off program optimization, use the %@AB@%-Od%@AE@% option.%@CR:C6A00010031 @%%@NL@%
  1014.  
  1015.  
  1016. %@4@%%@AB@%Using Stack Probes%@AE@%%@EH@%%@NL@%
  1017.  
  1018. By default, the compiler provides stack probes. Stack probes can be useful
  1019. during application development, but they can cause a slight performance
  1020. degradation. When the application-development process is complete, it's a
  1021. good idea to turn off the stack probes by using the %@AB@%-Gs%@AE@% option.%@CR:C6A00010032 @%%@CR:C6A00010033 @%%@NL@%
  1022.  
  1023.  
  1024. %@3@%%@CR:C6A00010034 @%%@AB@%1.2.3  Dynamic-Link Library Options%@AE@%%@EH@%%@NL@%
  1025.  
  1026. When compiling DLLs, you should specify the following compiler options:%@CR:C6A00010035 @%%@NL@%
  1027.  
  1028.  
  1029.   ■   The %@AB@%-Gw%@AE@% option, to ensure that exported functions receive the Windows
  1030.       prolog and epilog. (For modules that do not contain exported
  1031.       functions, you can use the %@AB@%-GW%@AE@% option instead to reduce the size of
  1032.       the prolog and epilog.)%@NL@%
  1033.  
  1034.   ■   The %@AB@%-Aw%@AE@% option, to ensure that pointers receive their proper segment
  1035.       addresses when cast to 32-bit addresses. The %@AB@%-Aw%@AE@% option must follow or
  1036.       be combined with the %@AB@%-AC%@AE@%, %@AB@%-AL%@AE@%, %@AB@%-AM%@AE@%, or %@AB@%-AS%@AE@% option, as appropriate.%@NL@%
  1037.  
  1038.  
  1039. Dynamic-link libraries written in C have slightly different requirements
  1040. than do Windows applications written in C. Unlike Windows applications,
  1041. dynamic-link libraries are not executable programs; although a library is
  1042. loaded, it does not execute directly. Instead, the code in a library is made
  1043. available to all applications that need to use it, and an application can
  1044. execute a portion of the library by calling one of the exported functions in
  1045. the library.%@CR:C6A00010036 @%%@CR:C6A00010037 @%%@NL@%
  1046.  
  1047. Like exported (callback) functions in Windows applications, exported
  1048. functions in libraries must have the Windows prolog and epilog. This means
  1049. that, for dynamic-link libraries, the %@AB@%-Gw%@AE@% option is required. Exported
  1050. functions should be listed in the library's module-definition file. See
  1051. Chapter 2, "Linking Applications: The Linker," for information about
  1052. module-definition files.%@CR:C6A00010038 @%%@CR:C6A00010039 @%%@CR:C6A00010040 @%%@CR:C6A00010041 @%%@CR:C6A00010042 @%%@CR:C6A00010043 @%%@CR:C6A00010044 @%%@CR:C6A00010045 @%%@CR:C6A00010046 @%%@CR:C6A00010047 @%%@NL@%
  1053.  
  1054. You should compile dynamic-link libraries with the %@AB@%-Aw%@AE@% option; this ensures
  1055. that pointers receive their proper segment addresses when cast to 32-bit
  1056. addresses. Libraries always use the stack of the calling application for
  1057. parameters and local variables. This means that the values of the DS and SS
  1058. registers are not equal when the library is executed. Because the C Compiler
  1059. generates code that assumes that the DS and SS registers are equal,
  1060. dynamic-link libraries may fail unless compiled with the %@AB@%-Aw%@AE@% option. This
  1061. option directs the compiler to generate code that does not assume that the
  1062. registers are equal.%@CR:C6A00010048 @%%@CR:C6A00010049 @%%@NL@%
  1063.  
  1064. The following example shows the recommended options for compiling libraries:
  1065. %@NL@%
  1066.  
  1067. %@AS@%  CL -c -AMw -Gsw -Os TESTLIB.C%@AE@%
  1068.  
  1069.  
  1070. %@2@%%@CR:C6A00010050 @%%@AB@%1.3  Summary%@AE@%%@EH@%%@NL@%
  1071.  
  1072. The Microsoft C Compiler compiles C-language Windows applications. For more
  1073. information about using the compiler, see the Microsoft C documentation.  %@NL@%
  1074.  
  1075.  
  1076.  
  1077.  
  1078.  
  1079.  
  1080. %@CR:C6A00020001 @%%@1@%%@AB@%Chapter 2  Linking Applications: The Linker%@AE@%%@EH@%%@NL@%
  1081. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1082.  
  1083. You create executable Microsoft Windows applications and libraries by
  1084. linking your compiled source files using the linker (%@AB@%LINK%@AE@%). %@AB@%LINK%@AE@% takes your
  1085. compiled sources, a list of libraries, and a module-definition file, and
  1086. creates a file that you can load and run with Windows.%@CR:C6A00020002 @%%@CR:C6A00020003 @%%@CR:C6A00020004 @%%@CR:C6A00020005 @%%@CR:C6A00020006 @%%@NL@%
  1087.  
  1088. %@AB@%LINK%@AE@% comes with Microsoft C; it is not included in the Microsoft Windows
  1089. Software Development Kit (SDK). Windows requires version 5.1 or later of
  1090. Microsoft C, or version 2.0 or later of Microsoft QuickC.%@CR:C6A00020007 @%%@CR:C6A00020008 @%%@CR:C6A00020009 @%%@NL@%
  1091.  
  1092. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1093. IMPORTANT
  1094.  
  1095. %@AI@%Microsoft C version 5.1 and Microsoft QuickC versions 2.0 and later include
  1096. %@AI@%two linkers. If you are developing your application with one of these
  1097. %@AI@%versions, use the segmented-executable linker.%@AE@%
  1098. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1099.  
  1100. Microsoft C version 6.0 includes %@AB@%ILINK%@AE@%, the incremental linker. This linker
  1101. does not relink files that have already been linked and that have not
  1102. changed. %@AB@%ILINK%@AE@% also directly creates .SYM files for use by the Symbolic
  1103. Debugger (%@AB@%SYMDEB%@AE@%). %@AB@%ILINK%@AE@% also uses the .SYM files it creates to avoid
  1104. unnecessary relinking. For more information on %@AB@%ILINK%@AE@%, see the Microsoft C
  1105. 6.0 documentation.  %@NL@%
  1106.  
  1107. This chapter describes the following topics:  %@NL@%
  1108.  
  1109.  
  1110.   ■   Module-definition files%@NL@%
  1111.  
  1112.   ■   The difference between applications' and libraries' module-definition
  1113.       files%@NL@%
  1114.  
  1115.   ■   How to use %@AB@%LINK%@AE@% to link Windows applications%@NL@%
  1116.  
  1117.  
  1118.  
  1119. %@2@%%@CR:C6A00020010 @%%@AB@%2.1  Creating Module-Definition Files%@AE@%%@EH@%%@NL@%
  1120.  
  1121. Every Windows application and library must have a "module-definition file."
  1122. A module-definition file is an ordinary text file that defines the
  1123. application's contents and system requirements. When you link a Windows
  1124. application, the linker uses the information in the application's
  1125. module-definition file to determine how to set up the application (for
  1126. example, how large to make the application's default stack, or whether to
  1127. mark a particular code segment as moveable in memory).  %@NL@%
  1128.  
  1129. You create a module-definition file using an ordinary ASCII text editor. The
  1130. file can have any filename you want, but must have the filename extension
  1131. %@AI@%.%@AE@%DEF.  %@NL@%
  1132.  
  1133. Every module-definition (.DEF) file contains one or more statements. Each
  1134. statement defines a specific attribute of the application or library, such
  1135. as its module name, the number and type of program segments, or the number
  1136. and names of exported and imported functions.%@CR:C6A00020011 @%%@CR:C6A00020012 @%%@CR:C6A00020013 @%%@NL@%
  1137.  
  1138. Windows module-definition files can contain the following statements:%@CR:C6A00020014 @%%@CR:C6A00020015 @%%@CR:C6A00020016 @%%@NL@%
  1139.  
  1140. %@AB@%Statement%@AE@%                         %@AB@%Usage%@AE@%
  1141. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1142. %@AB@%CODE%@AE@%                              Defines code-segment attributes, such as
  1143.                                   whether or not a segment is moveable in 
  1144.                                   memory. %@CR:C6A00020017 @%%@CR:C6A00020018 @%
  1145.  
  1146. %@AB@%DATA%@AE@%                              Defines data-segment attributes, such as
  1147.                                   whether there are single or multiple 
  1148.                                   data segments, and whether a segment is 
  1149.                                   moveable in memory. %@CR:C6A00020019 @%%@CR:C6A00020020 @%
  1150.  
  1151. %@AB@%DESCRIPTION%@AE@%                       Briefly describes the module. %@CR:C6A00020021 @% %@CR:C6A00020022 @%
  1152.  
  1153. %@AB@%EXETYPE%@AE@%                           Tells %@AB@%LINK%@AE@% what type of .EXE header to 
  1154.                                   use (Windows or OS/2).%@CR:C6A00020023 @%%@CR:C6A00020024 @%
  1155.  
  1156. %@AB@%EXPORTS%@AE@%                           Lists functions in this module that will
  1157.                                   be called by Windows or other 
  1158.                                   applications. For example, an 
  1159.                                   application's .DEF file always lists the
  1160.                                   application's window functions, since 
  1161.                                   Windows must call these functions in 
  1162.                                   order for the application to work
  1163.                                   properly. %@CR:C6A00020025 @%%@CR:C6A00020026 @%
  1164.  
  1165. %@AB@%HEAPSIZE%@AE@%                          Specifies the default size of the local 
  1166.                                   heap in bytes. The recommended size is 
  1167.                                   5K.%@CR:C6A00020027 @%%@CR:C6A00020028 @%
  1168.  
  1169. %@AB@%IMPORTS%@AE@%                           Lists other applications' functions that
  1170.                                   this module calls. For example, if you 
  1171.                                   wrote a library of utility functions, an
  1172.                                   application would have to import those 
  1173.                                   functions before it could use them. (You
  1174.                                   can also import library functions using 
  1175.                                   the %@AB@%IMPLIB%@AE@% utility. See Section 2.2, 
  1176.                                   "Importing Dynamic-Link Libraries," for 
  1177.                                   more information.) %@CR:C6A00020029 @%%@CR:C6A00020030 @%
  1178.  
  1179. %@AB@%LIBRARY%@AE@%                           Specifies the module name of a 
  1180.                                   dynamic-link
  1181.                                   library. %@CR:C6A00020031 @%%@CR:C6A00020032 @%
  1182.  
  1183. %@AB@%NAME%@AE@%                              Specifies the module name of an 
  1184.                                   application. %@CR:C6A00020033 @% %@CR:C6A00020034 @%
  1185.  
  1186. %@AB@%SEGMENTS%@AE@%                          Specifies the attributes of additional 
  1187.                                   code or data segments. %@CR:C6A00020035 @% %@CR:C6A00020036 @%
  1188.  
  1189. %@AB@%STACKSIZE%@AE@%                         Determines the default size of the local
  1190.                                   stack in bytes. The recommended size is 
  1191.                                   5K.%@CR:C6A00020037 @%%@CR:C6A00020038 @%
  1192.  
  1193. %@AB@%Statement%@AE@%                         %@AB@%Usage%@AE@%
  1194. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1195. %@AB@%STUB%@AE@%                              Specifies the application's old-style 
  1196.                                   (DOS
  1197.                                   environment) executable file.%@CR:C6A00020039 @%%@CR:C6A00020040 @%
  1198.  
  1199. For details on the module-definition statements, see the %@AI@%Reference%@AE@%, %@AI@%Volume
  1200. %@AI@%2.%@AE@%  %@NL@%
  1201.  
  1202. Because Windows applications and libraries have different needs, the
  1203. statements you include in a .DEF file will differ slightly, depending on
  1204. whether you are creating the .DEF file for an application or for a library.
  1205. The rest of this section describes the specific module-definition needs of
  1206. applications and libraries.  %@NL@%
  1207.  
  1208.  
  1209. %@3@%%@CR:C6A00020041 @%%@AB@%2.1.1  Creating Module Definitions for Applications%@AE@%%@EH@%%@NL@%
  1210.  
  1211. A module-definition file for an application must include the following
  1212. statements:%@CR:C6A00020042 @%%@CR:C6A00020043 @%%@CR:C6A00020044 @%%@CR:C6A00020045 @%%@NL@%
  1213.  
  1214.  
  1215.   ■   A %@AB@%NAME%@AE@% statement that defines the application's module name. Windows
  1216.       uses the module name to identify the application. The module name must
  1217.       match the application's base filename. %@NL@%
  1218.  
  1219.   ■   An %@AB@%EXPORTS%@AE@% statement that lists functions in the module that Windows
  1220.       or other applications will call, such as window and callback
  1221.       functions.%@NL@%
  1222.  
  1223.   ■   An %@AB@%EXETYPE WINDOWS%@AE@% statement, which enables the application to run in
  1224.       the Windows environment. This statement tells %@AB@%LINK%@AE@% to use a Windows
  1225.       executable-file header instead of an OS/2 header (the default).%@CR:C6A00020046 @%%@CR:C6A00020047 @%%@CR:C6A00020048 @%%@CR:C6A00020049 @%%@CR:C6A00020050 @%%@NL@%
  1226.  
  1227.  
  1228. Although these are the only required statements in the .DEF file, most .DEF
  1229. files contain additional statements, such as the %@AB@%DATA%@AE@% and %@AB@%CODE%@AE@% statements,
  1230. 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@%
  1231.  
  1232. The following example shows a typical .DEF file for a Windows application:  %@NL@%
  1233.  
  1234. %@AS@%  ; Sample Module Definition File
  1235. %@AS@%   "NAME Sample
  1236. %@AS@%   DESCRIPTION 'Sample Window Application'
  1237. %@AS@%   
  1238. %@AS@%   EXETYPE WINDOWS 
  1239. %@AS@%   
  1240. %@AS@%   DATA MULTIPLE MOVEABLE
  1241. %@AS@%   CODE MOVEABLE DISCARDABLE
  1242. %@AS@%   
  1243. %@AS@%   HEAPSIZE 5120
  1244. %@AS@%   STACKSIZE 5120
  1245. %@AS@%   
  1246. %@AS@%   EXPORTS
  1247. %@AS@%    MainWndProc @1      SampleDlgProc @2%@AE@%
  1248.  
  1249. This is an example of a module-definition file for an application named
  1250. "Sample".  %@NL@%
  1251.  
  1252. "
  1253.  
  1254. The %@AB@%NAME%@AE@% statement defines the application's module name as "Sample". %@NL@%
  1255.  
  1256.  
  1257.  
  1258. The required statement %@AB@%EXETYPE WINDOWS%@AE@% ensures that %@AB@%LINK%@AE@% gives the
  1259. application a Windows-format header. %@NL@%
  1260.  
  1261.  
  1262.  
  1263. The %@AB@%DATA MULTIPLE%@AE@% statement tells %@AB@%LINK%@AE@% that this module has multiple data
  1264. segments (one for each instance of the application). For most Windows
  1265. applications, the data segment should be defined as %@AB@%MULTIPLE%@AE@%, since most
  1266. Windows applications can be invoked more than once. %@NL@%
  1267.  
  1268.  
  1269.  
  1270. The %@AB@%CODE MOVEABLE DISCARDABLE%@AE@% and previous %@AB@%DATA MULTIPLE MOVEABLE%@AE@% statements
  1271. tell %@AB@%LINK%@AE@% that both the data and code segments are moveable and that the
  1272. code segment is discardable. It's a good idea to use moveable and
  1273. discardable code segments and moveable data segments, since they allow
  1274. Windows to take best advantage of memory. %@NL@%
  1275.  
  1276.  
  1277.  
  1278. The heap and stack sizes are the recommended 5120 bytes. Heap space is
  1279. required if the application uses its local heap. It's a good idea for
  1280. applications to have at least 5120 bytes of stack space. %@NL@%
  1281.  
  1282.  
  1283.  
  1284. The %@AB@%EXPORTS%@AE@% statement lists the callback functions in the application: the
  1285. main window function, named "MainWndProc", and a dialog function,
  1286. "SampleDlgProc".%@CR:C6A00020060 @%%@NL@%
  1287.  
  1288.  
  1289. %@3@%%@CR:C6A00020061 @%%@AB@%2.1.2  Creating Module Definitions for Libraries%@AE@%%@EH@%%@NL@%
  1290.  
  1291. A module-definition file for a dynamic-link library must contain the
  1292. following statements:%@CR:C6A00020062 @%%@CR:C6A00020063 @%%@CR:C6A00020064 @%%@CR:C6A00020065 @%%@CR:C6A00020066 @%%@CR:C6A00020067 @%%@NL@%
  1293.  
  1294.  
  1295.   ■   A %@AB@%LIBRARY%@AE@% statement that defines the library's module name. Windows
  1296.       uses the module name to identify the library.%@CR:C6A00020068 @%%@CR:C6A00020069 @%%@NL@%
  1297.  
  1298.   ■   An %@AB@%EXPORTS%@AE@% statement that lists the functions to be exported by the
  1299.       library; the functions should be exported by ordinals rather than by
  1300.       name, since using ordinals conserves space. Functions in the library
  1301.       are accessible to other applications only if they are listed in the
  1302.       %@AB@%EXPORTS%@AE@% statement.%@CR:C6A00020070 @%%@CR:C6A00020071 @%%@NL@%
  1303.  
  1304.   ■   An %@AB@%EXETYPE WINDOWS%@AE@% statement, which enables the library to run in the
  1305.       Windows environment. This statement tells %@AB@%LINK%@AE@% to use a Windows
  1306.       executable-file header instead of an OS/2 header (the default).%@CR:C6A00020072 @%%@CR:C6A00020073 @%%@NL@%
  1307.  
  1308.  
  1309. In addition to these required statements, .DEF files for libraries can
  1310. include other statements.  %@NL@%
  1311.  
  1312. The following example shows a typical .DEF file for a library:%@CR:C6A00020074 @%%@CR:C6A00020075 @%%@NL@%
  1313.  
  1314. %@AS@%  ; Example Module Definition File
  1315. %@AS@%   "LIBRARY MyUtilities
  1316. %@AS@%   DESCRIPTION 'My Utility Functions'
  1317. %@AS@%   
  1318. %@AS@%   EXETYPE WINDOWS 
  1319. %@AS@%   
  1320. %@AS@%   DATA SINGLE MOVEABLE
  1321. %@AS@%   CODE MOVEABLE DISCARDABLE
  1322. %@AS@%   
  1323. %@AS@%   HEAPSIZE 4096
  1324. %@AS@%   
  1325. %@AS@%   EXPORTS
  1326. %@AS@%    UtilityInit @1
  1327. %@AS@%    UtilityStart @2
  1328. %@AS@%    UtilityEnd @3
  1329. %@AS@%    UtilityLoad @4
  1330. %@AS@%    UtilitySave @5%@AE@%
  1331.  
  1332. This is a sample module-definition file for a Windows dynamic-link library.%@CR:C6A00020076 @%%@NL@%
  1333.  
  1334. "
  1335.  
  1336. The %@AB@%LIBRARY%@AE@% statement defines the library's module name as MyUtilities. %@NL@%
  1337.  
  1338.  
  1339.  
  1340. The required statement %@AB@%EXETYPE WINDOWS%@AE@% ensures that %@AB@%LINK%@AE@% gives the library a
  1341. Windows-format header.%@NL@%
  1342.  
  1343.  
  1344.  
  1345. The statement %@AB@%DATA SINGLE MOVEABLE%@AE@% tells %@AB@%LINK%@AE@% that this library module has a
  1346. single data segment. Unlike an application, of which several copies can be
  1347. running at a time, Windows allows only one instance of a library at a time.%@NL@%
  1348.  
  1349.  
  1350.  
  1351. The heap size is 4096 bytes. Because libraries never have stacks, the
  1352. library's .DEF file contains no %@AB@%STACK%@AE@% statement; libraries use the stack of
  1353. the calling application. %@NL@%
  1354.  
  1355.  
  1356.  
  1357. The required statement %@AB@%EXPORTS%@AE@% lists the library's exported functions by
  1358. name and ordinal number. An application can then call these functions if the
  1359. functions' names or ordinals are listed in the %@AB@%IMPORTS%@AE@% statement of the
  1360. application's .DEF file.%@CR:C6A00020077 @%%@CR:C6A00020078 @%%@CR:C6A00020079 @% %@CR:C6A00020080 @%%@CR:C6A00020081 @%%@CR:C6A00020082 @%%@CR:C6A00020083 @%%@CR:C6A00020084 @%%@NL@%
  1361.  
  1362.  
  1363. %@2@%%@CR:C6A00020085 @%%@AB@%2.2  Importing Dynamic-Link Libraries%@AE@%%@EH@%%@NL@%
  1364.  
  1365. When you link an application that makes function calls to a dynamic-link
  1366. library (DLL), you must identify the imported functions using one of the
  1367. following methods:%@CR:C6A00020086 @%%@NL@%
  1368.  
  1369.  
  1370.   ■   Use the %@AB@%IMPORTS%@AE@% statement in the application's module-definition file.
  1371.       Section 2.1.2, "Creating Module Definitions for Libraries," describes
  1372.       this method.%@NL@%
  1373.  
  1374.   ■   Use the %@AB@%IMPLIB%@AE@% utility to create a library of imported functions and
  1375.       specify the library in the %@AB@%LINK%@AE@% command line, as described in this
  1376.       section.%@NL@%
  1377.  
  1378.  
  1379. You can create import libraries by using the %@AB@%IMPLIB%@AE@% utility. %@AB@%IMPLIB%@AE@% reads
  1380. the exports for a library, as listed in its definition file, and creates an
  1381. import library. You can link the library into an application.%@CR:C6A00020087 @%%@CR:C6A00020088 @%%@CR:C6A00020089 @%%@CR:C6A00020090 @%%@CR:C6A00020091 @%%@NL@%
  1382.  
  1383. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1384. NOTE
  1385.  
  1386. %@AI@%%@AB@%IMPLIB%@AE@%%@AI@% does not come on the SDK disks. It is shipped with the Microsoft C
  1387. %@AI@%Compiler. If you did not request %@AE@%%@AI@%%@AB@%IMPLIB%@AE@%%@AE@%%@AI@% to be copied when you installed the
  1388. %@AI@%C Compiler, you may want to copy it from the C Compiler disks.%@AE@%%@AE@%
  1389. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1390.  
  1391. You start %@AB@%IMPLIB%@AE@% by using the %@AB@%IMPLIB%@AE@% command.  %@NL@%
  1392.  
  1393.  
  1394. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1395.  
  1396. %@AS@%  IMPLIB imp-lib-name mod-def-file%@AE@%
  1397.  
  1398. The %@AI@%imp-lib-name%@AE@% parameter specifies the name you want the new import
  1399. library to have.  %@NL@%
  1400.  
  1401. The %@AI@%mod-def-file%@AE@% parameter specifies the name of the module-definition
  1402. (.DEF) file for the dynamic-link library. For %@AB@%IMPLIB%@AE@% version 1.1 and later,
  1403. distributed with Microsoft C version 6.0 and later, you can provide %@AB@%IMPLIB%@AE@%
  1404. the name of the DLL itself instead of the DLL's module-definition file.  %@NL@%
  1405.  
  1406. The following command creates the import library named MYLIB.LIB from the
  1407. module-definition file MYLIB.DEF:  %@NL@%
  1408.  
  1409. %@AS@%  IMPLIB MYLIB.LIB MYLIB.DEF%@AE@%
  1410.  
  1411. To link the library, specify it in the %@AB@%LINK%@AE@% command line, as in the
  1412. following example:  %@NL@%
  1413.  
  1414. %@AS@%  LINK SAMPLE, SAMPLE.EXE, , /NOD SLIBCEW LIBW MYLIB, SAMPLE.DEF%@AE@%
  1415.  
  1416. The example links the import library MYLIB.LIB.  %@NL@%
  1417.  
  1418. For more information on specifying libraries, see Section 2.3.3, "Specifying
  1419. Libraries on the LINK Command Line."%@CR:C6A00020092 @%%@NL@%
  1420.  
  1421.  
  1422. %@2@%%@CR:C6A00020093 @%%@AB@%2.3  Linking an Application%@AE@%%@EH@%%@NL@%
  1423.  
  1424. You can link object (.OBJ) files from compiled application source files,
  1425. libraries, and module-definition files into an executable file using the
  1426. linker. The %@AB@%LINK%@AE@% program comes with Microsoft C version 5.1; it is not
  1427. included in the SDK.  %@NL@%
  1428.  
  1429. %@AB@%LINK%@AE@% combines the code and data of all application files with the
  1430. appropriate code for any Windows functions that the application calls, and
  1431. creates a new executable file or DLL.%@CR:C6A00020094 @%%@CR:C6A00020095 @%%@NL@%
  1432.  
  1433.  
  1434. %@3@%%@CR:C6A00020096 @%%@AB@%2.3.1  Using the LINK Command%@CR:C6A00020097 @%%@AE@%%@EH@%%@NL@%
  1435.  
  1436. To start the linker, you use the %@AB@%LINK%@AE@% command. You can type this command on
  1437. the DOS command line, or you can enter it in a batch file or a make file.  %@NL@%
  1438.  
  1439.  
  1440. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1441.  
  1442. %@AS@%  LINK «options» object-files,«exe-file»,«map-file», «lib-files»,def-file%@AE@%
  1443.  
  1444. The %@AI@%options%@AE@% parameter specifies one or more key words (described in Section
  1445. 2.3.2, "Specifying LINK Command Options") that tell %@AB@%LINK%@AE@% to carry out
  1446. special operations.  %@NL@%
  1447.  
  1448. The %@AI@%object-files%@AE@% parameter specifies the filenames of one or more compiled
  1449. application source files. If your application has more than one compiled
  1450. source file, you must name all of them on the %@AB@%LINK%@AE@% command line. Separate
  1451. the filenames of object files by spaces or the plus sign (+).%@CR:C6A00020098 @%%@CR:C6A00020099 @%%@NL@%
  1452.  
  1453. The %@AI@%exe-file%@AE@% parameter specifies the name you want %@AB@%LINK%@AE@% to give to the
  1454. resulting executable file or dynamic-link library.  %@NL@%
  1455.  
  1456. The %@AI@%map-file%@AE@% parameter specifies the name you want the map file to have. (A
  1457. map file is used for symbolic debugging with %@AB@%SYMDEB%@AE@% or %@AB@%WDEB386%@AE@%.)%@CR:C6A00020100 @%%@NL@%
  1458.  
  1459. The %@AI@%lib-files%@AE@% parameter specifies the names of Windows or standard-language
  1460. libraries.  %@NL@%
  1461.  
  1462. The %@AI@%def-file%@AE@% parameter specifies the filename of the module-definition
  1463. (.DEF) file. Each application can have only one .DEF file.%@CR:C6A00020101 @%%@NL@%
  1464.  
  1465. Use commas to separate parameters in the command line.%@CR:C6A00020102 @%%@CR:C6A00020103 @%%@NL@%
  1466.  
  1467. The following example command line links the application object file
  1468. SAMPLE.OBJ with the standard Windows library LIBW.LIB:  %@NL@%
  1469.  
  1470. %@AS@%  LINK SAMPLE.OBJ/al:16, SAMPLE.EXE, SAMPLE.MAP/map/li, /NOD SLIBCEW.LIB
  1471. %@AS@%LIBW.LIB, SAMPLE.DEF%@AE@%
  1472.  
  1473. The command line creates the file SAMPLE.EXE, which has the module name,
  1474. segments, and exported functions defined by the module-definition file
  1475. SAMPLE.DEF. It also creates the map file SAMPLE.MAP, used for symbolic
  1476. debugging. The command searches the library file LIBW.LIB to resolve any
  1477. external function calls made in the application files. It also searches for
  1478. the Windows version of the small model emulated math C run-time library.  %@NL@%
  1479.  
  1480. The %@AB@%LINK %@AE@%program uses default filename extensions if you do not provide
  1481. extensions. For example, the preceding example would have the same results
  1482. if typed as follows:  %@NL@%
  1483.  
  1484. %@AS@%  LINK SAMPLE/al:16, SAMPLE, SAMPLE/map/li, /NOD SLIBCEW LIBW, SAMPLE%@AE@%
  1485.  
  1486.  
  1487. %@3@%%@CR:C6A00020104 @%%@AB@%2.3.2  Specifying LINK Command Options%@AE@%%@EH@%%@NL@%
  1488.  
  1489. You can use the %@AB@%LINK%@AE@% %@AI@%options%@AE@% parameter to tell the linker to perform special
  1490. operations. The %@AB@%LINK%@AE@% options are:%@CR:C6A00020105 @%%@CR:C6A00020106 @%%@NL@%
  1491.  
  1492. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1493. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1494. %@AB@%/alignment:%@AE@%%@AI@%size%@AE@%                   Tells the linker to align segment data 
  1495.                                   in the executable file along the 
  1496.                                   boundaries specified by %@AI@%size%@AE@%. 
  1497.  
  1498.                                   The %@AI@%size%@AE@% parameter specifies a boundary 
  1499.                                   size in bytes; for example, the 
  1500.                                   following indicates an alignment 
  1501.                                   boundary of 16 bytes:
  1502.  
  1503.                                   %@AS@%/alignment:16%@AE@%
  1504.  
  1505.                                   The %@AI@%size%@AE@% parameter must be a power of 2;
  1506.                                   therefore, 2, 4, 8, 16, and so on are 
  1507.                                   appropriate values. The default is 512 
  1508.                                   bytes. 
  1509.  
  1510.                                   It is strongly recommended that you link
  1511.                                   your application with the alignment set 
  1512.                                   to 16 or less (or 32 if the application 
  1513.                                   is larger than 1 megabyte). The default 
  1514.                                   512-byte alignment wastes a large amount
  1515.                                   of disk space, especially for larger 
  1516.                                   applications using many segments and 
  1517.                                   resources.
  1518.  
  1519.                                   The minimum abbreviation for this option
  1520.                                   is %@AB@%/al%@AE@%. 
  1521.  
  1522. %@AB@%/codeview%@AE@%                         Tells the linker to prepare for 
  1523.                                   debugging using CodeView for Windows (%@AB@%%@AE@%
  1524.                                   %@AB@%CVW%@AE@%).
  1525.  
  1526.                                   The minimum abbreviation for this option
  1527.                                   is %@AB@%/co%@AE@%.
  1528.  
  1529. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1530. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1531. %@AB@%/help%@AE@%                             Tells the linker to display a list of 
  1532.                                   available options. 
  1533.  
  1534.                                   The minimum abbreviation for this option
  1535.                                   is /%@AB@%h%@AE@%. 
  1536.  
  1537. %@AB@%/linenumbers%@AE@%                      Tells the linker to copy line-number 
  1538.                                   information from the object file to the 
  1539.                                   map file. Use this option to prepare for
  1540.                                   source line debugging with the Symbolic 
  1541.                                   Debugger (%@AB@%SYMDEB%@AE@%). 
  1542.  
  1543.                                   The minimum abbreviation for this option
  1544.                                   is %@AB@%/li%@AE@%. %@CR:C6A00020107 @% %@CR:C6A00020108 @%
  1545.  
  1546. %@AB@%/map%@AE@%                              Tells the linker to create a .MAP file, 
  1547.                                   which the %@AB@%MAPSYM%@AE@% utility uses to create 
  1548.                                   a .SYM file. The .SYM file is then used 
  1549.                                   by the Symbolic Debugger.
  1550.  
  1551. %@AB@%/nodefaultlibrarysearch%@AE@%           Prevents the linker from using the 
  1552.                                   default C run-time libraries. This 
  1553.                                   option is recommended if you use the %@AB@%%@AE@%
  1554.                                   %@AB@%?LIBC?W.LIB%@AE@% naming of the C runtime 
  1555.                                   libraries instead of %@AB@%?LIBC?.LIB%@AE@%.
  1556.  
  1557.                                   The minimum abbreviation for this option
  1558.                                   is %@AB@% /nod.%@AE@%
  1559.  
  1560. %@AB@%/noextendeddictionarysearch%@AE@%       Prevents the linker from searching a 
  1561.                                   library's extended dictionary, which is 
  1562.                                   a list of symbols stored in the library.
  1563.                                   The linker normally consults this list 
  1564.                                   to speed up library searches. Normally 
  1565.                                   this option is not needed. The linker 
  1566.                                   issues an error message if you need to 
  1567.                                   use this switch.
  1568.  
  1569.                                   The minimum abbreviation for this option
  1570.                                   is %@AB@%/noe.%@AE@%
  1571.  
  1572. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1573. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1574. %@AB@%/nofarcalltrans%@AE@%                   This option prevents the translation of 
  1575.                                   far calls within the current segment. 
  1576.                                   Without this option, far calls are 
  1577.                                   translated into the assembler 
  1578.                                   statements:
  1579.  
  1580.                                   %@AS@%.%@AE@%
  1581.                                   %@AS@%.%@AE@%
  1582.                                   %@AS@%.%@AE@%
  1583.                                   %@AS@%NOP%@AE@%
  1584.                                   %@AS@%PUSH CS%@AE@%
  1585.                                   %@AS@%NEAR CALL%@AE@%
  1586.                                   %@AS@%.%@AE@%
  1587.                                   %@AS@%.%@AE@%
  1588.                                   %@AS@%.%@AE@%
  1589.  
  1590.                                   The minimum abbreviation for this option
  1591.                                   is %@AB@%/nof%@AE@%. %@CR:C6A00020109 @%%@CR:C6A00020110 @%
  1592.  
  1593. %@AB@%/noignorecase%@AE@%                     Tells the linker to preserve lowercase 
  1594.                                   letters when matching symbols during 
  1595.                                   linking. 
  1596.  
  1597.                                   The minimum abbreviation for this option
  1598.                                   is %@AB@%/noi%@AE@%.
  1599.  
  1600. %@AB@%/pause%@AE@%                            Tells the linker to pause before copying
  1601.                                   the executable file to disk. 
  1602.  
  1603.                                   The minimum abbreviation for this option
  1604.                                   is %@AB@%/pau%@AE@%. 
  1605.  
  1606. %@AB@%/segments:%@AE@%%@AI@%number%@AE@%                  Sets the maximum number of segments the 
  1607.                                   linker will process to %@AI@%number%@AE@%. For 
  1608.                                   example, the following would tell the 
  1609.                                   linker to process no more than 200 
  1610.                                   segments:
  1611.  
  1612.                                   %@AS@%/segments:200%@AE@%
  1613.  
  1614.                                   The default is 128 segments. Windows 
  1615.                                   limits an application to 254 segments.
  1616.  
  1617.                                   The minimum abbreviation for this option
  1618.                                   is %@AB@%/se%@AE@%. %@CR:C6A00020111 @%%@CR:C6A00020112 @%
  1619.  
  1620. %@AB@%Option%@AE@%                            %@AB@%Usage%@AE@%
  1621. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1622. %@AB@%/warnfixup%@AE@%                        Causes the linker to display an error 
  1623.                                   message when an offset fixup occurs 
  1624.                                   (relative to a logical segment) outside 
  1625.                                   the physical segment. 
  1626.  
  1627.                                   The minimum abbreviation for this option
  1628.                                   is %@AB@%/w%@AE@%. 
  1629.  
  1630. The following %@AB@%LINK%@AE@% options are not allowed when linking Windows
  1631. applications:%@CR:C6A00020113 @%%@CR:C6A00020114 @%%@CR:C6A00020115 @%%@NL@%
  1632.  
  1633.  %@AB@%/dsallocate%@AE@%  %@AB@%/exepack%@AE@%  %@AB@%/high%@AE@%  %@AB@%/overlayinterrupt%@AE@%  %@NL@%
  1634.  
  1635. The following %@AB@%LINK%@AE@% options are not recommended when linking Windows
  1636. applications:%@CR:C6A00020116 @%%@NL@%
  1637.  
  1638.  %@AB@%/nogroupassociation%@AE@%  %@AB@%/packcode%@AE@%  %@AB@%/stack%@AE@%  %@NL@%
  1639.  
  1640. Instead of using the %@AB@%LINK%@AE@% option %@AB@%/stack%@AE@%, set the stack size in the
  1641. application's .DEF file.  %@NL@%
  1642.  
  1643. For more information on %@AB@%LINK%@AE@% command-line options, see the %@AI@%Microsoft C
  1644. %@AI@%Optimizing Compiler User's Guide%@AE@%.  %@NL@%
  1645.  
  1646.  
  1647. %@3@%%@CR:C6A00020117 @%%@AB@%2.3.3  Specifying Libraries on the LINK Command Line%@AE@%%@EH@%%@NL@%
  1648.  
  1649. When you link an application's object files, you must specify the
  1650. appropriate C-language libraries for Windows and C run-time libraries. The
  1651. C-language  libraries for Windows contain code for the Windows application
  1652. start-up routines and references for the Windows functions.%@CR:C6A00020118 @%%@CR:C6A00020119 @%%@CR:C6A00020120 @%%@NL@%
  1653.  
  1654. There are corresponding C-language libraries you will use when linking
  1655. dynamic-link libraries. Table 2.1 shows which Windows library to use,
  1656. depending on the memory model and whether you are linking an application or
  1657. a library.%@CR:C6A00020121 @%%@NL@%
  1658.  
  1659. Table 2.1  Linking with a Windows C-Language Library
  1660.  
  1661. %@TH:  16  1093 02 25 20 31 @%Memory Model             For an Application  For a DLL%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%Emulated Math Package%@AE@%    %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Small                    SLIBCEW.LIB         SDLLCEW.LIBMedium                   MLIBCEW.LIB         MDLLCEW.LIBCompact                  CLIBCEW.LIB         CDLLCEW.LIBLarge                    LLIBCEW.LIB         LDLLCEW.LIB%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%Alternate Math Package%@AE@%   %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Small                    SLIBCAW.LIB         SDLLCAW.LIBMedium                   MLIBCAW.LIB         MDLLCAW.LIBCompact                  CLIBCAW.LIB         CDLLCAW.LIBLarge                    LLIBCAW.LIB         LDLLCAW.LIB%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  16  1093 02 25 20 31 @%
  1662.  
  1663. Which C-language libraries you link with depends on your application's
  1664. programming model and whether or not the model uses floating-point support.%@CR:C6A00020122 @%%@NL@%
  1665.  
  1666. In addition to these libraries, you must also link with the
  1667. model-independent Windows import library, LIBW.LIB.  %@NL@%
  1668.  
  1669. Use the %@AB@%/nod%@AE@% option to ensure that the linker will not try to find objects
  1670. in your non-Windows versions of the C run-time libraries.  %@NL@%
  1671.  
  1672. For example, a small-model application using the emulator math package must
  1673. be linked with the small-model library SLIBCEW.LIB and LIBW.LIB, as shown in
  1674. the following example:  %@NL@%
  1675.  
  1676. %@AS@%  LINK SAMPLE,,/NOD SLIBCEW LIBW, SAMPLE.DEF%@AE@%
  1677.  
  1678. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1679. NOTE
  1680.  
  1681. %@AI@%You should link your program with the SLIBCEW.LIB or MLIBCEW.LIB library if
  1682. %@AI@%you chose the coprocessor/emulator option by specifying %@AB@%-FPi%@AE@%%@AI@% on the compiler
  1683. %@AI@%command line. For your Windows application to use the math
  1684. %@AI@%coprocessor/emulator, you must include WIN87EM.LIB on your %@AE@%%@AI@%%@AB@%LINK%@AE@%%@AE@%%@AI@% command
  1685. %@AI@%line. This library contains import information for the WIN87EM.DLL library
  1686. %@AI@%supplied with the retail version of Windows. %@CR:C6A00020123 @%%@AE@%%@AE@%
  1687.  
  1688. %@AI@%You should link your program with the SLIBCAW.LIB or MLIBCAW.LIB library if
  1689. %@AI@%you chose the alternative math option by specifying %@AB@%-FPa%@AE@%%@AI@% on the compiler
  1690. %@AI@%command line. Ensure that these libraries are available.%@AE@%%@AE@%
  1691. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1692.  
  1693.  
  1694. %@2@%%@CR:C6A00020124 @%%@AB@%2.4  Examining Executable File Headers%@AE@%%@EH@%%@NL@%
  1695.  
  1696. You can use the %@AB@%EXEHDR%@AE@% utility to determine whether an executable file is a
  1697. Windows application or a library. The command also lets you find out which
  1698. functions are exported or imported by a module, determine the amount of
  1699. space allocated for a module's heap or stack, and determine the size and
  1700. number of the segments a module contains.%@CR:C6A00020125 @%%@CR:C6A00020126 @%%@CR:C6A00020127 @%%@CR:C6A00020128 @%%@CR:C6A00020129 @%%@NL@%
  1701.  
  1702.  
  1703. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1704.  
  1705. %@AS@%  EXEHDR exe-filename%@AE@%
  1706.  
  1707. The %@AI@%exe-filename%@AE@% parameter specifies the name of any file with an .EXE
  1708. extension.  %@NL@%
  1709.  
  1710. The following example displays the header for the executable file HELLO.EXE:
  1711. %@NL@%
  1712.  
  1713. %@AS@%  EXEHDR HELLO.EXE%@AE@%
  1714.  
  1715. The format of this header is closely related to the statements contained in
  1716. the application's module-definition file.  %@NL@%
  1717.  
  1718. For more information about %@AB@%EXEHDR%@AE@%, see the Microsoft C Optimizing  Compiler
  1719. documentation.  %@NL@%
  1720.  
  1721.  
  1722. %@2@%%@CR:C6A00020130 @%%@AB@%2.5  Summary%@AE@%%@EH@%%@NL@%
  1723.  
  1724. %@AB@%LINK%@AE@% is a tool that takes compiled sources, a list of libraries, and a
  1725. moduledefinition file, and creates a file that you can load and run with
  1726. Windows. For additional information see the following:  %@NL@%
  1727.  
  1728. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  1729. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1730. Windows versions of C run-time    %@AI@%Guide to Programming%@AE@%: Chapter 14, "C 
  1731. libraries                         and
  1732.                                   Assembly Language"
  1733.  
  1734. Module-definition statements      %@AI@%Reference, Volume 2%@AE@%: Chapter 10, 
  1735.                                   "ModuleDefinition Statements"
  1736.  
  1737.  
  1738.  
  1739.  
  1740.  
  1741.  
  1742. %@CR:C6A00030001 @%%@1@%%@AB@%Chapter 3  Compiling Resources: The Resource Compiler%@AE@%%@EH@%%@NL@%
  1743. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1744.  
  1745. Microsoft Windows Resource Compiler (%@AB@%RC%@AE@%) is a tool that lets you compile
  1746. resources, such as icons, cursors, menus, and dialog boxes, that your
  1747. application uses. You add the resulting binary resource file to your
  1748. application's binary file to produce an executable Windows application.  %@NL@%
  1749.  
  1750. This chapter describes how to do the following:  %@NL@%
  1751.  
  1752.  
  1753.   ■   Include resources in your application%@NL@%
  1754.  
  1755.   ■   Create a resource script file, which describes the resources your
  1756.       application will use%@NL@%
  1757.  
  1758.   ■   Use the Resource Compiler to compile your application's resources and
  1759.       add them to the application's executable file%@CR:C6A00030002 @%%@CR:C6A00030003 @%%@CR:C6A00030004 @%%@CR:C6A00030005 @%%@CR:C6A00030006 @%%@NL@%
  1760.  
  1761.  
  1762.  
  1763. %@2@%%@CR:C6A00030007 @%%@AB@%3.1  Including Resources in an Application%@AE@%%@EH@%%@NL@%
  1764.  
  1765. To include resources in your Windows application, follow these steps:  %@NL@%
  1766.  
  1767.  
  1768.   1.  Create individual resource files for cursors, icons, bitmaps, dialogs,
  1769.       and fonts, using the appropriate resource editors. %@NL@%
  1770.  
  1771. %@STUB@%      Part 2 of this manual, "Resource Editors," explains how to use these
  1772.       editors. %@NL@%
  1773.  
  1774.   2.  Create a resource script (.RC) file that defines each application
  1775.       resource by specifying its name and description. %@NL@%
  1776.  
  1777. %@STUB@%      If the resource is in a separate file, this description includes the
  1778.       resource's filename.%@NL@%
  1779.  
  1780. %@STUB@%      For example, the .RC file might define a cursor resource by naming it
  1781.       "SampleCursor," describing it as a resource of type "Cursor," and
  1782.       defining it as the cursor contained in the file SAMPLE.CUR. %@NL@%
  1783.  
  1784.   3.  Compile the resource script file using the Resource Compiler. %@NL@%
  1785.  
  1786. %@STUB@%      The result will be a compiled resource file with the filename
  1787.       extension .RES. %@NL@%
  1788.  
  1789.   4.  Add the compiled resources to the application's compiled executable
  1790.       (.EXE) file using the Resource Compiler. %@NL@%
  1791.  
  1792. %@STUB@%      If you want, you can perform this step and the preceding step with a
  1793.       single %@AB@%RC%@AE@% command.%@NL@%
  1794.  
  1795.  
  1796.  
  1797. %@2@%%@CR:C6A00030008 @%%@AB@%3.2  Creating a Resource Script File%@AE@%%@EH@%%@NL@%
  1798.  
  1799. After creating individual resource files for your application's icon,
  1800. cursor, bitmap, font, and dialog resources, you create a resource script
  1801. file. The resource script file always has the .RC extension, and is often
  1802. referred to simply as the .RC file.%@CR:C6A00030009 @%%@NL@%
  1803.  
  1804. The .RC file lists every resource in your application, and describes some
  1805. types of resources in great detail:  %@NL@%
  1806.  
  1807.  
  1808.   ■   For resources that exist in a separate file, such as icons and
  1809.       cursors, the .RC file simply names the resource and the file that
  1810.       contains it.%@NL@%
  1811.  
  1812.   ■   For some types of resources, such as menus, the entire definition of
  1813.       the resource exists within the .RC file.%@NL@%
  1814.  
  1815.  
  1816. You create a resource script file using an ordinary ASCII text editor. The
  1817. file can contain resource statements and directives.%@CR:C6A00030010 @%%@NL@%
  1818.  
  1819. Resource statements name and describe each resource.  %@NL@%
  1820.  
  1821. Directives are a special type of statement that defines an action you want
  1822. the Resource Compiler to perform on the resource script file before actually
  1823. compiling it. You can use directives to assign values to names, include the
  1824. contents of files, and control compilation of the script file. The
  1825. directives you use in a resource script file are identical to the C-language
  1826. directives.%@CR:C6A00030011 @%%@CR:C6A00030012 @%%@CR:C6A00030013 @%%@CR:C6A00030014 @%%@CR:C6A00030015 @%%@CR:C6A00030016 @%%@NL@%
  1827.  
  1828. A line in an .RC file cannot exceed 256 characters.  %@NL@%
  1829.  
  1830. Table 3.1 lists and briefly describes the statements and directives you can
  1831. use in a resource script file. (See the %@AI@%Reference%@AE@%, %@AI@%Volume 2%@AE@%, for detailed
  1832. descriptions and syntax.)%@CR:C6A00030017 @%%@CR:C6A00030018 @%%@CR:C6A00030019 @%%@CR:C6A00030020 @%%@CR:C6A00030021 @%%@CR:C6A00030022 @%%@NL@%
  1833.  
  1834. Table 3.1  Resource Statements
  1835.  
  1836. %@TH:   7   469 02 24 11 41 @%Type of Statement       Statement  Description %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Single-line statements  %@AB@%BITMAP%@AE@%     Defines a bitmap by naming it and                                    specifying the file that contains it.                                    (To use a particular bitmap, the                                    application requests it by name.)%@TE:   7   469 02 24 11 41 @%
  1837.  
  1838. Table 3.1  Resource Statements (continued)
  1839.  
  1840. %@TH:  82  4609 02 30 15 31 @%Type of Statement             Statement      Description %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%                              %@AB@%CURSOR%@AE@%         Defines a cursor by naming it                                             and specifying the file that                                              contains it. (To use a                                              particular cursor, the                                              application requests it by                                              name.)                              %@AB@%FONT%@AE@%           Specifies a file that                                              contains a font.                              %@AB@%ICON%@AE@%           Defines an icon by naming it                                              and specifying the file that                                              contains it. (To use a                                              particular icon, the                                              application requests it by                                              name.)Multiple-line statements      %@AB@%ACCELERATORS%@AE@%   Defines menu accelerator                                              keys.                              %@AB@%DIALOG%@AE@%         Defines a template that an                                              application can use to create                                             dialog boxes.                              %@AB@%MENU%@AE@%           Defines the appearance and                                              function of an application                                              menu.                               %@AB@%RCDATA%@AE@%         Defines raw data resources.                                              Raw data resources let you                                              include binary data directly                                              into the executable file.                              %@AB@%STRINGTABLE%@AE@%    Defines string resources.                                              String resources are null-                                             terminated ASCII strings that                                             can be loaded from the                                              executable file.Directives                    %@AB@%#define%@AE@%        Defines a specified name by                                              assigning it a given value.                              %@AB@%#elif%@AE@%          Marks an optional clause of a                                             conditional compilation                                              block.                              %@AB@%#else%@AE@%          Marks an optional clause of a                                             conditional compilation                                              block.                              %@AB@%#endif%@AE@%         Marks the end of a                                              conditional compilation                                              block.                              %@AB@%#if%@AE@%            Carries out conditional                                              compilation if a specified                                              expression is true.                              %@AB@%#ifdef%@AE@%         Carries out conditional                                              compilation if a specified                                              name has been defined.                              %@AB@%#ifndef%@AE@%        Carries out conditional                                              compilation if a specified                                              name is not defined.                              %@AB@%#include%@AE@%       Copies the contents of a file                                             into the resource script                                              before the Resource Compiler                                              processes the script.                               %@AB@%#undef%@AE@%         Removes the current                                              definition of the specified                                              name.User-defined resources        User-supplied  Any data that needs to be                                              added to the executable file.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  82  4609 02 30 15 31 @%
  1841.  
  1842. For a detailed description of the statements in a resource script file, see
  1843. the %@AI@%Reference%@AE@%, %@AI@%Volume 2.%@AE@%  %@NL@%
  1844.  
  1845. For example, the following script file defines the resources for an
  1846. application called "Shapes":  %@NL@%
  1847.  
  1848. %@AS@%  "#include "SHAPES.H"
  1849. %@AS@%  ShapesCursor  CURSOR  SHAPES.CUR
  1850. %@AS@%  ShapesIcon  ICON  SHAPES.ICO
  1851. %@AS@%  ShapesMenu  MENU
  1852. %@AS@%  BEGIN
  1853. %@AS@%      POPUP "&Shape"
  1854. %@AS@%          BEGIN
  1855. %@AS@%              MENUITEM "&Clear", ID_CLEAR
  1856. %@AS@%              MENUITEM "&Rectangle", ID_RECT
  1857. %@AS@%              MENUITEM "&Triangle", ID_TRIANGLE
  1858. %@AS@%              MENUITEM "&Star", ID_STAR
  1859. %@AS@%              MENUITEM "&Ellipse", ID_ELLIPSE
  1860. %@AS@%          END
  1861. %@AS@%  END%@AE@%
  1862.  
  1863. "
  1864.  
  1865. The file uses the %@AB@%#include%@AE@% directive to include the contents of the header
  1866. file SHAPES.H. %@NL@%
  1867.  
  1868.  
  1869.  
  1870. The %@AB@%CURSOR%@AE@% statement names the application's cursor resource "ShapesCursor"
  1871. and specifies the cursor file SHAPES.CUR, which contains the image for that
  1872. cursor. %@NL@%
  1873.  
  1874.  
  1875.  
  1876. It does the same for the application's icon resource, "ShapesIcon", using
  1877. the %@AB@%ICON%@AE@% statement. %@NL@%
  1878.  
  1879.  
  1880.  
  1881. The script file uses the %@AB@%MENU%@AE@% statement to define an application menu named
  1882. "ShapesMenu", a pop-up menu with five menu items. %@NL@%
  1883.  
  1884.  
  1885.  
  1886. The menu definition, enclosed in the %@AB@%BEGIN%@AE@% and %@AB@%END%@AE@% key words, specifies each
  1887. menu item and the menu ID code that is returned when the user selects that
  1888. item. For example, the first item on the menu, "Clear", returns the menu ID
  1889. code "ID_CLEAR" when the user selects it. The ID values are defined in the
  1890. application header file, SHAPES.H.%@CR:C6A00030023 @%%@NL@%
  1891.  
  1892. For more information on the resource script file, the syntax of the resource
  1893. statements, and how to create user-defined resources, see the %@AI@%Reference,
  1894. %@AI@%Volume 2%@AE@%.  %@NL@%
  1895.  
  1896.  
  1897. %@2@%%@CR:C6A00030024 @%%@AB@%3.3  Using the Resource Compiler%@AE@%%@EH@%%@NL@%
  1898.  
  1899. The Resource Compiler serves the following functions:  %@NL@%
  1900.  
  1901.  
  1902.   ■   It compiles the resource script file and the resource files (such as
  1903.       icon and cursor files) into a binary resource (.RES) file.%@NL@%
  1904.  
  1905.   ■   It combines the compiled .RES file with the executable (.EXE) file
  1906.       created by the linker; the result is an executable Windows
  1907.       application. %@CR:C6A00030025 @%%@CR:C6A00030026 @%%@CR:C6A00030027 @%%@NL@%
  1908.  
  1909.   ■   It marks all Windows applications (even if they have no resources)
  1910.       with a Windows version stamp.
  1911. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1912. NOTE
  1913.  
  1914. %@AI@%All Windows applications and libraries must bear a Windows version stamp.
  1915. %@AI@%For this reason, use %@AB@%RC%@AE@%%@AI@% on every Windows application and library you build,
  1916. %@AI@%whether or not it uses any resources.%@CR:C6A00030028 @%%@AE@%%@AE@%
  1917. ────────────────────────────────────────────────────────────────────────────%@NL@%
  1918.  
  1919. %@NL@%
  1920.  
  1921.  
  1922. To start the Resource Compiler, use the %@AB@%RC%@AE@% command. What you specify on the
  1923. command line will depend on whether you are compiling resources, adding
  1924. compiled resources to an executable file, or both.%@CR:C6A00030029 @%%@CR:C6A00030030 @%%@NL@%
  1925.  
  1926.  
  1927. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  1928.  
  1929. %@AB@%RC %@AE@%«%@AI@%options%@AE@%»%@AI@% resource-file %@AE@%«%@AI@%executable-file%@AE@%»  %@NL@%
  1930.  
  1931. There are several ways you can use the %@AB@%RC%@AE@% command:  %@NL@%
  1932.  
  1933.  
  1934.   ■   To compile resources separately, use the %@AB@%RC%@AE@% command in the following
  1935.       form:%@NL@%
  1936.  
  1937. %@STUB@%      %@AB@%RC%@AE@% %@AB@%-R%@AE@% «%@AI@%options%@AE@%» %@AI@%script-file%@AE@%%@NL@%
  1938.  
  1939. %@STUB@%      When you use this form, the Resource Compiler ignores the executable
  1940.       file if you specify one.%@NL@%
  1941.  
  1942.   ■   To compile an .RC file and add the resulting .RES file to the
  1943.       executable file, use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  1944.  
  1945. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%script-file%@AE@% «%@AI@%executable-file%@AE@%»%@NL@%
  1946.  
  1947.   ■   To compile a 3.0 version of a dynamic-link library (DLL) that does not
  1948.       have a .RES file, use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  1949.  
  1950. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%dll-file%@AE@%%@NL@%
  1951.  
  1952. %@STUB@%      When you use this form, the DLL filename must explicitly have an .EXE,
  1953.       .DRV, or .DLL extension.%@NL@%
  1954.  
  1955.   ■   To simply add a compiled resource (.RES) file to an executable file,
  1956.       use the %@AB@%RC%@AE@% command in the following form:%@NL@%
  1957.  
  1958. %@STUB@%      %@AB@%RC%@AE@% «%@AI@%options%@AE@%» %@AI@%res-file.RES%@AE@% «%@AI@%executable-file%@AE@%»%@NL@%
  1959.  
  1960.  
  1961. The rest of this section explains how to specify each of the %@AB@%RC%@AE@% command's
  1962. parameters.  %@NL@%
  1963.  
  1964.  
  1965. %@4@%%@AB@%Options Parameter%@AE@%%@EH@%%@NL@%
  1966.  
  1967. The %@AB@%RC%@AE@% command's %@AI@%options%@AE@% parameter can include one or more of the following:%@CR:C6A00030031 @%%@CR:C6A00030032 @%%@NL@%
  1968.  
  1969. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%%@CR:C6A00030033 @%
  1970. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  1971. %@AB@%-R%@AE@%                                Creates an .RES file from an .RC file. 
  1972.                                   Use this option when you do not want to 
  1973.                                   add the compiled .RES file to the .EXE 
  1974.                                   file. 
  1975.  
  1976. %@AB@%-D%@AE@%                                Defines a symbol for the preprocessor 
  1977.                                   that you can test with the %@AB@%#ifdef%@AE@% 
  1978.                                   directive.%@CR:C6A00030034 @%
  1979.  
  1980. %@AB@%-FO%@AE@%                               Renames the .RES file.%@CR:C6A00030035 @%
  1981.  
  1982. %@AB@%-FE%@AE@%                               Renames the .EXE file.%@CR:C6A00030036 @%
  1983.  
  1984. %@AB@%-I%@AE@%                                Searches the specified directory before 
  1985.                                   searching the directories specified by 
  1986.                                   the INCLUDE environment variable.%@CR:C6A00030037 @%
  1987.  
  1988. %@AB@%-V%@AE@%                                Displays messages that report on the 
  1989.                                   progress of the compiler.
  1990.  
  1991. %@AB@%-X%@AE@%                                Prevents the Resource Compiler from 
  1992.                                   checking the INCLUDE environment 
  1993.                                   variable when searching for include 
  1994.                                   files or resource files. %@CR:C6A00030038 @%
  1995.  
  1996. %@AB@%-L%@AE@% or %@AB@%-LIM32%@AE@%                      Tells Windows that the application uses 
  1997.                                   expanded memory directly, according to 
  1998.                                   the Lotus(R) Intel(R) Microsoft Expanded
  1999.                                   Memory Specification (EMS), version 3.2.%@CR:C6A00030039 @%
  2000.                                   %@CR:C6A00030040 @% 
  2001.  
  2002. %@AB@%Option %@AE@%                           %@AB@%Description%@AE@%
  2003. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2004. %@AB@%-M%@AE@% or %@AB@%-MULTINST%@AE@%                   When Windows is running with the EMS 4.0
  2005.                                   memory configuration, this switch 
  2006.                                   assigns each instance of the application
  2007.                                   task to a distinct EMS bank. (By default,
  2008.                                   all instances of a task share the same 
  2009.                                   EMS bank.)%@CR:C6A00030041 @%
  2010.  
  2011. %@AB@%-E%@AE@%                                For a dynamic-link library, changes the 
  2012.                                   default location of global memory from 
  2013.                                   below the EMS bank line to above the EMS
  2014.                                   bank line. %@CR:C6A00030042 @%
  2015.  
  2016. %@AB@%-P%@AE@%                                Creates a private dynamic-link library 
  2017.                                   (DLL) that is called by only one 
  2018.                                   application. This allows Windows to use 
  2019.                                   memory better, since only one 
  2020.                                   application (or multiple instances of 
  2021.                                   the same application) will be calling 
  2022.                                   into the DLL. For example, in the 
  2023.                                   large-frame EMS memory model, the DLL is
  2024.                                   loaded above the EMS bank line, freeing 
  2025.                                   memory below the bank line.%@CR:C6A00030043 @%
  2026.  
  2027. %@AB@%-K%@AE@%                                Disables the load-optimization feature 
  2028.                                   of the Resource Compiler. If this option
  2029.                                   is not specified, the compiler arranges 
  2030.                                   segments and resources in the executable
  2031.                                   file so that all preloaded information 
  2032.                                   is contiguous. This feature allows 
  2033.                                   Windows to load the application much 
  2034.                                   more quickly.%@CR:C6A00030044 @%
  2035.  
  2036.                                   If you do not specify the %@AB@%-K%@AE@% option, all
  2037.                                   data segments, nondiscardable code 
  2038.                                   segments, and the entry-point code 
  2039.                                   segment will be preloaded, unless any 
  2040.                                   segment and its relocation information 
  2041.                                   exceed 64K. If the %@AB@%PRELOAD%@AE@% attribute is 
  2042.                                   not assigned to these segments in the 
  2043.                                   module-definition (.DEF) file when you 
  2044.                                   link your application, the compiler will
  2045.                                   add the preload attribute and display a 
  2046.                                   warning. Resources and segments will 
  2047.                                   have the same segment alignment. This 
  2048.                                   alignment should be as small as possible
  2049.                                   to prevent the final executable file 
  2050.                                   from growing unnecessarily large. You 
  2051.                                   can set the alignment using the %@AB@%LINK%@AE@% %@AB@%%@AE@%
  2052.                                   %@AB@%/alignment%@AE@% option. See Chapter 2, 
  2053.                                   "Linking Applications: The Linker," for 
  2054.                                   more information.
  2055.  
  2056. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  2057. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2058. %@AB@%-T%@AE@%                                Creates an application that runs only 
  2059.                                   with Windows in protected (standard or 
  2060.                                   386 enhanced) mode. If the user attempts
  2061.                                   to run the application in real mode, 
  2062.                                   Windows will display a message box 
  2063.                                   telling the user that the application 
  2064.                                   cannot run in real mode.
  2065.  
  2066. %@AB@%-? %@AE@%or%@AB@% -H%@AE@%                          Displays a list of the %@AB@%RC%@AE@% command line 
  2067.                                   options. %@CR:C6A00030045 @%%@CR:C6A00030046 @%  
  2068.  
  2069. Options are not case-sensitive; for example,%@AB@% -r%@AE@% and %@AB@%-R%@AE@% are equivalent. You
  2070. can combine single-letter options if they do not require any additional
  2071. parameters. For example, the command:  %@NL@%
  2072.  
  2073. %@AS@%  RC -R -E -V SAMPLE.RC%@AE@%
  2074.  
  2075. is equivalent to the command:  %@NL@%
  2076.  
  2077. %@AS@%  RC -REV SAMPLE.RC%@AE@%
  2078.  
  2079.  
  2080. %@4@%%@AB@%Resource-file Parameter%@AE@%%@EH@%%@NL@%
  2081.  
  2082. The %@AB@%RC%@AE@% command's %@AI@%resource-file%@AE@% parameter specifies the name of the script
  2083. file that contains the names, types, filenames, and descriptions of the
  2084. resources you want to add to the .EXE file. It can also specify the name of
  2085. a compiled .RES file, in which case the Resource Compiler adds the compiled
  2086. resources to the executable file.%@CR:C6A00030047 @%%@NL@%
  2087.  
  2088.  
  2089. %@4@%%@AB@%Executable-file Parameter%@AE@%%@EH@%%@NL@%
  2090.  
  2091. The %@AB@%RC%@AE@% command's %@AI@%executable-file%@AE@% parameter specifies the name of the
  2092. executable file that the resources should be added to. If you do not specify
  2093. an executable file, the Resource Compiler uses the executable file with the
  2094. same name as the script file.  %@NL@%
  2095.  
  2096.  
  2097. %@3@%%@CR:C6A00030048 @%%@AB@%3.3.1  Compiling Resources Separately%@AE@%%@EH@%%@NL@%
  2098.  
  2099. By default, the Resource Compiler adds the compiled resources to the
  2100. specified executable file. Sometimes you might want to first compile the
  2101. resources and then add them to the executable file in separate steps. This
  2102. can be useful because resource files don't tend to change much after initial
  2103. development. You can save time by compiling your application's resources
  2104. separately, then adding the compiled .RES file to your executable file each
  2105. time you recompile the .EXE file.  %@NL@%
  2106.  
  2107. You can use the %@AB@%-R%@AE@% option to compile the resources separately, without
  2108. adding them to the executable file. When you use this option, the Resource
  2109. Compiler compiles the .RC file and creates a compiled resource .RES file.%@CR:C6A00030049 @%%@CR:C6A00030050 @%%@NL@%
  2110.  
  2111. For example, the following command reads the resource script file SAMPLE.RC
  2112. and creates the compiled resource file SAMPLE.RES.  %@NL@%
  2113.  
  2114. %@AS@%  RC -R SAMPLE.RC%@AE@%
  2115.  
  2116. The command does not add SAMPLE.RES to the executable file.%@CR:C6A00030051 @%%@NL@%
  2117.  
  2118.  
  2119. %@3@%%@CR:C6A00030052 @%%@AB@%3.3.2  Defining Names for the Preprocessor%@AE@%%@EH@%%@NL@%
  2120.  
  2121. You can specify conditional branching in a resource script file, based on
  2122. whether or not a term is defined on the %@AB@%RC%@AE@% command line using the %@AB@%-D%@AE@% option.%@CR:C6A00030053 @%%@NL@%
  2123.  
  2124. For example, suppose your application has a pop-up menu, the Debug menu,
  2125. which you want to appear only during debugging. When you compile the
  2126. application for normal use, the Debug menu is not included. The resource
  2127. script file contains the following statements to define the Debug menu:  %@NL@%
  2128.  
  2129. %@AS@%  MainMenu MENU
  2130. %@AS@%  BEGIN
  2131. %@AS@%    .
  2132. %@AS@%    .
  2133. %@AS@%    .
  2134. %@AS@%  #ifdef DEBUG
  2135. %@AS@%   POPUP "&Debug"
  2136. %@AS@%   BEGIN
  2137. %@AS@%    MENUITEM "&Memory usage", ID_MEMORY
  2138. %@AS@%    MENUITEM "&Walk data heap", ID_WALK_HEAP
  2139. %@AS@%   END
  2140. %@AS@%  #endif
  2141. %@AS@%  END%@AE@%
  2142.  
  2143. When compiling resources for a debugging version of the application, you
  2144. could include the Debug menu by using the following %@AB@%RC%@AE@% command:  %@NL@%
  2145.  
  2146. %@AS@%  RC -R -D DEBUG MYAPP.RC%@AE@%
  2147.  
  2148. To compile resources for a normal version of the application─one that does
  2149. not include the Debug menu─you could use the following %@AB@%RC %@AE@%command:  %@NL@%
  2150.  
  2151. %@AS@%  RC -R MYAPP.RC%@AE@%
  2152.  
  2153.  
  2154. %@3@%%@CR:C6A00030054 @%%@AB@%3.3.3  Renaming the Compiled Resource File%@AE@%%@EH@%%@NL@%
  2155.  
  2156. Normally, when compiling resources, the Resource Compiler names the compiled
  2157. resource file after the .RC file and places it in the same directory as the
  2158. script file. For example, when compiling MYAPP.RC, you would normally type:
  2159. %@NL@%
  2160.  
  2161. %@AS@%  RC -R MYAPP.RC%@AE@%
  2162.  
  2163. The compiler would then create a compiled resource file named MYAPP.RES in
  2164. the same directory as MYAPP.RC.  %@NL@%
  2165.  
  2166. The %@AB@%-FO%@AE@% option lets you give the resulting .RES file a name that differs
  2167. from the corresponding .RC script file. For example, to name the resulting
  2168. .RES file NEWFILE.RES, you could type:  %@NL@%
  2169.  
  2170. %@AS@%  RC -R -FO NEWFILE.RES MYAPP.RC%@AE@%
  2171.  
  2172. The %@AB@%-FO%@AE@% option can also place the .RES file in a different directory. For
  2173. example, typing the following command places the compiled resource file
  2174. MYAPP.RES in the directory C:\RESOURCE:%@CR:C6A00030055 @%%@NL@%
  2175.  
  2176. %@AS@%  RC -R -FO C:\SOURCE\RESOURCE\MYAPP.RES MYAPP.RC%@AE@%
  2177.  
  2178.  
  2179. %@3@%%@CR:C6A00030056 @%%@AB@%3.3.4  Controlling the Directories that RC Searches%@AE@%%@EH@%%@NL@%
  2180.  
  2181. Normally, the Resource Compiler searches for include files and resource
  2182. files (such as icon and cursor files) first in the current directory, and
  2183. then in the directories specified by the INCLUDE environment variable. (The
  2184. PATH environment variable has no effect on the directories that the Resource
  2185. Compiler searches.)  %@NL@%
  2186.  
  2187.  
  2188. %@4@%%@AB@%Adding a Directory to Search%@AE@%%@EH@%%@NL@%
  2189.  
  2190. You can use the %@AB@%-I%@AE@% option to add a directory to the list of directories that
  2191. the Resource Compiler searches. The compiler then searches the directories
  2192. in the following order:%@CR:C6A00030057 @%%@NL@%
  2193.  
  2194.  
  2195.   1.  The current directory.%@NL@%
  2196.  
  2197.   2.  The directory or directories you specify by using the %@AB@%-I%@AE@% option, in
  2198.       the order in which they appear on the command line.%@NL@%
  2199.  
  2200.   3.  The list of directories specified by the INCLUDE environment variable,
  2201.       in the order in which the variable lists them, unless you specify the
  2202.       %@AB@%-X%@AE@% option.%@NL@%
  2203.  
  2204.  
  2205. The following example compiles the resource script file MYAPP.RC and adds
  2206. the compiled resources to MYAPP.EXE:  %@NL@%
  2207.  
  2208. %@AS@%  RC -I C:\SOURCE\STUFF -I D:\RESOURCES MYAPP.RC MYAPP.EXE%@AE@%
  2209.  
  2210. When compiling the script file, the Resource Compiler searches for include
  2211. files and resource files first in the current directory, then in
  2212. C:\SOURCE\STUFF and D:\RESOURCES, and lastly in the directories specified by
  2213. the INCLUDE  environment variable.  %@NL@%
  2214.  
  2215.  
  2216. %@4@%%@AB@%Suppressing the INCLUDE Environment Variable%@AE@%%@EH@%%@NL@%
  2217.  
  2218. You can prevent the Resource Compiler from using the INCLUDE environment
  2219. variable when determining the directories to search. To do so, use the %@AB@%-X%@AE@%
  2220. option. The compiler then searches for files only in the current directory,
  2221. and in any directories you specify using the %@AB@%-I%@AE@% option.%@CR:C6A00030058 @%%@CR:C6A00030059 @%%@NL@%
  2222.  
  2223. The following example compiles the resource script file MYAPP.RC and adds
  2224. the compiled resources to MYAPP.EXE:  %@NL@%
  2225.  
  2226. %@AS@%  RC -X -I C:\SOURCE\STUFF MYAPP.RC MYAPP.EXE%@AE@%
  2227.  
  2228. When compiling the script file, the Resource Compiler searches for include
  2229. files and resource files first in the current directory and then in
  2230. C:\SOURCE\STUFF.  %@NL@%
  2231.  
  2232.  
  2233. %@3@%%@CR:C6A00030060 @%%@AB@%3.3.5  Displaying Progress Messages%@AE@%%@EH@%%@NL@%
  2234.  
  2235. Normally, the Resource Compiler does not display messages that report on its
  2236. progress as it compiles. You can, however, tell the compiler to display
  2237. these messages. To do so, use the %@AB@%-V%@AE@% option.%@CR:C6A00030061 @%%@NL@%
  2238.  
  2239. The following example causes the compiler to report on its progress as it
  2240. compiles the script file SAMPLE.RC, creates the compiled resource file
  2241. SAMPLE.RES, and adds the .RES file to the executable file SAMPLE.EXE:  %@NL@%
  2242.  
  2243. %@AS@%  RC -V SAMPLE.RC%@AE@%
  2244.  
  2245.  
  2246. %@2@%%@CR:C6A00030062 @%%@AB@%3.4  Summary%@AE@%%@EH@%%@NL@%
  2247.  
  2248. The Resource Compiler is a tool that lets you compile resources such as
  2249. icons, dialog boxes, and fonts into a binary file. You add the binary
  2250. resource file to the binary source files to produce an executable Windows
  2251. application.  %@NL@%
  2252.  
  2253. For information related to the Resource Compiler, see the following:  %@NL@%
  2254.  
  2255. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  2256. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2257. Creating icons, cursors, and      %@AI@%Tools%@AE@%: Chapter 4, "Designing Images: 
  2258. bitmaps                           SDKPaint"
  2259.  
  2260. Creating and editing dialog       %@AI@%Tools%@AE@%: Chapter 5, "Designing Dialog 
  2261. boxes                             Boxes: The Dialog Editor"
  2262.  
  2263. Creating fonts                    %@AI@%Tools%@AE@%: Chapter 6, "Designing Fonts: The 
  2264.                                   Font Editor"
  2265.  
  2266. Introduction to application       %@AI@%Guide to Programming%@AE@%: Chapter 7, "Menus"
  2267. menus                             
  2268.  
  2269. Introduction to controls, such    %@AI@%Guide to Programming%@AE@%: Chapter 8, 
  2270. as                                "Controls"
  2271. buttons and check boxes           
  2272.  
  2273. Introduction to dialog boxes;     %@AI@%Guide to Programming%@AE@%: Chapter 9, "Dialog
  2274. also                              Boxes"
  2275. explains how to use controls in   
  2276. dialog boxes                      
  2277.  
  2278. Syntax and descriptions of each   %@AI@%Reference%@AE@%, %@AI@%Volume 2%@AE@%: Chapter 8, 
  2279. resource statement and directive  "Resource Script Statements"
  2280.  
  2281.  
  2282.  
  2283.  
  2284.  
  2285.  
  2286. %@CR:C6A-Part 02 @%%@1@%%@AB@%PART II  Resource Editors%@AE@%%@EH@%%@NL@%
  2287. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2288.  
  2289. Part 2 describes how to use the Microsoft Windows resource editors:
  2290. SDKPaint, the Dialog Editor, and the Font Editor. SDKPaint lets you create
  2291. bitmaps, icons, and cursors for your application. The Dialog Editor lets you
  2292. create and test dialog boxes on the screen instead of defining dialog
  2293. statements in a resource script. The Font Editor lets you create fonts and
  2294. update information in the font file header.  %@NL@%
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301. %@CR:C6A00040001 @%%@1@%%@AB@%Chapter 4  Designing Images: SDKPaint%@AE@%%@EH@%%@NL@%
  2302. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2303.  
  2304. Microsoft Windows SDKPaint (%@AB@%SDKPAINT%@AE@%) lets you create bitmaps, icons, and
  2305. cursors for your applications. Using SDKPaint, you can draw bitmaps, icons,
  2306. and cursors and examine their appearance on screens of various colors. The
  2307. editor also simulates how images appear on different display devices.%@CR:C6A00040002 @%%@NL@%
  2308.  
  2309. This chapter describes the following:  %@NL@%
  2310.  
  2311.  
  2312.   ■   How SDKPaint works with bitmap, icon, and cursor files%@NL@%
  2313.  
  2314.   ■   The SDKPaint window, including its menu items and commands%@NL@%
  2315.  
  2316.   ■   Opening files and images within the files%@NL@%
  2317.  
  2318.   ■   Drawing with SDKPaint tools%@NL@%
  2319.  
  2320.   ■   Using the SDKPaint palette, including working with different color
  2321.       types%@NL@%
  2322.  
  2323.   ■   Customizing the palette, including editing colors, saving changes to
  2324.       the palette, and loading customized palettes%@NL@%
  2325.  
  2326.   ■   Defining a cursor hotspot%@NL@%
  2327.  
  2328.   ■   Using the clipboard to transfer images between editors, to move images
  2329.       from one resource to another, and to create multiple images
  2330. %@NL@%
  2331.  
  2332.  
  2333.  
  2334. %@2@%%@CR:C6A00040003 @%%@AB@%4.1  How SDKPaint Works with Files%@AE@%%@EH@%%@NL@%
  2335.  
  2336. SDKPaint creates or modifies bitmap (.BMP), icon (.ICO), and cursor (.CUR)
  2337. files.%@CR:C6A00040004 @%%@CR:C6A00040005 @%%@CR:C6A00040006 @%%@CR:C6A00040007 @%%@CR:C6A00040008 @%%@NL@%
  2338.  
  2339. You can include these files in the resource script that you use to compile
  2340. the resource (.RES) file. The .RES file is a component of the build that
  2341. produces an executable file for your application.  %@NL@%
  2342.  
  2343. Figure 4.1 illustrates the process of incorporating bitmap, icon, and cursor
  2344. files into an executable application. For detailed information on this
  2345. process, see Chapter 3, "Compiling Resources: The Resource Compiler."  %@NL@%
  2346.  
  2347. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2348.  
  2349.  
  2350. %@3@%%@CR:C6A00040009 @%%@AB@%4.1.1  File Types%@AE@%%@EH@%%@NL@%
  2351.  
  2352. The bitmap (.BMP) files that SDKPaint produces define device-independent
  2353. monochrome or color bitmaps. Each .BMP file defines one bitmap. Bitmaps that
  2354. you create and save using SDKPaint can range in size from 1-by-1 to 72-by-72
  2355. pixels.%@CR:C6A00040010 @%%@CR:C6A00040011 @%%@NL@%
  2356.  
  2357. Unlike bitmap files, icon (.ICO) and cursor (.CUR) files define a family of
  2358. images. Each image in an icon or cursor file is designed for display on a
  2359. different kind of device. SDKPaint distinguishes the different kinds of
  2360. images by pixel dimensions and color capabilities. For example, when the
  2361. application wants to use an icon, it requests the icon by name. Windows then
  2362. selects the appropriate icon image in the specified file according to the
  2363. pixel dimensions and color capabilities required by the device driver.%@CR:C6A00040012 @%%@CR:C6A00040013 @%%@CR:C6A00040014 @%%@NL@%
  2364.  
  2365.  
  2366. %@3@%%@CR:C6A00040015 @%%@AB@%4.1.2  Icon and Cursor Data: The SDKPAINT.DAT File%@AE@%%@EH@%%@NL@%
  2367.  
  2368. SDKPaint uses the SDKPAINT.DAT file to store display-device information for
  2369. individual icon or cursor images within a file. The SDKPAINT.DAT file you
  2370. install initially contains information about common display devices, such as
  2371. EGA and VGA.%@CR:C6A00040016 @%%@CR:C6A00040017 @%%@NL@%
  2372.  
  2373. SDKPAINT.DAT is an ASCII, comma-delimited file that you can edit to add
  2374. information about display devices. Each string in the file defines a display
  2375. device. A string is terminated by a carriage return (no null character) and
  2376. contains the following six fields:  %@NL@%
  2377.  
  2378. %@AS@%  name,num-colors,curs-horz-size,curs-vert-size,icon-horz-size,
  2379. %@AS@%icon-vert-size%@AE@%
  2380.  
  2381. Field definitions are as follows:  %@NL@%
  2382.  
  2383. %@AB@%Field%@AE@%                             %@AB@%Description%@AE@%
  2384. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2385. %@AI@%name%@AE@%                              Name of the display device. The name can
  2386.                                   contain up to 10 uppercase and lowercase
  2387.                                   letters.
  2388.  
  2389. %@AI@%num-colors%@AE@%                        Number of colors of the icon or cursor 
  2390.                                   image.
  2391.  
  2392. %@AI@%curs-horz-size%@AE@%                    Horizontal size of a cursor image in 
  2393.                                   pixels.
  2394.  
  2395. %@AI@%curs-vert-size%@AE@%                    Vertical size of a cursor image in 
  2396.                                   pixels.
  2397.  
  2398. %@AI@%icon-horz-size%@AE@%                    Horizontal size of an icon image in 
  2399.                                   pixels.
  2400.  
  2401. %@AI@%icon-vert-size%@AE@%                    Vertical size of an icon image in 
  2402.                                   pixels.
  2403.  
  2404. In addition to information about icon and cursor images, SDKPAINT.DAT  can
  2405. include comments. Indicate comments by placing a semicolon (;) at the
  2406. beginning of the comment line.  %@NL@%
  2407.  
  2408. For example, the following SDKPAINT.DAT file specifies information for icons
  2409. and cursors displayed on two devices:  %@NL@%
  2410.  
  2411. %@AS@%  ";This is a sample SDKPAINT.DAT file
  2412. %@AS@%        4-Plane,16,32,32,32,32
  2413. %@AS@%        3-Plane,16,32,32,32,32%@AE@%
  2414.  
  2415.  
  2416. This line is a comment.%@NL@%
  2417.  
  2418.  
  2419.  
  2420. This line defines a device with four color planes. The device displays
  2421. 16-color cursors and icons. Cursors and icons on this device are 32-by-32
  2422. pixels.%@NL@%
  2423.  
  2424.  
  2425.  
  2426. This line defines a device with three color planes, which also displays
  2427. 16-color cursors and icons. Cursors and icons on this device are also
  2428. 32-by-32 pixels.%@NL@%
  2429.  
  2430. SDKPaint displays information from the SDKPAINT.DAT file when you load an
  2431. icon or cursor image into SDKPaint. For information about loading images,
  2432. see "Loading an Image into the Workspace" in Section 4.3.3.%@CR:C6A00040018 @%%@NL@%
  2433.  
  2434.  
  2435. %@2@%%@CR:C6A00040019 @%%@AB@%4.2  The SDKPaint Window%@AE@%%@EH@%%@NL@%
  2436.  
  2437. The SDKPaint window varies with the kind of resource you are editing. Figure
  2438. 4.2 illustrates the SDKPaint window after a user has opened an icon file.%@CR:C6A00040020 @%%@NL@%
  2439.  
  2440. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2441.  
  2442. Regardless of the type of image you edit, the menu bar contains the
  2443. following menus:%@CR:C6A00040021 @%%@NL@%
  2444.  
  2445. %@TH:  72  3485 02 34 42 @%Menu                              Commands%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%File                              This menu contains the following                                   commands:                                  New─Initializes the workspace with a                                   bitmap, icon, or cursor image.                                  Open─Opens existing .BMP, .ICO, and .CUR                                  files for editing.                                  Save and Save As─Save changes to bitmaps,                                  icons, and cursors.                                  Exit─Exits the editor. %@CR:C6A00040022 @%%@CR:C6A00040023 @%%@CR:C6A00040024 @%%@CR:C6A00040025 @% Edit                              This menu contains the following                                   commands:                                  Undo─Restores the image to its state                                   before the last edit.                                   Copy─Moves an image to the clipboard.                                  Paste─Moves an image from the clipboard.Image                             This menu contains the following                                   commands:                                  New─Initializes the workspace with an                                   icon or cursor image.                                  Open─Opens images in a bitmap, icon, or                                   cursor file. %@CR:C6A00040026 @%%@CR:C6A00040027 @%%@CR:C6A00040028 @%%@CR:C6A00040029 @%%@CR:C6A00040030 @%                                   Save─Retains an icon or cursor currently                                  in the workspace.                                  Restore─Restores an image to its state                                   when initially loaded into the editor or                                  when last retained.                                  Clear─Sets to white all the pixels in                                   the work area.                                  Delete─Deletes an image from the work                                   area and clears the image from the                                   SDKPaint window.Brushsize                         This menu lets you choose among three                                   sizes of brushes to draw an image.Palette                           This menu contains the following                                   commands:                                  Edit Colors─Changes the currently                                   selected color to the hue you specify or                                  restores the color to its default value.                                  Get Colors─Loads a color palette (.PAL)                                   file into the                                   editor.                                  Save Colors─Saves newly-created colors                                   in a .PAL file.Hotspot                           This menu contains commands that let you                                  define or display the hotspot of a                                   cursor. For information about the                                   hotspot, see Section 4.7, "Defining the                                   Cursor Hotspot."%@CR:C6A00040031 @% %@CR:C6A00040032 @%%@CR:C6A00040033 @%%@TE:  72  3485 02 34 42 @%
  2446.  
  2447.  
  2448. %@2@%%@CR:C6A00040034 @%%@AB@%4.3  Opening Files and Images%@AE@%%@EH@%%@NL@%
  2449.  
  2450. Before editing an existing bitmap, icon, or cursor, you must first open a
  2451. file to prepare the workspace for the kind of image you are going to edit.%@CR:C6A00040035 @%%@NL@%
  2452.  
  2453.  
  2454. %@3@%%@CR:C6A00040036 @%%@AB@%4.3.1  Converting Files to 3.0 Format%@AE@%%@EH@%%@NL@%
  2455.  
  2456. When you open a version 2.0 or later bitmap, icon, or cursor file, SDKPaint
  2457. automatically converts it to 3.0 format as it is loaded into the editor.%@CR:C6A00040037 @%%@NL@%
  2458.  
  2459.  
  2460. %@3@%%@CR:C6A00040038 @%%@AB@%4.3.2  Opening Bitmaps%@AE@%%@EH@%%@NL@%
  2461.  
  2462. To open an existing bitmap file, choose the Open command from the File menu.
  2463. SDKPaint opens the file and loads its image into the workspace of the
  2464. SDKPaint window.%@NL@%
  2465.  
  2466. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2467. NOTE
  2468.  
  2469. %@AI@%SDKPaint opens and loads only 2-color and 16-color bitmaps.%@AE@%
  2470. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2471.  
  2472. If you are creating a new bitmap instead of editing one that exists, do the
  2473. following:%@CR:C6A00040039 @%%@NL@%
  2474.  
  2475.  
  2476.   1.  Choose the New command from the File menu. %@NL@%
  2477.  
  2478. %@STUB@%      The editor displays the Resource Type dialog box.%@NL@%
  2479.  
  2480.   2.  Choose the Bitmap option.%@NL@%
  2481.  
  2482. %@STUB@%      SDKPaint displays a dialog box that lets you enter the height and
  2483.       width of the bitmap image you are creating and placing in the file.
  2484.       The dialog box also prompts you for the number of bitmap colors.%@CR:C6A00040040 @%%@CR:C6A00040041 @%%@NL@%
  2485.  
  2486.   3.  Specify either 2 or 16 colors. %@NL@%
  2487.  
  2488. %@STUB@%      By default, the first time you open a bitmap file, SDKPaint uses
  2489.       values appropriate to the display on which it is running. If you
  2490.       subsequently open additional bitmap files, SDKPaint specifies by
  2491.       default the values of the most recently created bitmap.%@NL@%
  2492.  
  2493.  
  2494. SDKPaint prepares the workspace of the SDKPaint window for the bitmap image
  2495. that you will create.  %@NL@%
  2496.  
  2497.  
  2498. %@3@%%@CR:C6A00040042 @%%@AB@%4.3.3  Opening Icons and Cursors%@AE@%%@EH@%%@NL@%
  2499.  
  2500. Because icon and cursor files contain multiple images, you must first open a
  2501. file and then load a specified image into the workspace.  %@NL@%
  2502.  
  2503.  
  2504. %@4@%%@AB@%Specifying an Icon or Cursor File%@AE@%%@EH@%%@NL@%
  2505.  
  2506. To open an existing icon or cursor file, choose the Open command from the
  2507. File menu. SDKPaint offers you a choice of files to open.  %@NL@%
  2508.  
  2509. If you want to create icons or cursors that you will save in a new file,
  2510. choose the New command from the File menu.  %@NL@%
  2511.  
  2512. When SDKPaint displays the Resource Type dialog box, do the following:%@CR:C6A00040043 @%%@NL@%
  2513.  
  2514. %@TH:  37  2010 02 34 42 @%Image Type                        Procedure%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Icon                              To specify a new icon file:                                  1.  Choose the Icon option.                                   SDKPaint displays an Icon Sizes dialog                                   box. By default, SDKPaint displays icon                                   image information appropriate for the                                   display on which SDKPaint is running. %@CR:C6A00040044 @%%@CR:C6A00040045 @% %@CR:C6A00040046 @%                                   2.  Choose the device type from the                                   combo box.                                  If you want to create an icon image for                                   a different type of device, open the                                   drop-down combo box and choose the kind                                   of device you want to target.Cursor                            To specify a new cursor file, do the                                   following:                                  1.  Choose the Cursor option.                                   SDKPaint displays a Cursor Sizes dialog                                   box. By default, SDKPaint displays                                   cursor image information appropriate for                                  the display on which SDKPaint is running.                                  2.  Choose the device type from the                                   combo box.                                  If you want to create a cursor for a                                   different type of device, open the                                   drop-down combo box and choose the kind                                   of device you want to target.%@CR:C6A00040047 @%%@CR:C6A00040048 @%%@CR:C6A00040049 @% %@CR:C6A00040050 @%%@TE:  37  2010 02 34 42 @%
  2515.  
  2516.  
  2517. %@4@%%@AB@%Loading an Image into the Workspace%@AE@%%@EH@%%@NL@%
  2518.  
  2519. After opening a file, you can either load an existing image into the
  2520. workspace of the SDKPaint window or specify that you will create a new
  2521. image.  %@NL@%
  2522.  
  2523. To load an icon or cursor image with a specified pixel dimension into the
  2524. workspace, choose the Open command from the Image menu. SDKPaint first
  2525. prompts you for the image you want and then displays the image you select.%@CR:C6A00040051 @%%@NL@%
  2526.  
  2527. To load a new icon or cursor image with a specified pixel dimension into the
  2528. workspace, choose the New command from the Image menu. The editor displays a
  2529. dialog box that prompts you first for the characteristics of the image you
  2530. want to create and then asks for information about the pixel dimensions of
  2531. the image.  %@NL@%
  2532.  
  2533.  
  2534. %@2@%%@CR:C6A00040052 @%%@AB@%4.4  Drawing with SDKPaint Tools%@AE@%%@EH@%%@NL@%
  2535.  
  2536. Whether editing an existing image or creating a new image from scratch, use
  2537. the tools displayed at the bottom of the SDKPaint window to draw your
  2538. bitmap, icon, or cursor.%@CR:C6A00040053 @%%@CR:C6A00040054 @%%@CR:C6A00040055 @%%@NL@%
  2539.  
  2540. Table 4.1 illustrates and describes SDKPaint tools.  %@NL@%
  2541.  
  2542. Table 4.1  SDKPaint Tools
  2543.  
  2544. %@TH:  47  2928 02 16 30 30 @%Tool            Illustration                  Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Oil Can         %@AU@%(Please refer to the printed%@AE@%  Fills a bordered area with                 %@AU@%book)%@AE@%                         the current drawing color.Paintbrush      %@AU@%(Please refer to the printed%@AE@%  Paints the image using the                 %@AU@%book)%@AE@%                         current                                               drawing width and color. Rectangle       %@AU@%(Please refer to the printed%@AE@%  Draws a hollow rectangle                 %@AU@%book)%@AE@%                         using the                                               current drawing color.Full Rectangle  %@AU@%(Please refer to the printed%@AE@%  Draws a rectangle and fills                 %@AU@%book)%@AE@%                         it with the current drawing                                               color.Circle          %@AU@%(Please refer to the printed%@AE@%  Draws a hollow circle or                 %@AU@%book)%@AE@%                         ellipse using the current                                               drawing color.Full Circle     %@AU@%(Please refer to the printed%@AE@%  Draws a circle or ellipse                 %@AU@%book)%@AE@%                         and fills it with the                                               current drawing color.Line            %@AU@%(Please refer to the printed%@AE@%  Draws a straight line                 %@AU@%book)%@AE@%                         between selected star and                                               end points using the current                                              drawing color.Pick Rectangle  %@AU@%(Please refer to the printed%@AE@%  Selects a rectangular region                %@AU@%book)%@AE@%                         in the image. Choose the                                               Copy command from the Edit                                               menu to transfer the                                               selected portion of the                                               image to the clipboard.                                               Choose the Paste command                                               from the Edit menu to                                               transfer the contents of the                                              clipboard to the selected                                               region. The selected region                                               reverts to the entire                                               workspace following a copy                                               or paste operation.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  47  2928 02 16 30 30 @%
  2545.  
  2546.  
  2547. %@2@%%@CR:C6A00040056 @%%@AB@%4.5  Using the SDKPaint Palette%@AE@%%@EH@%%@NL@%
  2548.  
  2549. The SDKPaint palette defines available and currently selected colors for
  2550. drawing and display. SDKPaint displays two types of colors in the palette:
  2551. true colors and dithered colors. When you are creating a bitmap or icon, the
  2552. 16 colors that SDKPaint displays in the leftmost eight columns of the
  2553. palette are true colors. The remaining colors are dithered. When you are
  2554. creating a cursor, all colors of the palette are true colors.%@CR:C6A00040057 @%%@CR:C6A00040058 @%%@CR:C6A00040059 @%%@CR:C6A00040060 @%%@NL@%
  2555.  
  2556. The 16 true colors are red, green, and blue (RGB) values guaranteed to be
  2557. distinct on a device that displays 16 or more colors.  %@NL@%
  2558.  
  2559. If you are working with icons or cursors, you can get information about the
  2560. RGB values of a color on the palette by first selecting the color and then
  2561. choosing the Edit Colors command from the Palette menu. If you are editing a
  2562. bitmap image, you can also get the information by double-clicking the color.
  2563. The editor lists RGB values of the selected color in the Edit Colors dialog
  2564. box.%@CR:C6A00040061 @%%@CR:C6A00040062 @%%@NL@%
  2565.  
  2566. The palette differs with the type of resource you are editing. Figure 4.3
  2567. illustrates the palette that SDKPaint displays when you are editing a
  2568. bitmap.%@CR:C6A00040063 @%%@CR:C6A00040064 @%%@CR:C6A00040065 @%%@NL@%
  2569.  
  2570. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2571.  
  2572. The palette displays 16 true and 12 dithered colors that you can use to
  2573. define screen background.  %@NL@%
  2574.  
  2575. Figure 4.4 illustrates the palette that SDKPaint displays when you are
  2576. editing an icon.%@CR:C6A00040066 @%%@NL@%
  2577.  
  2578. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2579.  
  2580. The palette displays 16 true and 12 dithered colors.  %@NL@%
  2581.  
  2582. Figure 4.5 illustrates the palette that SDKPaint displays when you are
  2583. editing a cursor.%@CR:C6A00040067 @%%@CR:C6A00040068 @%%@NL@%
  2584.  
  2585. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2586.  
  2587. The palette indicates that you can use only black and white opaque colors to
  2588. define a cursor. The palette also displays 16 true colors that you can use
  2589. for screen and inverse color.%@CR:C6A00040069 @%%@NL@%
  2590.  
  2591. The following section describes how to use the colors that the palette
  2592. displays.  %@NL@%
  2593.  
  2594.  
  2595. %@3@%%@CR:C6A00040070 @%%@AB@%4.5.1  Working with Opaque, Screen, and Inverse Colors%@AE@%%@EH@%%@NL@%
  2596.  
  2597. Images comprise one or more of the following types of colors:  %@NL@%
  2598.  
  2599. %@AB@%Color%@AE@%                             %@AB@%Description%@AE@%
  2600. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2601. Color (opaque)                    Colors that retain their hue regardless 
  2602.                                   of the color of the screen.%@CR:C6A00040071 @% %@CR:C6A00040072 @% %@CR:C6A00040073 @%
  2603.  
  2604. Screen                            The color that defines the screen 
  2605.                                   background. %@CR:C6A00040074 @%
  2606.  
  2607. Inverse                           The color that is the inverse of the 
  2608.                                   screen color. SDKPaint always displays 
  2609.                                   the inverse color of the currently 
  2610.                                   specified screen color.%@CR:C6A00040075 @%
  2611.  
  2612. To select an opaque, screen, or inverse color from the palette, do the
  2613. following:  %@NL@%
  2614.  
  2615.  
  2616.   1.  Select the type of color you want to draw within the color type
  2617.       window.%@NL@%
  2618.  
  2619.   2.  Click the color displayed in the palette.%@NL@%
  2620.  
  2621. %@STUB@%      SDKPaint displays the selected color in the color type window.%@NL@%
  2622.  
  2623.  
  2624. When using the opaque color type, you can associate a color with the left
  2625. mouse button by clicking that color with the left mouse button. The color
  2626. you select appears in the box labeled "Left."  %@NL@%
  2627.  
  2628. To associate an opaque color with the right mouse button, click the color
  2629. with the right mouse button. The selected color appears in the box labeled
  2630. "Right."  %@NL@%
  2631.  
  2632. The following sections describe how to use opaque, screen, and inverse
  2633. colors.  %@NL@%
  2634.  
  2635.  
  2636. %@4@%%@AB@%Using Opaque Colors%@AE@%%@EH@%%@NL@%
  2637.  
  2638. The following describes the opaque color options for each image:%@CR:C6A00040076 @%%@NL@%
  2639.  
  2640. %@AB@%Image%@AE@%                             %@AB@%Color Options%@AE@%
  2641. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2642. Bitmap%@CR:C6A00040077 @%                            Bitmaps are either monochrome or color.%@CR:C6A00040078 @% 
  2643.  
  2644. Icon                              Icons can use the full spectrum of the 
  2645.                                   palette. %@CR:C6A00040079 @%%@CR:C6A00040080 @% %@CR:C6A00040081 @%
  2646.  
  2647. Cursor                            Cursors are monochrome. %@CR:C6A00040082 @% %@CR:C6A00040083 @%
  2648.  
  2649.  
  2650. %@4@%%@AB@%Using Screen Colors%@AE@%%@EH@%%@NL@%
  2651.  
  2652. Screen colors let you see how your icon or cursor looks against various
  2653. screens. SDKPaint displays screen colors in the viewing area of the SDKPaint
  2654. window. In addition to the selection method described above, you can change
  2655. screen colors as follows:%@CR:C6A00040084 @%%@CR:C6A00040085 @%%@CR:C6A00040086 @%%@NL@%
  2656.  
  2657.  
  2658.   ■   Select a color from the palette and then click in the viewing area.%@NL@%
  2659.  
  2660. %@STUB@%      This method changes the screen color, regardless of the color type you
  2661.       have selected. If you are currently drawing with the opaque color
  2662.       type, using this procedure changes the color of the screen to the
  2663.       color you select from the palette. %@NL@%
  2664.  
  2665.   ■   Select the inverse color type and then click a color in the palette. %@NL@%
  2666.  
  2667. %@STUB@%      SDKPaint displays the inverse color you have selected and
  2668.       automatically  displays the corresponding screen color. %@NL@%
  2669.  
  2670.  
  2671.  
  2672. %@4@%%@AB@%Using Inverse Colors%@AE@%%@EH@%%@NL@%
  2673.  
  2674. When the opaque colors of an icon or cursor are identical to the color of
  2675. the screen on which they are displayed, the icon or cursor is not visible.
  2676. Inverse colors are useful for defining the image when this condition occurs.
  2677. For example, if you outline an icon in an inverse color, the border of the
  2678. icon is visible when the screen and opaque colors are identical.%@CR:C6A00040087 @%%@CR:C6A00040088 @%%@CR:C6A00040089 @%%@NL@%
  2679.  
  2680. In addition to the selection method described in the preceding section, you
  2681. can change the inverse color by choosing a new screen color. When you change
  2682. the screen color, SDKPaint automatically displays the compatible inverse
  2683. color.  %@NL@%
  2684.  
  2685.  
  2686. %@2@%%@CR:C6A00040090 @%%@AB@%4.6  Customizing the Palette%@AE@%%@EH@%%@NL@%
  2687.  
  2688. SDKPaint lets you customize the palette by editing colors. After editing one
  2689. or more colors, you can save them in a special palette that you load into
  2690. the editor.%@CR:C6A00040091 @%%@NL@%
  2691.  
  2692. This section describes how to do the following:  %@NL@%
  2693.  
  2694.  
  2695.   ■   Edit colors for bitmaps and color icons%@NL@%
  2696.  
  2697.   ■   Save a palette that you have customized%@NL@%
  2698.  
  2699.   ■   Load a customized palette into the editor
  2700. %@NL@%
  2701.  
  2702.  
  2703.  
  2704. %@3@%%@CR:C6A00040092 @%%@AB@%4.6.1  Editing Colors%@AE@%%@EH@%%@NL@%
  2705.  
  2706. SDKPaint lets you edit the palette used to draw bitmaps and color icons. To
  2707. edit a color from the palette that is currently loaded in SDKPaint, do the
  2708. following:%@CR:C6A00040093 @%%@CR:C6A00040094 @%%@CR:C6A00040095 @%%@NL@%
  2709.  
  2710.  
  2711.   1.  Select the color you want to edit.%@NL@%
  2712.  
  2713.   2.  Choose the Edit Colors command from the Palette menu. %@NL@%
  2714.  
  2715. %@STUB@%      If you are editing a bitmap, you can also double-click the color on
  2716.       the palette. In either case, SDKPaint displays the Edit Colors dialog
  2717.       box.%@NL@%
  2718.  
  2719.   3.  Change the RGB values of the color.%@NL@%
  2720.  
  2721. %@STUB@%      The editor displays the changes to the color in the dialog box.%@NL@%
  2722.  
  2723.   4.  Choose OK if you are satisfied with the new color.%@NL@%
  2724.  
  2725. %@STUB@%      If you want to cancel your edits on the color, choose Cancel.%@NL@%
  2726.  
  2727.  
  2728.  
  2729. %@3@%%@CR:C6A00040096 @%%@AB@%4.6.2  Saving a Palette%@AE@%%@EH@%%@NL@%
  2730.  
  2731. After you customize a palette by editing selected colors on it, you can save
  2732. the palette for future use by choosing the Save Colors command from the
  2733. Palette menu. SDKPaint prompts you for the filename of the palette you are
  2734. saving.%@CR:C6A00040097 @%%@NL@%
  2735.  
  2736. SDKPaint assigns the extension .PAL to custom palettes by default.  %@NL@%
  2737.  
  2738.  
  2739. %@3@%%@CR:C6A00040098 @%%@AB@%4.6.3  Loading a Customized Palette%@AE@%%@EH@%%@NL@%
  2740.  
  2741. Choose the Get Colors command from the Palette menu to load a customized
  2742. palette into SDKPaint. SDKPaint prompts you for the name and location of the
  2743. palette you want to use.  %@NL@%
  2744.  
  2745. After you load the palette into SDKPaint, you can return to the default
  2746. palette by doing the following:%@CR:C6A00040099 @%%@NL@%
  2747.  
  2748.  
  2749.   1.  Choose the Edit Colors command from the Palette menu.%@NL@%
  2750.  
  2751.   2.  Select Default in the Edit Colors dialog box.%@NL@%
  2752.  
  2753.  
  2754.  
  2755. %@2@%%@CR:C6A00040100 @%%@AB@%4.7  Defining the Cursor Hotspot%@AE@%%@EH@%%@NL@%
  2756.  
  2757. To define the hotspot of a cursor do the following:  %@NL@%
  2758.  
  2759.  
  2760.   1.  Choose the Set Hotspot command from the Hotspot menu.%@NL@%
  2761.  
  2762. %@STUB@%      SDKPaint changes the cursor to a bullseye and displays a window that
  2763.       gives the coordinates of the cursor as you move it around the work
  2764.       area. %@NL@%
  2765.  
  2766.   2.  Click the left mouse button to define the hotspot. %@NL@%
  2767.  
  2768. %@STUB@%      Clicking the mouse button when the cursor is outside the work area
  2769.       disables the Set Hotspot command.%@CR:C6A00040101 @% %@CR:C6A00040102 @%%@CR:C6A00040103 @%%@CR:C6A00040104 @%%@NL@%
  2770.  
  2771.  
  2772. To show the current hotspot, choose the Show Hotspot command from the
  2773. Hotspot menu. The editor displays the coordinates of the current hotspot in
  2774. a window. To delete the window, choose Show Hotspot again.  %@NL@%
  2775.  
  2776.  
  2777. %@2@%%@CR:C6A00040105 @%%@AB@%4.8  Using the Clipboard%@AE@%%@EH@%%@NL@%
  2778.  
  2779. SDKPaint lets you transfer images to and from the clipboard using the Copy
  2780. and Paste commands from the Edit menu. Transferring images is useful to do
  2781. the following:%@CR:C6A00040106 @%%@NL@%
  2782.  
  2783.  
  2784.   ■   Load an image created using Paintbrush or another paint program.%@NL@%
  2785.  
  2786.   ■   Move an image from one resource type to another, such as when using a
  2787.       cursor image to create an icon.%@CR:C6A00040107 @%%@CR:C6A00040108 @%%@NL@%
  2788.  
  2789.   ■   Create multiple device-specific versions of one image.%@NL@%
  2790.  
  2791.  
  2792. The editor uses two data formats when transferring images to and from the
  2793. clipboard. To transfer opaque colors, SDKPaint uses the CF_BITMAP format. To
  2794. transfer inverse colors, the editor uses a private format. Many drawing
  2795. applications, such as Paintbrush, recognize the CF_BITMAP format.  %@NL@%
  2796.  
  2797. The image you transfer from the clipboard may be smaller or larger than the
  2798. selected rectangular region of the image. By default, the selected region is
  2799. the entire workspace; you can select a smaller region using the Pick
  2800. Rectangle tool.  %@NL@%
  2801.  
  2802. When the clipboard image is not the same size as the selected region,
  2803. SDKPaint displays a dialog box that gives you the following options:%@CR:C6A00040109 @%%@NL@%
  2804.  
  2805.  
  2806.   ■   Stretch/shrink Clipboard bitmap?%@NL@%
  2807.  
  2808.   ■   Clip Clipboard bitmap?%@NL@%
  2809.  
  2810.  
  2811. If you select the Stretch/shrink option, SDKPaint stretches or compresses
  2812. the image as necessary. For details about this process, see the description
  2813. of the %@AB@%StretchBlt%@AE@% function in the %@AI@%Reference, Volume 1%@AE@%.  %@NL@%
  2814.  
  2815. If you select the Clip option, SDKPaint pastes the clipboard bitmap to the
  2816. screen, justified on the top left corners of the workspace and viewing area.
  2817. SDKPaint modifies rows and columns of the image as follows:  %@NL@%
  2818.  
  2819. %@AB@%Size of Clipboard Bitmap%@AE@%          %@AB@%Rows and Columns Modified%@AE@%
  2820. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2821. Smaller than selected region      Rows at the bottom and columns at the 
  2822.                                   far right of the selected region
  2823.                                   remain unchanged.
  2824.  
  2825. Larger than selected region       SDKPaint clips rows at the bottom and 
  2826.                                   columns at the far right of the 
  2827.                                   clipboard bitmap.
  2828.  
  2829.  
  2830. %@2@%%@CR:C6A00040110 @%%@AB@%4.9  Using ZoomIn to Examine Images%@AE@%%@EH@%%@NL@%
  2831.  
  2832. The Microsoft Windows ZoomIn utility (%@AB@%ZOOMIN%@AE@%) allows you to examine screen
  2833. images in detail. ZoomIn captures images from the screen and expands or
  2834. contracts the size of the pixels of that image. For example, you could use
  2835. ZoomIn to capture the image of a character displayed with the system font,
  2836. expand that image to show the pixel pattern of the character, and then
  2837. duplicate the character in the image you are creating with SDKPaint.  %@NL@%
  2838.  
  2839. When you run ZoomIn, the utility displays a small overlapped window with a
  2840. vertical scroll bar. To capture an image, press the left mouse button while
  2841. the cursor is inside the client area of the ZoomIn window. A rectangle
  2842. appears that shows the size of the area on the screen which ZoomIn will
  2843. display. Drag the rectangle to the image on the screen you want to capture,
  2844. and then release the mouse button.  %@NL@%
  2845.  
  2846. To vary the detail of the image, use the vertical scroll bar of the ZoomIn
  2847. window. Scrolling up decreases the detail, and scrolling down increases the
  2848. detail. To change the size of the image captured by ZoomIn, resize the
  2849. ZoomIn window.  %@NL@%
  2850.  
  2851.  
  2852. %@2@%%@CR:C6A00040111 @%%@AB@%4.10  Summary%@AE@%%@EH@%%@NL@%
  2853.  
  2854. SDKPaint is a tool that lets you design bitmaps, icons, and cursors.  %@NL@%
  2855.  
  2856. For more information on subjects related to creating images, see the
  2857. following:%@NL@%
  2858.  
  2859. %@AB@%Subject%@AE@%                           %@AB@%Reference%@AE@%
  2860. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2861. Resource files                    %@AI@%Tools%@AE@%: Chapter 3, "Compiling Resources: 
  2862.                                   The Resource Compiler"
  2863.  
  2864. Icons                             %@AI@%Guide to Programming%@AE@%: Chapter 5, "Icons"
  2865.  
  2866. Cursors                           %@AI@%Guide to Programming%@AE@%: Chapter 6, "The 
  2867.                                   Cursor, the Mouse, and the Keyboard"
  2868.  
  2869. Bitmaps                           %@AI@%Guide to Programming%@AE@%: Chapter 11, 
  2870.                                   "Bitmaps"
  2871.  
  2872. Clipboard files                   %@AI@%Reference%@AE@%,%@AI@% Volume 2%@AE@%: Chapter 9, "File 
  2873.                                   Formats"
  2874.  
  2875.                                   
  2876.  
  2877.  
  2878.  
  2879.  
  2880.  
  2881.  
  2882. %@CR:C6A00050001 @%%@1@%%@AB@%Chapter 5  Designing Dialog Boxes: The Dialog Editor%@AE@%%@EH@%%@NL@%
  2883. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2884.  
  2885. Microsoft Windows Dialog Editor (%@AB@%DIALOG%@AE@%) is a tool that lets you design and
  2886. test a dialog box on the display screen instead of defining dialog
  2887. statements in a resource script. Using the Dialog Editor, you can add,
  2888. modify, and delete controls in a dialog box. The Dialog Editor saves the
  2889. changes you make as resource script statements. You then compile these
  2890. statements into a binary resource file that is linked to your application's
  2891. executable file.%@CR:C6A00050002 @%%@CR:C6A00050003 @%%@CR:C6A00050004 @%%@CR:C6A00050005 @%%@CR:C6A00050006 @%%@CR:C6A00050007 @%%@NL@%
  2892.  
  2893. This chapter describes the following topics:%@CR:C6A00050008 @%%@NL@%
  2894.  
  2895.  
  2896.   ■   How the Dialog Editor works with files%@NL@%
  2897.  
  2898.   ■   Installing custom controls%@NL@%
  2899.  
  2900.   ■   Viewing the Dialog Editor window%@NL@%
  2901.  
  2902.   ■   Opening resource files, include files, and dialog boxes%@NL@%
  2903.  
  2904.   ■   Editing individual controls%@NL@%
  2905.  
  2906.   ■   Working with groups of controls%@NL@%
  2907.  
  2908.   ■   Working with dialog boxes%@NL@%
  2909.  
  2910.   ■   Moving a dialog box between resources%@NL@%
  2911.  
  2912.   ■   Working with include files
  2913. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2914. NOTE
  2915.  
  2916. %@AI@%You must use a mouse or similar pointing device with the Dialog Editor.%@CR:C6A00050009 @%%@AE@%
  2917. ────────────────────────────────────────────────────────────────────────────%@NL@%
  2918.  
  2919. %@NL@%
  2920.  
  2921.  
  2922.  
  2923. %@2@%%@CR:C6A00050010 @%%@AB@%5.1  How the Dialog Editor Works with Files%@AE@%%@EH@%%@NL@%
  2924.  
  2925. The Dialog Editor creates or modifies the following types of files:%@CR:C6A00050011 @%%@CR:C6A00050012 @%%@CR:C6A00050013 @%%@NL@%
  2926.  
  2927. %@AB@%File Type%@AE@%                         %@AB@%Description%@AE@%
  2928. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2929. Dialog script (.DLG)              Text file containing %@AB@%DIALOG%@AE@% and %@AB@%CONTROL%@AE@% 
  2930.                                   statements that the Resource Compiler 
  2931.                                   interprets
  2932.  
  2933. Resource file (.RES)              Binary file containing multiple dialog 
  2934.                                   resources, and other resources such as 
  2935.                                   bitmaps, icons, menus, and string tables
  2936.                                   %@CR:C6A00050014 @% %@CR:C6A00050015 @% 
  2937.  
  2938. %@AB@%File Type%@AE@%                         %@AB@%Description%@AE@%
  2939. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  2940. Include file (.H)                 Text file containing %@AB@%#define%@AE@% constants 
  2941.                                   that are associated with symbol names 
  2942.                                   for the various controls located in a 
  2943.                                   dialog box %@CR:C6A00050016 @%%@CR:C6A00050017 @%
  2944.  
  2945. Figure 5.1 illustrates how the Dialog Editor manages these files.  %@NL@%
  2946.  
  2947. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  2948.  
  2949.  
  2950. %@3@%%@CR:C6A00050018 @%%@AB@%5.1.1  The Dialog Script%@AE@%%@EH@%%@NL@%
  2951.  
  2952. The most important output of the Dialog Editor is the dialog script (.DLG)
  2953. file. You can define more than one dialog box in a .DLG file. The following
  2954. exemplifies a .DLG script that Dialog Editor produces:%@CR:C6A00050019 @%%@CR:C6A00050020 @%%@NL@%
  2955.  
  2956. %@AS@%  FirstBox DIALOG LOADONCALL MOVEABLE DISCARDABLE 12, 20, 130, 113
  2957. %@AS@%  STYLE WS_DLGFRAME | WS_POPUP
  2958. %@AS@%  BEGIN
  2959. %@AS@%  CONTROL "Option 1", 102, "button", BS_RADIOBUTTON |
  2960. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 19, 28, 12
  2961. %@AS@%  CONTROL "Option 2", 103, "button", BS_RADIOBUTTON |
  2962. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 36, 28, 12
  2963. %@AS@%  CONTROL "Option 3", 104, "button", BS_RADIOBUTTON |
  2964. %@AS@%            WS_TABSTOP | WS_CHILD, 33, 53, 28, 12
  2965. %@AS@%  CONTROL "Ok", 1, "button", BS_PUSHBUTTON |
  2966. %@AS@%            WS_TABSTOP | WS_CHILD, 29, 86, 24, 14
  2967. %@AS@%  CONTROL "Cancel", 2, "button", BS_PUSHBUTTON |
  2968. %@AS@%            WS_TABSTOP | WS_CHILD, 70, 86, 24, 14
  2969. %@AS@%  END
  2970. %@AS@%  
  2971. %@AS@%  SecondBox DIALOG LOADONCALL MOVEABLE DISCARDABLE  30, 40, 135, 125
  2972. %@AS@%  STYLE WS_DLGFRAME | WS_POPUP
  2973. %@AS@%  BEGIN
  2974. %@AS@%            .
  2975. %@AS@%            .
  2976. %@AS@%            .%@AE@%
  2977.  
  2978. You include the dialog script within your application's resource script
  2979. (.RC) file by using an %@AB@%#include%@AE@% statement that refers to the .DLG file. If
  2980. you name the dialog script MYDLGS.DLG, your .RC file might look similar to
  2981. the following example:%@CR:C6A00050021 @%%@CR:C6A00050022 @%%@NL@%
  2982.  
  2983. %@AS@%  #include "mydlgs.h"
  2984. %@AS@%  .
  2985. %@AS@%  .
  2986. %@AS@%  .
  2987. %@AS@%  MainMenu  MENU
  2988. %@AS@%  BEGIN
  2989. %@AS@%     POPUP  "&File"
  2990. %@AS@%      BEGIN
  2991. %@AS@%          MENUITEM  "&New",  MI_FILE_NEW
  2992. %@AS@%          .
  2993. %@AS@%          .
  2994. %@AS@%           .
  2995. %@AS@%     END
  2996. %@AS@%  END
  2997. %@AS@%  
  2998. %@AS@%  #include "mydlgs.dlg"
  2999. %@AS@%  .
  3000. %@AS@%  .
  3001. %@AS@%  .%@AE@%
  3002.  
  3003. Using the %@AB@%#include%@AE@% directive, include the .DLG script into the application's
  3004. overall .RC script. Then compile the .RC text file to produce an .RES binary
  3005. file using the %@AB@%-r%@AE@% switch. Finally, link the .RES file into your
  3006. application's .EXE file.  %@NL@%
  3007.  
  3008. See Section 5.1.3, "The Include File," for more information on how to
  3009. include the .H header and the .DLG files.  %@NL@%
  3010.  
  3011.  
  3012. %@3@%%@CR:C6A00050023 @%%@AB@%5.1.2  The Resource File%@AE@%%@EH@%%@NL@%
  3013.  
  3014. The Dialog Editor produces an .RES file that is a companion to the .DLG
  3015. file. This .RES file is a compiled, binary representation of the dialog
  3016. script.%@CR:C6A00050024 @%%@NL@%
  3017.  
  3018. The purpose of the .RES file produced by the Dialog Editor is solely to
  3019. reedit the dialog script. The Dialog Editor does not read in .DLG files; it
  3020. reads only in .RES files. Note that this .RES file should not be linked to
  3021. your application's .EXE file because it does not include the other
  3022. resources─such as bitmaps, icons, menus, and string tables─required by your
  3023. application.  %@NL@%
  3024.  
  3025. There are two methods for reediting a dialog resource. The first method is
  3026. to read back into the Dialog Editor the .RES file that the editor produced
  3027. as a companion to the .DLG file.%@CR:C6A00050025 @%%@CR:C6A00050026 @%%@CR:C6A00050027 @%%@NL@%
  3028.  
  3029. The second method is to read into the Dialog Editor the .RES file that the
  3030. Resource Compiler produced from the combined .RC and .DLG scripts.  %@NL@%
  3031.  
  3032. Which method you choose is a matter of personal preference. The advantage of
  3033. the first method is that you can group together categories of dialog boxes
  3034. into separate .DLG files and their corresponding .RES files, and manage them
  3035. separately. Also, it is not necessary for you to use the Resource Compiler
  3036. to convert the .DLG text file into the binary .RES format required as input
  3037. to the Dialog Editor. The advantage of the second method is that you can
  3038. discard .RES files produced by the Dialog Editor and free up disk space.  %@NL@%
  3039.  
  3040.  
  3041. %@3@%%@CR:C6A00050028 @%%@AB@%5.1.3  The Include File%@AE@%%@EH@%%@NL@%
  3042.  
  3043. The include (.H) file produced by the Dialog Editor contains %@AB@%#define%@AE@%
  3044. statements that identify controls in dialog boxes.%@CR:C6A00050029 @%%@NL@%
  3045.  
  3046. When creating a dialog box, you can assign symbolic names to controls. You
  3047. use the symbolic names in your application's C source code to refer to the
  3048. controls. As a result of these assignments, the Dialog Editor produces a
  3049. header file containing %@AB@%#define%@AE@% statements such as the following:%@CR:C6A00050030 @%%@CR:C6A00050031 @%%@CR:C6A00050032 @%%@NL@%
  3050.  
  3051. %@AS@%  #define DI_OPTION1  102
  3052. %@AS@%  #define DI_OPTION2  103
  3053. %@AS@%  #define DI_OPTION3  104%@AE@%
  3054.  
  3055. By including the header file in your C source code with an %@AB@%#include%@AE@%
  3056. statement, you can refer to the controls by symbolic names, rather than
  3057. numeric values, as the following illustrates:  %@NL@%
  3058.  
  3059. %@AS@%  BOOL FAR PASCAL FirstDlgProc(hDlg, wMessage, wParam, lParam)
  3060. %@AS@%   .
  3061. %@AS@%   .
  3062. %@AS@%   .
  3063. %@AS@%  switch (wMessage)
  3064. %@AS@%  {
  3065. %@AS@%     case DI_OPTION1:
  3066. %@AS@%        /* Respond to Ok button here */
  3067. %@AS@%              break;        case DI_OPTION2:
  3068. %@AS@%       /* Respond to Cancel button here */
  3069. %@AS@%      break;
  3070. %@AS@%   .
  3071. %@AS@%  .
  3072. %@AS@%  .%@AE@%
  3073.  
  3074. You must include the header file in your application's resource script file
  3075. before including the dialog script. This is necessary because the dialog
  3076. script refers to the controls using the symbolic names instead of the
  3077. numeric values. For an example of including files, see Section 5.1.1, "The
  3078. Dialog Script."  %@NL@%
  3079.  
  3080. When assigning ID values to controls, you can assign any number you want;
  3081. however, there are some special guidelines for ID values 1 and 2.  %@NL@%
  3082.  
  3083.  
  3084. %@4@%%@AB@%ID Value of 1%@AE@%%@EH@%%@NL@%
  3085.  
  3086. When the user presses ENTER, Windows automatically sends a WM_COMMAND
  3087. message to the dialog-input function. If the dialog box has a default button
  3088. (for example, the OK button), pressing ENTER sends a WM_COMMAND message with
  3089. the ID value. If you have a default OK button, you should assign it an ID
  3090. value of 1 so that it is activated when the user presses ENTER. This is
  3091. consistent with the recommended guidelines for creating a Windows
  3092. application set forth in %@AI@%Guide to Programming%@AE@%.  %@NL@%
  3093.  
  3094. Windows defines the ID value of 1 as IDOK.  %@NL@%
  3095.  
  3096.  
  3097. %@4@%%@AB@%ID Value of 2%@AE@%%@EH@%%@NL@%
  3098.  
  3099. When the user presses CANCEL or ESCAPE, Windows automatically sends a
  3100. WM_COMMAND message with the ID value of 2. If you have a Cancel button in a
  3101. dialog box, it should have an ID value of 2.%@CR:C6A00050033 @%%@NL@%
  3102.  
  3103. Windows defines the ID value of 2 as IDCANCEL.  %@NL@%
  3104.  
  3105.  
  3106. %@2@%%@CR:C6A00050034 @%%@AB@%5.2  Installing and Removing Custom Controls%@AE@%%@EH@%%@NL@%
  3107.  
  3108. The Dialog Editor provides a menu and toolbox of standard controls─such as
  3109. edit fields and list boxes─that you can select when designing a dialog box.
  3110. In addition, you can incorporate nonstandard custom controls into a dialog
  3111. box.%@CR:C6A00050035 @%%@CR:C6A00050036 @%%@NL@%
  3112.  
  3113. You can develop or acquire any number of custom controls and maintain them
  3114. in a catalog recognized by the Dialog Editor. A custom control consists of a
  3115. dynamic-link library (DLL) that contains the window procedure for the
  3116. control. The DLL also contains functions that interact with the Dialog
  3117. Editor. For more information on developing custom controls, see %@AI@%Guide to
  3118. %@AI@%Programming%@AE@%.%@CR:C6A00050037 @%%@CR:C6A00050038 @%%@NL@%
  3119.  
  3120. The Dialog Editor maintains the catalog of custom controls in your WIN.INI
  3121. file under the heading [User Controls]. Each entry equates the name of a
  3122. custom control with the full pathname of the control's DLL file, as shown in
  3123. the following example:%@CR:C6A00050039 @%%@NL@%
  3124.  
  3125. %@AS@%  [user controls]
  3126. %@AS@%  rainbow = c:\myctrls\rainbow.dll%@AE@%
  3127.  
  3128. The Dialog Editor lets you add and remove custom controls from this catalog.
  3129. %@NL@%
  3130.  
  3131.  
  3132. %@3@%%@CR:C6A00050040 @%%@AB@%5.2.1  Installing a Custom Control%@AE@%%@EH@%%@NL@%
  3133.  
  3134. To install a custom control in the catalog, do the following:  %@NL@%
  3135.  
  3136.  
  3137.   1.  Choose the Add Custom Control command from the File menu.%@NL@%
  3138.  
  3139.   2.  Specify the full pathname of the DLL file that defines your custom
  3140.       control.%@CR:C6A00050041 @%%@NL@%
  3141.  
  3142.  
  3143. If you want to call up a custom control only during a Dialog Editor session,
  3144. without permanently adding it to your custom control catalog, then select
  3145. the Create Temporary Control radio button in the Add Control dialog box.%@CR:C6A00050042 @%%@NL@%
  3146.  
  3147. For information on working with custom controls, see Section 5.5, "Editing
  3148. Dialog Box Controls."  %@NL@%
  3149.  
  3150.  
  3151. %@3@%%@CR:C6A00050043 @%%@AB@%5.2.2  Removing a Custom Control%@AE@%%@EH@%%@NL@%
  3152.  
  3153. To remove a custom control from the catalog, choose the Remove Control
  3154. command from the File menu. The editor displays a Remove Control Library
  3155. dialog box that lists custom controls you can remove.%@CR:C6A00050044 @%%@NL@%
  3156.  
  3157.  
  3158. %@2@%%@CR:C6A00050045 @%%@AB@%5.3  Viewing a Dialog Box: The Dialog Editor Window%@AE@%%@EH@%%@NL@%
  3159.  
  3160. Figure 5.2 illustrates the Dialog Editor window after a user has loaded a
  3161. dialog box and has chosen the Toolbox and Status commands from the Options
  3162. menu.%@CR:C6A00050046 @%%@NL@%
  3163.  
  3164. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3165.  
  3166. The menu bar contains the following menus:%@CR:C6A00050047 @%%@NL@%
  3167.  
  3168. %@TH:  95  3875 02 34 42 @%Menu                              Commands%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%File                              This menu contains the following                                   commands:                                  New─Creates .DLG and companion .RES                                   files                                  Open─Opens existing .RES files for                                   editing                                  Save and Save As─Save changes to a                                   dialog boxes                                  Add Custom Control and Remove Custom                                   Control─Adds and removes members of your                                  custom control catalog                                  Exit─Exits the editorInclude                           This menu contains the following                                   commands:                                  New─Creates a new include file                                  Open─Opens an existing include file                                  Save and Save As─Save changes to include                                  files                                  View/Edit─Displays and edits include                                   files                                  Hex Values─Toggles the display of                                   hexadecimal and                                   decimal values in include filesDialog                            This menu contains the following                                   commands:                                  New─Creates a new dialog box                                  View─Lists current dialog boxes in the                                   resource file                                   Flags─Sets memory flags                                  Groups─Sets tab stops and group markers                                  Rename─Renames the current dialog box                                  Test─Toggles work and test modes to                                   allow you to test your dialog boxEdit                              This menu contains the following                                   commands:                                  Restore─Reverts to last saved version of                                  a dialog box                                  Cut─Moves a dialog box to the clipboard                                  Copy─Copies a dialog box to the                                   clipboard                                  Paste─Copies a dialog box from the                                   clipboard                                  Erase Dialog─Removes a dialog box                                  Styles─Changes the style of a control or                                  dialog box                                  Group Mode─Allows you to move a group of                                  controls as a unit                                  Duplicate Mode─Allows you to duplicate                                   controls by dragging themControl                           This menu contains different types of                                   controls that you can select for the                                   dialog box. Options                           This menu contains the following                                   commands:                                  Status─Displays and hides the Selected                                   Item Status window                                  Toolbox─Displays and hides the Toolbox                                   window                                  Grid─Allows you to specify grid                                   increments for aligning controls%@TE:  95  3875 02 34 42 @%
  3169.  
  3170.  
  3171. %@3@%%@CR:C6A00050048 @%%@AB@%5.3.1  The Mode Display%@AE@%%@EH@%%@NL@%
  3172.  
  3173. Beneath the menu bar, the Dialog Editor displays the mode you are currently
  3174. using. The modes are as follows:  %@NL@%
  3175.  
  3176. %@TH:  14   693 02 34 42 @%Mode                              Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Work                              Indicates you are creating or modifying                                   a dialog boxTest                              Indicates you are testing a box Work/Group                        Indicates that you are in the process of                                  selecting and moving a group of controlsWork/Copy                         Indicates that you are in the process of                                  duplicating                                   controls %@CR:C6A00050049 @%%@TE:  14   693 02 34 42 @%
  3177.  
  3178.  
  3179. %@3@%%@CR:C6A00050050 @%%@AB@%5.3.2  The Toolbox%@AE@%%@EH@%%@NL@%
  3180.  
  3181. The Toolbox is a convenient alternative to choosing controls from the
  3182. Control menu. Initially, the Dialog Editor does not display the Toolbox. If
  3183. you choose the Toolbox command in the Options menu, the editor displays the
  3184. toolbox in the upper-right corner of the window.%@CR:C6A00050051 @%%@CR:C6A00050052 @%%@NL@%
  3185.  
  3186. You can move the Toolbox by dragging its title bar.  %@NL@%
  3187.  
  3188.  
  3189. %@3@%%@CR:C6A00050053 @%%@AB@%5.3.3  The Selected Item Status Window%@AE@%%@EH@%%@NL@%
  3190.  
  3191. When you choose the Status command from the Options menu, the Dialog Editor
  3192. displays the Selected Item Status window in the lower-right corner of the
  3193. Dialog Editor window. You can move the Selected Item Status window or close
  3194. it by choosing the Status command from the Options menu a second time. The
  3195. window supplies the following information about the currently displayed
  3196. dialog box and its controls:%@CR:C6A00050054 @%%@CR:C6A00050055 @%%@CR:C6A00050056 @%%@NL@%
  3197.  
  3198. %@TH:  22  1176 02 34 42 @%Field                             Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Dialog                            The name of the dialog box being edited.(x, y)                            Position of the upper-left corner of the                                  selected dialog box or control.(cx, cy)                          Offset of the selected dialog box or                                   control.Control                           Type of control selected (for example,                                   Radio Button or Check Box). If the                                   dialog box itself is selected, the                                   editor displays "Dialog Box" in this                                   field.ID Value                          Identifier of the selected control. The                                   identifier is displayed                                   as either a number or a symbol. If the                                   dialog box is selected instead of a                                   control, no ID value is shown.%@TE:  22  1176 02 34 42 @%
  3199.  
  3200. Size and position values are given in horizontal and vertical dialog units.
  3201. The horizontal units are 1/4 of the dialog base width unit; the vertical
  3202. units are 1/8 of the dialog base height unit. The current dialog base units
  3203. are computed from the height and width of the current system font. The
  3204. %@AB@%GetDialogBaseUnits%@AE@% function returns the dialog base units in pixels.%@CR:C6A00050057 @%%@CR:C6A00050058 @%%@NL@%
  3205.  
  3206. When you change the dialog box or controls, the window reflects the change.
  3207. %@NL@%
  3208.  
  3209.  
  3210. %@2@%%@CR:C6A00050059 @%%@AB@%5.4  Opening Files and Dialog Boxes%@AE@%%@EH@%%@NL@%
  3211.  
  3212. After invoking %@AB@%DIALOG%@AE@%, you can open the following:  %@NL@%
  3213.  
  3214.  
  3215.   ■   An existing or new resource file%@NL@%
  3216.  
  3217.   ■   An existing or new include file%@NL@%
  3218.  
  3219.   ■   An existing or new dialog box%@NL@%
  3220.  
  3221.  
  3222. Whenever you open a new resource or include file, the editor offers you the
  3223. opportunity of saving your previous work.%@CR:C6A00050060 @%%@NL@%
  3224.  
  3225.  
  3226. %@3@%%@CR:C6A00050061 @%%@AB@%5.4.1  Opening a Resource File%@AE@%%@EH@%%@NL@%
  3227.  
  3228. Using the File menu, you can either create a new resource file or open an
  3229. existing resource file.%@CR:C6A00050062 @%%@NL@%
  3230.  
  3231. If opening an existing resource file, you can specify an .RES file that
  3232. either the Dialog Editor or the Resource Compiler created.  %@NL@%
  3233.  
  3234.  
  3235. %@3@%%@CR:C6A00050063 @%%@AB@%5.4.2  Opening an Include File%@AE@%%@EH@%%@NL@%
  3236.  
  3237. After you load a resource file, Dialog Editor prompts you for an include
  3238. file. The include file associates symbolic names with control identifiers.%@CR:C6A00050064 @%%@CR:C6A00050065 @%%@NL@%
  3239.  
  3240. If you are already working with an include file, you can choose to continue
  3241. working with it or open a new one.  %@NL@%
  3242.  
  3243. If you loaded an existing resource file, the Dialog Editor displays the Open
  3244. File window. To edit an include file, choose one of the files listed.  %@NL@%
  3245.  
  3246.  
  3247. %@3@%%@CR:C6A00050066 @%%@AB@%5.4.3  Opening a Dialog Box%@AE@%%@EH@%%@NL@%
  3248.  
  3249. If you are loading an existing resource file, the Dialog Editor offers you
  3250. the choice of opening an existing dialog box. The editor displays a list of
  3251. dialog boxes available for editing in the View Dialog window. If you want to
  3252. create a new dialog box in the existing resource file, choose the Cancel
  3253. button from the View Dialog window.%@CR:C6A00050067 @%%@NL@%
  3254.  
  3255.  
  3256. %@4@%%@AB@%Opening an Existing Dialog Box%@AE@%%@EH@%%@NL@%
  3257.  
  3258. To open an existing dialog box, choose it from the list that the View Dialog
  3259. window displays. The dialog box appears in the working area of the Dialog
  3260. Editor window.%@CR:C6A00050068 @%%@NL@%
  3261.  
  3262.  
  3263. %@4@%%@AB@%Creating a New Dialog Box%@AE@%%@EH@%%@NL@%
  3264.  
  3265. To create a new dialog box, choose the New command from the Dialog menu. The
  3266. Dialog Editor prompts you for a dialog box name.%@CR:C6A00050069 @%%@CR:C6A00050070 @%%@CR:C6A00050071 @%%@NL@%
  3267.  
  3268.  
  3269. %@2@%%@CR:C6A00050072 @%%@AB@%5.5  Editing Dialog Box Controls%@AE@%%@EH@%%@NL@%
  3270.  
  3271. The Dialog Editor lets you add, modify, and delete dialog box controls,
  3272. which are described in Table 5.1.  %@NL@%
  3273.  
  3274. Table 5.1  Dialog Box Controls
  3275.  
  3276. %@TH:  66  4516 02 23 26 27 @%Control                Illustration              Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Push button            %@AU@%(Please refer to the %@AE@%     Push buttons let the user                       %@AU@%printed book)%@AE@%             choose an immediate                                                  action, such as canceling                                                 the dialog box. %@CR:C6A00050073 @% %@CR:C6A00050074 @%Radio button           %@AU@%(Please refer to the %@AE@%     Radio buttons are                        %@AU@%printed book)%@AE@%             typically used in groups                                                  to give the user a choice                                                 of selections. The user                                                  can select only one radio                                                 button in a group at a                                                  time.%@CR:C6A00050075 @% %@CR:C6A00050076 @%Check box              %@AU@%(Please refer to the %@AE@%     Check boxes are                        %@AU@%printed book)%@AE@%             independent of one                                                  another, although two or                                                  more often appear next to                                                 each other to give the                                                  user a choice of                                                  selections. The user can                                                  turn any number of check                                                  boxes on or off at a                                                  given moment. %@CR:C6A00050077 @% %@CR:C6A00050078 @%Horizontal scroll bar  %@AU@%(Please refer to the %@AE@%     Scroll bars let the user                        %@AU@%printed book)%@AE@%             scroll data. They are                                                  usually associated with                                                  another control or window                                                 that                                                  contains text or graphics.                                                 %@CR:C6A00050079 @% %@CR:C6A00050080 @% %@CR:C6A00050081 @% Vertical scroll bar    %@AU@%(Please refer to the %@AE@%                       %@AU@%printed book)%@AE@%Edit                   %@AU@%(Please refer to the %@AE@%     Edit controls display                        %@AU@%printed book)%@AE@%             both numbers and text,                                                  and let the user type in                                                                                                   numbers and text. %@CR:C6A00050082 @%%@CR:C6A00050083 @% Static text            %@AU@%(Please refer to the %@AE@%     Static text controls                        %@AU@%printed book)%@AE@%             label other                                                  controls, such as edit                                                  controls. %@CR:C6A00050084 @% %@CR:C6A00050085 @% Group box              %@AU@%(Please refer to the %@AE@%     Group boxes enclose a                        %@AU@%printed book)%@AE@%             collection or group of                                                  other controls, such as a                                                 group of radio buttons. %@CR:C6A00050086 @% %@CR:C6A00050087 @%List box               %@AU@%(Please refer to the %@AE@%     List boxes display a list                       %@AU@%printed book)%@AE@%             of strings, such as file                                                  or directory names. %@CR:C6A00050088 @% %@CR:C6A00050089 @% Combo box              %@AU@%(Please refer to the %@AE@%     Combo boxes combine list                        %@AU@%printed book)%@AE@%             boxes with edit controls.                                                 %@CR:C6A00050090 @% %@CR:C6A00050091 @%Frame                  %@AU@%(Please refer to the %@AE@%     A hollow rectangle you                        %@AU@%printed book)%@AE@%             can use to frame a                                                  control or group of                                                  controls. %@CR:C6A00050092 @% %@CR:C6A00050093 @% %@TE:  66  4516 02 23 26 27 @%
  3277.  
  3278. Table 5.1  Dialog Box Controls (continued)
  3279.  
  3280. %@TH:  18  1225 02 11 32 33 @%Control    Illustration                    Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Icon       %@AU@%(Please refer to the printed %@AE@%   A rectangular space in which            %@AU@%book)%@AE@%                           you can place an icon. Do not                                            size the icon space; icons                                            automatically size themselves. %@CR:C6A00050094 @%                                           %@CR:C6A00050095 @% Rectangle  %@AU@%(Please refer to the printed %@AE@%   A filled rectangle you can use            %@AU@%book)%@AE@%                           for graphical emphasis. %@CR:C6A00050096 @% %@CR:C6A00050097 @% Custom                                     A control you design and define                                           in a DLL file. See Section 5.2,                                           "Installing and Removing Custom                                           Controls." %@CR:C6A00050098 @%%@CR:C6A00050099 @% %@CR:C6A00050100 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  18  1225 02 11 32 33 @%
  3281.  
  3282.  
  3283. %@3@%%@CR:C6A00050101 @%%@AB@%5.5.1  Adding Controls%@AE@%%@EH@%%@NL@%
  3284.  
  3285. The Dialog Editor lets you choose the controls you want to add to a dialog
  3286. box from either the Control menu or the Toolbox. The Toolbox displays an
  3287. icon for each control.%@CR:C6A00050102 @%%@NL@%
  3288.  
  3289.  
  3290. %@4@%%@AB@%Enabling the Toolbox%@AE@%%@EH@%%@NL@%
  3291.  
  3292. To enable the Toolbox, choose the Toolbox command from the Options menu. The
  3293. Dialog Editor displays the Toolbox in the upper-right section of the Dialog
  3294. Editor window. You can move the Toolbox by dragging its title bar.%@CR:C6A00050103 @%%@CR:C6A00050104 @%%@CR:C6A00050105 @%%@NL@%
  3295.  
  3296.  
  3297. %@4@%%@AB@%Adding Standard Controls%@AE@%%@EH@%%@NL@%
  3298.  
  3299. To add standard controls to a dialog box, do the following:  %@NL@%
  3300.  
  3301.  
  3302.   1.  Choose the control you want to add from either the Control menu or the
  3303.       Toolbox. %@NL@%
  3304.  
  3305. %@STUB@%      Choosing either a control command in the Control menu or a control
  3306.       icon in the Toolbox changes the cursor to a plus sign (+). %@NL@%
  3307.  
  3308.   2.  Position the cursor where you want to add the control.%@NL@%
  3309.  
  3310.   3.  Click the mouse button. %@NL@%
  3311.  
  3312.  
  3313. If the control includes text, add the text using the method described in
  3314. Section 5.5.2, "Working with Individual Controls."  %@NL@%
  3315.  
  3316.  
  3317. %@4@%%@AB@%Adding Custom Controls%@AE@%%@EH@%%@NL@%
  3318.  
  3319. After you have installed a custom control using the procedure described in
  3320. Section 5.2.1, "Installing a Custom Control," the control is accessible in
  3321. the Control menu and the Toolbox. To add the custom control to a dialog box,
  3322. choose either the Custom Control command from the Control menu or the Custom
  3323. Control icon from the Toolbox. The Dialog Editor displays the Select Custom
  3324. Control dialog box illustrated in Figure 5.3.%@CR:C6A00050106 @%%@NL@%
  3325.  
  3326. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3327.  
  3328. The window lets you select and view a specified custom control. To complete
  3329. the selection, choose the OK button.  %@NL@%
  3330.  
  3331. You can specify the styles for custom controls as you would standard
  3332. controls. For information about editing controls, see the next section.  %@NL@%
  3333.  
  3334.  
  3335. %@3@%%@CR:C6A00050107 @%%@AB@%5.5.2  Working with Individual Controls%@AE@%%@EH@%%@NL@%
  3336.  
  3337. The Dialog Editor lets you make changes to individual controls, as follows:
  3338. %@NL@%
  3339.  
  3340.  
  3341.   ■   Moving a control%@NL@%
  3342.  
  3343.   ■   Resizing a control%@NL@%
  3344.  
  3345.   ■   Changing control identifiers and styles%@NL@%
  3346.  
  3347.   ■   Adding or changing text associated with a control%@NL@%
  3348.  
  3349.   ■   Duplicating a control%@NL@%
  3350.  
  3351.   ■   Deleting a control
  3352. %@NL@%
  3353.  
  3354.  
  3355.  
  3356. %@4@%%@AB@%Moving a Control%@AE@%%@EH@%%@NL@%
  3357.  
  3358. The Dialog Editor lets you move individual controls. Use the mouse to drag a
  3359. control to its new position and the DIRECTION keys to make fine adjustments
  3360. to the control position.%@CR:C6A00050108 @%%@NL@%
  3361.  
  3362. The DIRECTION keys let you move a control horizontally and vertically by
  3363. dialog units. (For a description of dialog units, see Section 5.3.3, "The
  3364. Selected Item Status Window.") By default, controls move one dialog unit
  3365. each time you press a DIRECTION key. To change the distance moved, choose
  3366. the Grid command from the Options menu. The Grid command lets you specify
  3367. the number of dialog units moved along the %@AI@%x%@AE@% and %@AI@%y%@AE@% axes. If you choose new
  3368. grid coordinates after you have placed a control, the control will align
  3369. with the new grid coordinates when you move it.%@CR:C6A00050109 @%%@NL@%
  3370.  
  3371. For information about moving groups of controls, see Section 5.6, "Working
  3372. with Groups of Controls."  %@NL@%
  3373.  
  3374.  
  3375. %@4@%%@AB@%Resizing a Control%@AE@%%@EH@%%@NL@%
  3376.  
  3377. To change the size of a control, do the following:  %@NL@%
  3378.  
  3379.  
  3380.   1.  Select the control.%@NL@%
  3381.  
  3382.   2.  Drag one of the eight small rectangles that appear on the boundaries. %@CR:C6A00050110 @%%@CR:C6A00050111 @%%@NL@%
  3383.  
  3384.  
  3385. Dragging one of the corner rectangles changes the width and height of the
  3386. control simultaneously.  %@NL@%
  3387.  
  3388. The Grid command in the Options menu also affects how a control is resized.
  3389. When you resize the control, it will automatically size to the nearest grid
  3390. coordinate. However, if you select new grid coordinates and then resize the
  3391. control, the size of the control will change in increments of the grid
  3392. coordinates, but relative to the control's current position. The control
  3393. itself will not move when you resize it, even though it may no longer be
  3394. aligned with the grid. To ensure that a control aligns with new grid
  3395. coordinates, you must move the control.  %@NL@%
  3396.  
  3397.  
  3398. %@4@%%@AB@%Changing Control Identifiers and Styles%@AE@%%@EH@%%@NL@%
  3399.  
  3400. To change the identifier or style of a control, do the following:%@CR:C6A00050112 @%%@CR:C6A00050113 @%%@CR:C6A00050114 @%%@NL@%
  3401.  
  3402.  
  3403.   1.  Double-click the control, or select the control and choose the Styles
  3404.       command from the Edit menu. %@NL@%
  3405.  
  3406. %@STUB@%      The Dialog Editor displays a window that lists the identifier, text,
  3407.       and style of the control selected. Figure 5.4 illustrates the Button
  3408.       Control Style dialog box.%@CR:C6A00050115 @%%@CR:C6A00050116 @%%@CR:C6A00050117 @%%@NL@%
  3409.  
  3410. %@STUB@%      %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3411.  
  3412.   2.  To change the identifier, type the new identifier in the ID Value box.
  3413.       %@NL@%
  3414.  
  3415. %@STUB@%      If you supply a symbolic name instead of a numeric value, the Dialog
  3416.       Editor checks to determine whether or not you have already defined the
  3417.       name in the current include file. If you have not, the editor offers
  3418.       you the option of adding the name.%@NL@%
  3419.  
  3420.   3.  To change the style of a control, select the styles you want in the
  3421.       Styles box.%@NL@%
  3422.  
  3423.  
  3424.  
  3425. %@4@%%@AB@%Adding or Changing Text%@AE@%%@EH@%%@NL@%
  3426.  
  3427. In addition to changing identifiers and styles, the Style window lets you
  3428. add or modify text associated with a control.%@CR:C6A00050118 @%%@CR:C6A00050119 @%%@CR:C6A00050120 @%%@NL@%
  3429.  
  3430. To add or modify text, type the text in the Text box.  %@NL@%
  3431.  
  3432. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3433. NOTE
  3434.  
  3435. %@AI@%When you add an icon control to a dialog box, the names of the control and
  3436. %@AI@%the identifier in the .RC file should be the same. For example, if the .RC
  3437. %@AI@%file defines an icon as "myicon", name the control "myicon" also.%@AE@%
  3438. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3439.  
  3440.  
  3441. %@4@%%@AB@%Duplicating A Control%@AE@%%@EH@%%@NL@%
  3442.  
  3443. You can copy a control from an existing control in your dialog box by using
  3444. either of the following methods:  %@NL@%
  3445.  
  3446.  
  3447.   ■   Drag the original control while holding down the CONTROL key. The Mode
  3448.       Display beneath the menu bar indicates "Work/Copy" during this
  3449.       operation. A copy of the original control follows the cursor until you
  3450.       release the drag.%@CR:C6A00050121 @%%@CR:C6A00050122 @%%@NL@%
  3451.  
  3452.   ■   Choose the Duplicate Controls command from the Edit menu. While
  3453.       Duplicate Controls is selected, the Mode Display beneath the menu bar
  3454.       indicates "Work/Copy." In this mode, the effect of dragging a control
  3455.       is to duplicate it, rather than move it. To cancel this mode, toggle
  3456.       it by choosing the Duplicate Controls command again.%@NL@%
  3457.  
  3458.  
  3459.  
  3460. %@4@%%@AB@%Deleting A Control%@AE@%%@EH@%%@NL@%
  3461.  
  3462. To delete a control, select it and press the DELETE key or choose the Clear
  3463. Control command from the Edit menu. The Dialog Editor deletes the selected
  3464. control from the dialog box.%@CR:C6A00050123 @%%@CR:C6A00050124 @%%@NL@%
  3465.  
  3466.  
  3467. %@2@%%@CR:C6A00050125 @%%@AB@%5.6  Working with Groups of Controls%@AE@%%@EH@%%@NL@%
  3468.  
  3469. The Dialog Editor lets you do the following with groups of controls:  %@NL@%
  3470.  
  3471.  
  3472.   ■   Move controls as a group%@NL@%
  3473.  
  3474.   ■   Define the input focus sequence of a group
  3475. %@NL@%
  3476.  
  3477.  
  3478.  
  3479. %@3@%%@CR:C6A00050126 @%%@AB@%5.6.1  Moving Groups of Controls%@AE@%%@EH@%%@NL@%
  3480.  
  3481. To move a group of controls, do the following:  %@NL@%
  3482.  
  3483.  
  3484.   1.  Choose the Group Move command from the Edit menu. %@NL@%
  3485.  
  3486. %@STUB@%      The work mode will indicate "Work/Group."%@NL@%
  3487.  
  3488.   2.  Click each control in the group you want to move. %@NL@%
  3489.  
  3490. %@STUB@%      The editor outlines each control you select, and the group itself,
  3491.       with a gray line.%@CR:C6A00050127 @% %@CR:C6A00050128 @%%@NL@%
  3492.  
  3493.   3.  Click the mouse button while pointing to a location in the group
  3494.       rectangle not occupied by one of the controls.%@NL@%
  3495.  
  3496.   4.  While holding down the mouse button, drag the group of controls to a
  3497.       new position.%@NL@%
  3498.  
  3499.   5.  Cancel the "Work/Group" mode by toggling the Group Move command in the
  3500.       Edit menu.%@NL@%
  3501.  
  3502.  
  3503. You must select %@AI@%all%@AE@% the controls you want to move, even if one control
  3504. encloses another. For instance, to move several radio buttons and the group
  3505. box that encloses them, you must select each radio button %@AI@%and%@AE@% the group box,
  3506. and then move them as a unit.  %@NL@%
  3507.  
  3508.  
  3509. %@3@%%@CR:C6A00050129 @%%@AB@%5.6.2  Defining Input Focus Sequence%@AE@%%@EH@%%@NL@%
  3510.  
  3511. The Groups command in the Dialog menu lets you specify the input focus
  3512. sequence in a group of controls, as follows:%@CR:C6A00050130 @%%@CR:C6A00050131 @%%@NL@%
  3513.  
  3514.  
  3515.   ■   Specify the controls forming a group. A group defines a sequence of
  3516.       controls within which the user can shift input focus by using the
  3517.       DIRECTION keys.%@NL@%
  3518.  
  3519.   ■   Specify tab stops that define how input shifts from group to group as
  3520.       the user presses the TAB key.%@NL@%
  3521.  
  3522.   ■   Specify the sequential order in which individual and groups of
  3523.       controls receive input focus as the user presses DIRECTION and TAB
  3524.       keys.%@NL@%
  3525.  
  3526.  
  3527. When you choose the Groups command, the Dialog Editor displays the Order
  3528. Groups window illustrated in Figure 5.5.  %@NL@%
  3529.  
  3530. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3531.  
  3532.  
  3533. %@4@%%@AB@%Defining a Group%@AE@%%@EH@%%@NL@%
  3534.  
  3535. To specify a group of controls, place a group marker before the first
  3536. control in the group and another after the last control, as follows:%@CR:C6A00050132 @%%@CR:C6A00050133 @%%@CR:C6A00050134 @%%@CR:C6A00050135 @%%@NL@%
  3537.  
  3538.  
  3539.   1.  Select the first control in the group.%@NL@%
  3540.  
  3541.   2.  Click the Group Marker button.%@NL@%
  3542.  
  3543. %@STUB@%      The Dialog Editor inserts a group marker above the control. %@NL@%
  3544.  
  3545.   3.  Select the control below the last control in the group.%@NL@%
  3546.  
  3547.   4.  Click the Group Marker button. %@NL@%
  3548.  
  3549. %@STUB@%      The Dialog Editor inserts a group marker below the last control in the
  3550.       group. This marker defines the beginning of the next group.%@NL@%
  3551.  
  3552.  
  3553. Placing a group marker before a control instructs the Dialog Editor to
  3554. assign the WS_GROUP style to the control.  %@NL@%
  3555.  
  3556. To delete a group marker, select the group marker and click the Delete Group
  3557. button.%@CR:C6A00050136 @%%@CR:C6A00050137 @%%@NL@%
  3558.  
  3559.  
  3560. %@4@%%@AB@%Setting and Deleting Tab Stops%@AE@%%@EH@%%@NL@%
  3561.  
  3562. Tab stops determine where input focus shifts when the user presses the TAB
  3563. key. Set or delete tab stops on individual controls, or on the first control
  3564. in a group, as follows:%@CR:C6A00050138 @%%@CR:C6A00050139 @%%@CR:C6A00050140 @%%@NL@%
  3565.  
  3566.  
  3567.   1.  Select the control on which you want to set or remove a tab stop.%@NL@%
  3568.  
  3569.   2.  Click the Tab Stop or Delete Tab button to set or delete a tab,
  3570.       respectively. %@NL@%
  3571.  
  3572.  
  3573. An asterisk appears next to each control on which a tab stop is set.  %@NL@%
  3574.  
  3575. Placing a tab stop on a control instructs the Dialog Editor to assign the
  3576. WS_TABSTOP style to the control.  %@NL@%
  3577.  
  3578.  
  3579. %@4@%%@AB@%Changing the Input Focus Sequence of Controls%@AE@%%@EH@%%@NL@%
  3580.  
  3581. By default, controls receive input focus in the order in which you place
  3582. them in the dialog box, not their position in the dialog box. Repositioning
  3583. controls does not affect the order in which they receive input focus.  %@NL@%
  3584.  
  3585. To change the order in which controls receive user input, reorder the
  3586. controls listed in the Order Groups window as follows:%@CR:C6A00050141 @%%@CR:C6A00050142 @%%@NL@%
  3587.  
  3588.  
  3589.   1.  Select the control you want to move.%@NL@%
  3590.  
  3591.   2.  Move the cursor to the position where you want the control to appear
  3592.       in the list box. %@NL@%
  3593.  
  3594. %@STUB@%      The cursor changes from an arrow to a short, horizontal bar. The bar
  3595.       appears only in places where you can insert the control.%@NL@%
  3596.  
  3597.   3.  Click the mouse button to insert the control.%@NL@%
  3598.  
  3599.  
  3600.  
  3601. %@2@%%@CR:C6A00050143 @%%@AB@%5.7  Working with a Dialog Box%@AE@%%@EH@%%@NL@%
  3602.  
  3603. In addition to adding, changing, and deleting controls in a dialog box, you
  3604. can do the following to the box as a whole:  %@NL@%
  3605.  
  3606.  
  3607.   ■   Change its size and name%@NL@%
  3608.  
  3609.   ■   Define its styles%@NL@%
  3610.  
  3611.   ■   Set flags that indicate how Windows stores the box in memory%@NL@%
  3612.  
  3613.   ■   Erase the box
  3614. %@NL@%
  3615.  
  3616.  
  3617.  
  3618. %@3@%%@CR:C6A00050144 @%%@AB@%5.7.1  Resizing a Dialog Box%@AE@%%@EH@%%@NL@%
  3619.  
  3620. To change the size of a dialog box, select it and drag one of its resize
  3621. handles.%@CR:C6A00050145 @%%@NL@%
  3622.  
  3623. For information about resizing a control, see Section 5.5.2, "Working with
  3624. Individual Controls."  %@NL@%
  3625.  
  3626. The Grid command in the Options menu affects how a dialog box is resized.
  3627. When you resize the dialog box, it will automatically size to the nearest
  3628. grid coordinate. However, the presence of the grid does not affect how a
  3629. dialog box is moved.  %@NL@%
  3630.  
  3631.  
  3632. %@3@%%@CR:C6A00050146 @%%@AB@%5.7.2  Renaming a Dialog Box%@AE@%%@EH@%%@NL@%
  3633.  
  3634. To rename a dialog box, do the following:%@CR:C6A00050147 @%%@NL@%
  3635.  
  3636.  
  3637.   1.  Choose the Rename command from the Dialog menu.%@NL@%
  3638.  
  3639.   2.  Enter the new name in the Name Dialog window.%@NL@%
  3640.  
  3641.  
  3642.  
  3643. %@3@%%@CR:C6A00050148 @%%@AB@%5.7.3  Defining Styles%@AE@%%@EH@%%@NL@%
  3644.  
  3645. To define the styles of a dialog box, do the following:%@CR:C6A00050149 @%%@CR:C6A00050150 @%%@NL@%
  3646.  
  3647.  
  3648.   1.  Select the dialog box.%@NL@%
  3649.  
  3650.   2.  Choose the Styles command from the Edit menu.%@NL@%
  3651.  
  3652.   3.  Select the relevant styles from the Dialog Box Styles window.%@NL@%
  3653.  
  3654.  
  3655.  
  3656. %@3@%%@CR:C6A00050151 @%%@AB@%5.7.4  Setting Memory Flags%@AE@%%@EH@%%@NL@%
  3657.  
  3658. To set memory flags for the currently displayed dialog box, do the
  3659. following:%@CR:C6A00050152 @%%@CR:C6A00050153 @%%@NL@%
  3660.  
  3661.  
  3662.   1.  Choose the Flags command from the Dialog menu.%@NL@%
  3663.  
  3664.   2.  Select the relevant memory flags from the Memory Flags window.%@NL@%
  3665.  
  3666.  
  3667. Memory flags are as follows:  %@NL@%
  3668.  
  3669.  
  3670.   ■   Moveable─Dialog resource data segment can be moved in memory if
  3671.       necessary to compact memory.%@NL@%
  3672.  
  3673.   ■   Preload─Dialog resource data segment is loaded immediately.%@NL@%
  3674.  
  3675.   ■   Discard─Dialog resource data segment can be discarded if no longer
  3676.       needed.%@NL@%
  3677.  
  3678.  
  3679. By default, dialog boxes are moveable, loaded on call rather than preloaded,
  3680. and discardable.  %@NL@%
  3681.  
  3682. For more information about memory flags, see %@AI@%Guide to Programming%@AE@% and the
  3683. %@AI@%Reference, Volume 2%@AE@%.  %@NL@%
  3684.  
  3685.  
  3686. %@3@%%@CR:C6A00050154 @%%@AB@%5.7.5  Canceling Edits%@AE@%%@EH@%%@NL@%
  3687.  
  3688. To cancel edits on a dialog box, use either the Restore or the Clear command
  3689. from the Edit menu. The Restore command cancels edits and reloads the
  3690. currently displayed dialog box. The Clear command removes the currently
  3691. displayed dialog box from the work area and the resource.%@CR:C6A00050155 @%%@CR:C6A00050156 @%%@NL@%
  3692.  
  3693.  
  3694. %@2@%%@CR:C6A00050157 @%%@AB@%5.8  Moving a Dialog Box Between Resources%@AE@%%@EH@%%@NL@%
  3695.  
  3696. To move a dialog box from one resource file to another, use the Cut, Copy,
  3697. and Paste commands from the Edit menu, as follows:%@CR:C6A00050158 @%%@NL@%
  3698.  
  3699.  
  3700.   1.  Cut or copy the currently displayed dialog box to the clipboard. %@NL@%
  3701.  
  3702. %@STUB@%      The Cut command removes the dialog box from the work area and copies
  3703.       the resource to the clipboard; the Copy command copies the box to the
  3704.       clipboard.%@NL@%
  3705.  
  3706.   2.  Load a new resource file into the Dialog Editor.%@NL@%
  3707.  
  3708.   3.  Paste the dialog box from the clipboard to the work area.%@NL@%
  3709.  
  3710.  
  3711. The Dialog Editor supports the clipboard bitmap format (CF_BITMAP) so that
  3712. other clipboard viewers can paste dialog box images. The editor also uses a
  3713. private clipboard format, "Dialog," for its own use. The Dialog Editor can
  3714. paste from the clipboard only if an instance of the Dialog Editor has
  3715. previously copied data to the clipboard in the private "Dialog" format.%@CR:C6A00050159 @%%@NL@%
  3716.  
  3717.  
  3718. %@2@%%@CR:C6A00050160 @%%@AB@%5.9  Working with Include Files%@AE@%%@EH@%%@NL@%
  3719.  
  3720. Dialog Editor lets you create and modify include files that define symbolic
  3721. names for controls.%@CR:C6A00050161 @%%@NL@%
  3722.  
  3723. This section describes the following:  %@NL@%
  3724.  
  3725.  
  3726.   ■   How to create new include files when editing a dialog box%@NL@%
  3727.  
  3728.   ■   How to load existing include files into the Dialog Editor%@NL@%
  3729.  
  3730.   ■   How to edit include files%@NL@%
  3731.  
  3732.   ■   How to save include files%@NL@%
  3733.  
  3734.  
  3735. Table 5.2 describes the commands used for editing include files.  %@NL@%
  3736.  
  3737. Table 5.2  Commands for Editing Include Files
  3738.  
  3739. %@TH:  19   899 02 34 42 @%Command                           Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%New                               Creates a new include file.Open                              Opens an existing include file.Save                              Saves a specified include file.Save As                           Renames an include file and saves it.View/Edit                         Displays the View/Edit Include File                                   window. This window enables the user to                                   edit symbolic definitions for controls.Hex Values                        Toggles the display of identifier values                                  between decimal and hexidecimal.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  19   899 02 34 42 @%
  3740.  
  3741. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3742. NOTE
  3743.  
  3744. %@AI@%The Dialog Editor works with include files that have only %@AB@%#define%@AE@%%@AI@%
  3745. %@AI@%directives. The Dialog Editor will not work with header files that contain
  3746. %@AI@%other directives, such as %@AE@%%@AI@%%@AB@%typedef%@AE@%%@AE@%%@AI@%, or comments preceded by a semicolon ( ;
  3747. %@AI@%). When the Dialog Editor saves the include file, it strips out any blank
  3748. %@AI@%lines that may have existed previously in the include file.%@AE@%%@AE@%
  3749.  
  3750. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3751.  
  3752.  
  3753. %@3@%%@CR:C6A00050162 @%%@AB@%5.9.1  Creating New Include Files%@AE@%%@EH@%%@NL@%
  3754.  
  3755. The Dialog Editor lets you create new include files to define symbol names
  3756. for controls in your dialog boxes. You can create new include files either
  3757. when you create a new resource file or when you are editing a dialog box.%@CR:C6A00050163 @%%@CR:C6A00050164 @%%@NL@%
  3758.  
  3759. Typically, you create a new include file when creating a new resource file.
  3760. After creating a new resource file using the method described in Section
  3761. 5.4.1, "Opening a Resource File," the Dialog Editor asks whether or not you
  3762. want to create a new include file.  %@NL@%
  3763.  
  3764. When creating a new include file, you can give it a name identical to the
  3765. resource filename. Giving the resource and include files identical names
  3766. causes the Dialog Editor to open the include file automatically each time
  3767. you load the corresponding resource file into the editor. If you give the
  3768. resource file and include file different filenames, the Dialog Editor
  3769. prompts you for the include file you want to open.  %@NL@%
  3770.  
  3771. If you want to create a new include file while you are editing a dialog box,
  3772. choose the New command from the Include menu.  %@NL@%
  3773.  
  3774.  
  3775. %@3@%%@CR:C6A00050165 @%%@AB@%5.9.2  Loading Existing Include Files%@AE@%%@EH@%%@NL@%
  3776.  
  3777. Just as you can create a new include file either when loading a resource
  3778. file at the beginning of an editing session or later when editing a dialog
  3779. box, you can load existing include files either at the beginning or during
  3780. your editing session.%@CR:C6A00050166 @%%@CR:C6A00050167 @%%@NL@%
  3781.  
  3782. Typically, you load an existing include file into the editor at the
  3783. beginning of an editing session. When you open a resource file at the
  3784. beginning of a session, the Dialog Editor automatically loads the
  3785. corresponding include file, if the file has the same name as the resource
  3786. file you open. If the include filename is different than the resource
  3787. filename, the editor asks you to select the include file you want to open.  %@NL@%
  3788.  
  3789. If you want to open an existing include file while you are editing a dialog
  3790. box, choose the Open command from the Include menu. The Dialog Editor
  3791. displays an Open File window that lists include files you can load.  %@NL@%
  3792.  
  3793.  
  3794. %@3@%%@CR:C6A00050168 @%%@AB@%5.9.3  Editing Include Files%@AE@%%@EH@%%@NL@%
  3795.  
  3796. You can edit an include file in the following ways:%@CR:C6A00050169 @%%@CR:C6A00050170 @%%@NL@%
  3797.  
  3798.  
  3799.   ■   Select individual controls and define their symbolic names.%@NL@%
  3800.  
  3801.   ■   Open the file and edit its symbolic names and identifiers.%@NL@%
  3802.  
  3803.  
  3804. The second method lets you define symbolic names for controls as you work
  3805. with them.%@CR:C6A00050171 @%%@NL@%
  3806.  
  3807.  
  3808. %@4@%%@AB@%Defining Names by Individual Control%@AE@%%@EH@%%@NL@%
  3809.  
  3810. Instead of opening an include file and editing it as a whole, you can define
  3811. symbolic names for individual controls as you work with them. The Dialog
  3812. Editor saves the names in the include file that you loaded into the editor.
  3813. %@NL@%
  3814.  
  3815. To define the symbolic name of an individual control as you are working with
  3816. it, do the following:  %@NL@%
  3817.  
  3818.  
  3819.   1.  Double-click the control. %@NL@%
  3820.  
  3821. %@STUB@%      The Dialog Editor displays a Style window.%@NL@%
  3822.  
  3823.   2.  Enter the symbolic name of the control in the ID Value field. %@NL@%
  3824.  
  3825. %@STUB@%      If you have not defined the symbolic name before, the Dialog Editor
  3826.       displays the following warning message: "That symbol does not exist."%@NL@%
  3827.  
  3828.   3.  Click the OK button in the Warning Message window. %@NL@%
  3829.  
  3830. %@STUB@%      The Dialog Editor displays the View/Edit Include File window with the
  3831.       symbolic name you have defined for the control.%@NL@%
  3832.  
  3833.   4.  Click the Add button to complete adding the symbolic name to the
  3834.       include file.%@NL@%
  3835.  
  3836.  
  3837.  
  3838. %@4@%%@AB@%Editing the File%@AE@%%@EH@%%@NL@%
  3839.  
  3840. To edit an include file, do the following:%@CR:C6A00050172 @%%@CR:C6A00050173 @%%@CR:C6A00050174 @%%@CR:C6A00050175 @%%@NL@%
  3841.  
  3842.  
  3843.   1.  Choose the View/Edit command from the Include menu. The editor
  3844.       displays the View/Edit Include File window.%@NL@%
  3845.  
  3846.   2.  Select the symbol you want to edit.%@NL@%
  3847.  
  3848.   3.  Make the change in the Symbol Name or ID Value text box.%@NL@%
  3849.  
  3850.   4.  Choose the Change button. %@NL@%
  3851.  
  3852.   5.  Select the symbol and choose the Delete command.%@NL@%
  3853.  
  3854.  
  3855.  
  3856. %@3@%%@CR:C6A00050176 @%%@AB@%5.9.4  Saving Include Files%@AE@%%@EH@%%@NL@%
  3857.  
  3858. When saving an include file, give the file a name identical to the name of
  3859. its corresponding resource file, if possible. If the resource file and
  3860. include file have the same name, the Dialog Editor loads the include file
  3861. automatically when you open its corresponding resource file.%@CR:C6A00050177 @%%@CR:C6A00050178 @%%@NL@%
  3862.  
  3863.  
  3864. %@2@%%@CR:C6A00050179 @%%@AB@%5.10  Summary%@AE@%%@EH@%%@NL@%
  3865.  
  3866. This chapter described the Dialog Editor, a tool that lets you design a
  3867. dialog box on the display screen instead of defining dialog statements in a
  3868. resource script file. For further information, see the following:  %@NL@%
  3869.  
  3870. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  3871. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3872. Resource file                     %@AI@%Tools%@AE@%: Chapter 3, "Compiling Resources: 
  3873. management                        The Resource Compiler"
  3874.  
  3875. Introduction to dialog boxes      %@AI@%Guide to Programming%@AE@%: Chapter 8, 
  3876.                                   "Controls," and Chapter 9, "Dialog 
  3877.                                   Boxes"
  3878.  
  3879. Memory flags                      %@AI@%Guide to Programming%@AE@%: Chapter 15, 
  3880.                                   "Memory
  3881.                                   Management" and %@AI@%Reference, Volume 2%@AE@%: 
  3882.                                   Chapter 8, "Resource Script Statements"
  3883.  
  3884. Control and dialog box styles     %@AI@%Reference, Volume 2%@AE@%: Chapter 8, 
  3885.                                   "Resource Script Statements"
  3886.  
  3887.                                   %@AI@%System Application Architecture, Common %@AE@%
  3888.                                   %@AI@%User Access: Advanced Interface Design %@AE@%
  3889.                                   %@AI@%Guide%@AE@%
  3890.  
  3891.  
  3892.  
  3893.  
  3894.  
  3895. %@CR:C6A00060001 @%%@1@%%@AB@%Chapter 6  Designing Fonts: The Font Editor%@AE@%%@EH@%%@NL@%
  3896. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3897.  
  3898. Microsoft Windows Font Editor (%@AB@%FONTEDIT%@AE@%) lets you modify existing fonts to
  3899. create new fonts for your applications. Using the Font Editor, you can
  3900. modify each character in a font, or the height, width, and character mapping
  3901. of a font itself. In addition, you can use the editor to update information
  3902. in the font file header.%@CR:C6A00060002 @%%@NL@%
  3903.  
  3904. This chapter describes the following:%@CR:C6A00060003 @%%@NL@%
  3905.  
  3906.  
  3907.   ■   Editing letters, numbers, and other characters in the font%@NL@%
  3908.  
  3909.   ■   Modifying the height, width, and character mapping of the font%@NL@%
  3910.  
  3911.   ■   Changing information in the font file header%@NL@%
  3912.  
  3913.  
  3914. You can use the Font Editor only to create and edit raster fonts.  %@NL@%
  3915.  
  3916. After creating a new font with the Font Editor, you must add the new font to
  3917. a font resource file.  %@NL@%
  3918.  
  3919. For information on creating vector fonts and adding fonts to the font
  3920. resource file, see the %@AI@%Reference, Volume 2%@AE@%.%@CR:C6A00060004 @%%@CR:C6A00060005 @%%@CR:C6A00060006 @%%@CR:C6A00060007 @%%@NL@%
  3921.  
  3922. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3923. NOTE
  3924.  
  3925. %@AI@%You must use a mouse or similar pointing device with the Font Editor.%@CR:C6A00060008 @%%@AE@%
  3926.  
  3927. ────────────────────────────────────────────────────────────────────────────%@NL@%
  3928.  
  3929.  
  3930. %@2@%%@CR:C6A00060009 @%%@AB@%6.1  Opening a Font%@AE@%%@EH@%%@NL@%
  3931.  
  3932. To create a new font, you must open and edit an existing font. You cannot
  3933. create a new font from scratch. The font file you open must be in Windows
  3934. 2.0 or 3.0 format.%@CR:C6A00060010 @%%@CR:C6A00060011 @%%@NL@%
  3935.  
  3936. If you do not have an existing 2.0 or 3.0 font to edit, the SDK disks
  3937. provide two "seed" fonts that are installed in your Windows development
  3938. tools directory (named \WINDEV by default). The ATRM1111.FNT is a
  3939. fixed-pitch font, while the VGASYS.FNT is a variable-pitch font.  %@NL@%
  3940.  
  3941. After opening a font, the Font Editor displays the font, a specified
  3942. character, and information about the character. Figure 6.1 illustrates the
  3943. Font Editor window.  %@NL@%
  3944.  
  3945. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  3946.  
  3947. The Font Editor window has the following features:%@CR:C6A00060012 @%%@CR:C6A00060013 @%%@CR:C6A00060014 @%%@CR:C6A00060015 @%%@NL@%
  3948.  
  3949. %@AB@%Feature%@AE@%                           %@AB@%Description%@AE@%
  3950. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  3951. Character window                  Contains a copy of the character you 
  3952.                                   want to edit. A grid divides the window 
  3953.                                   into rectangles. Each rectangle 
  3954.                                   represents a pixel. %@CR:C6A00060016 @%%@CR:C6A00060017 @%
  3955.  
  3956. Character-viewing window          Displays two instances of the character 
  3957.                                   in its normal size. The 
  3958.                                   character-viewing window lets you 
  3959.                                   examine the effect of the changes you 
  3960.                                   make to the character. It also lets you 
  3961.                                   see external character leading, the 
  3962.                                   amount of vertical separation between 
  3963.                                   lines. %@CR:C6A00060018 @%%@CR:C6A00060019 @%
  3964.  
  3965. Character information             Displays the character ANSI value and 
  3966.                                   the character width and height in pixels.
  3967.                                   %@CR:C6A00060020 @% %@CR:C6A00060021 @% 
  3968.  
  3969. Font window                       Displays normal-size copies of the 
  3970.                                   characters in the font. This window is 
  3971.                                   moveable.%@CR:C6A00060022 @%
  3972.  
  3973. The following sections describe how to edit characters displayed in the Font
  3974. Editor window.  %@NL@%
  3975.  
  3976.  
  3977. %@2@%%@CR:C6A00060023 @%%@AB@%6.2  Editing Characters%@AE@%%@EH@%%@NL@%
  3978.  
  3979. The Font Editor lets you change characters. This section describes how to
  3980. change characters in the following ways:  %@NL@%
  3981.  
  3982.  
  3983.   ■   By turning on and off individual pixels%@NL@%
  3984.  
  3985.   ■   By adding and deleting columns or rows of pixels%@NL@%
  3986.  
  3987.   ■   By modifying specified blocks of pixels%@CR:C6A00060024 @%%@CR:C6A00060025 @%%@CR:C6A00060026 @%%@NL@%
  3988.  
  3989.   ■   By changing the width of a specified character, if the character
  3990.       belongs to a variable-pitch font%@CR:C6A00060027 @%%@NL@%
  3991.  
  3992. %@STUB@%      %@AI@%NOTE  %@AE@%When you select a new character for editing, the Font Editor
  3993.       updates the current workspace with the character you have edited. If
  3994.       you do not want to save your edits, make sure you cancel changes,
  3995.       using the Refresh command in the Edit menu, before you make the new
  3996.       selection. See Section 6.2.6, "Canceling Changes to a Character," for
  3997.       more information on the Refresh command. %@NL@%
  3998.  
  3999.  
  4000.  
  4001. %@3@%%@CR:C6A00060028 @%%@AB@%6.2.1  Turning Pixels On or Off%@AE@%%@EH@%%@NL@%
  4002.  
  4003. The Font Editor lets you change characters pixel by pixel. To turn a
  4004. character pixel on or off, point to the pixel and click the left mouse
  4005. button. To turn several pixels on or off, drag the cursor over the pixels
  4006. you want to change.%@CR:C6A00060029 @%%@CR:C6A00060030 @%%@CR:C6A00060031 @%%@CR:C6A00060032 @%%@NL@%
  4007.  
  4008.  
  4009. %@3@%%@CR:C6A00060033 @%%@AB@%6.2.2  Changing Rows and Columns of Pixels%@AE@%%@EH@%%@NL@%
  4010.  
  4011. The Font Editor lets you copy or delete rows and columns of pixels. The Row
  4012. and Column menus each contain Add and Delete commands.  %@NL@%
  4013.  
  4014.  
  4015. %@4@%%@AB@%Adding a Row or Column%@AE@%%@EH@%%@NL@%
  4016.  
  4017. The Font Editor adds rows and columns to a character by copying the row or
  4018. column you select. To add a row or column, do the following:  %@NL@%
  4019.  
  4020.  
  4021.   1.  Choose the Add command from the appropriate menu.%@NL@%
  4022.  
  4023.   2.  Select the row or column you want to delete by clicking on it.%@NL@%
  4024.  
  4025.  
  4026. The Font Editor duplicates the row or column selected.%@CR:C6A00060034 @%%@CR:C6A00060035 @%%@CR:C6A00060036 @%%@CR:C6A00060037 @%%@CR:C6A00060038 @%%@NL@%
  4027.  
  4028. When adding a new row, the Font Editor inserts it between the selected row
  4029. and the row immediately below it. The Font Editor pushes all rows below the
  4030. new row down one, and deletes the row at the bottom of the Character window.
  4031. Figure 6.2 illustrates selecting a row for addition to the character. Figure
  4032. 6.3 illustrates the character after the Font Editor has duplicated the row.%@CR:C6A00060039 @%%@CR:C6A00060040 @%%@CR:C6A00060041 @%%@CR:C6A00060042 @%%@NL@%
  4033.  
  4034. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4035.  
  4036. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4037.  
  4038. When adding a new column, the Font Editor inserts it between the selected
  4039. column and the one to its right. The Font Editor inserts the new column and
  4040. pushes all columns to its right one column to the right, and deletes the
  4041. column at the far right of the Character window. Figure 6.4 illustrates
  4042. selecting a column for addition to the character. Figure 6.5 illustrates the
  4043. character after the Font Editor has duplicated the column.  %@NL@%
  4044.  
  4045. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4046.  
  4047. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  4048.  
  4049.  
  4050. %@4@%%@AB@%Deleting a Row or Column%@AE@%%@EH@%%@NL@%
  4051.  
  4052. To delete a row or column of pixels, do the following:  %@NL@%
  4053.  
  4054.  
  4055.   1.  Choose the Delete command from the appropriate menu.%@NL@%
  4056.  
  4057.   2.  Select the row or column you want to delete by clicking on it.%@NL@%
  4058.  
  4059.  
  4060. Deleting a row causes all rows below it to move up one, and causes the last
  4061. row in the Character window to be duplicated.%@CR:C6A00060043 @%%@CR:C6A00060044 @%%@CR:C6A00060045 @%%@CR:C6A00060046 @%%@CR:C6A00060047 @%%@CR:C6A00060048 @%%@NL@%
  4062.  
  4063. When you delete a whole column, all columns to the right of the deleted
  4064. column move left one, and the column at the far right of the Character
  4065. window is duplicated.  %@NL@%
  4066.  
  4067.  
  4068. %@3@%%@CR:C6A00060049 @%%@AB@%6.2.3  Modifying Blocks of Pixels%@AE@%%@EH@%%@NL@%
  4069.  
  4070. The Fill menu provides commands that let you select and change specified
  4071. blocks of pixels. The commands on the Fill menu are useful if you want to
  4072. modify a large number of pixels in the same way. For example, you can select
  4073. a block of pixels and fill all of them in one operation.%@CR:C6A00060050 @%%@CR:C6A00060051 @%%@CR:C6A00060052 @%%@NL@%
  4074.  
  4075. The Fill menu contains the following commands:  %@NL@%
  4076.  
  4077. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  4078. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4079. Clear                             Changes a specified block of pixels to 
  4080.                                   background pixels.
  4081.  
  4082. Solid                             Fills a specified block with foreground 
  4083.                                   pixels.
  4084.  
  4085. Hatched                           Creates alternate foreground and 
  4086.                                   background pixels in a specified block.
  4087.  
  4088. Inverted                          Changes foreground pixels to background 
  4089.                                   pixels, and vice versa, in a specified 
  4090.                                   block.
  4091.  
  4092. Left=Right                        Rotates a specified block horizontally 
  4093.                                   180 degrees.
  4094.  
  4095. Top=Bottom                        Rotates a specified block vertically 180
  4096.                                   degrees.
  4097.  
  4098. Copy                              Copies pixels in a specified block to 
  4099.                                   the clipboard.
  4100.  
  4101. Paste                             Fills a specified block with pixels from
  4102.                                   the clipboard.
  4103.  
  4104. If you are pasting pixels from the clipboard, be sure the area of the
  4105. Character window in which you want to paste is the same size as the block on
  4106. the clipboard. If you try to paste your data from the clipboard into an area
  4107. that is larger or smaller than the block, the Font Editor tries to stretch
  4108. or squeeze the block to fit.%@CR:C6A00060053 @%%@CR:C6A00060054 @%%@CR:C6A00060055 @%%@CR:C6A00060056 @%%@CR:C6A00060057 @%%@NL@%
  4109.  
  4110. The procedure for carrying out commands in the Fill menu is as follows:%@CR:C6A00060058 @%%@CR:C6A00060059 @%%@NL@%
  4111.  
  4112.  
  4113.   1.  Choose the relevant command from the menu.%@NL@%
  4114.  
  4115.   2.  Select the block of pixels you want to change.%@NL@%
  4116.  
  4117.  
  4118. The editor executes the relevant operation on all pixels within the
  4119. specified block.  %@NL@%
  4120.  
  4121.  
  4122. %@3@%%@CR:C6A00060060 @%%@AB@%6.2.4  Changing Character Width%@AE@%%@EH@%%@NL@%
  4123.  
  4124. Use the Width menu to change the width of a character belonging to a
  4125. variable-pitch font. Commands in the Width menu change the number of columns
  4126. in the character bitmap in the following ways:%@CR:C6A00060061 @%%@CR:C6A00060062 @%%@NL@%
  4127.  
  4128. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  4129. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4130. Wider (left)                      Adds a blank column to the left side of 
  4131.                                   the character. %@CR:C6A00060063 @% %@CR:C6A00060064 @%
  4132.  
  4133. Wider (right)                     Adds a blank column to the right side of
  4134.                                   the character.
  4135.  
  4136. Wider (both)                      Adds a blank column to each side of the 
  4137.                                   character.
  4138.  
  4139. Narrower (left)                   Deletes a column from the left side of 
  4140.                                   the character.
  4141.  
  4142. Narrower (right)                  Deletes a column from the right side of 
  4143.                                   the character.
  4144.  
  4145. Narrower (both)                   Deletes a column from each side of the 
  4146.                                   character.
  4147.  
  4148. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4149. NOTE
  4150.  
  4151. %@AI@%The width of a character can be changed only on variable-pitch fonts.%@CR:C6A00060065 @%%@AE@%
  4152.  
  4153. %@AI@%Characters in a variable-pitch font cannot be wider than the maximum
  4154. %@AI@%character width. If you try to make a character cell wider than the maximum
  4155. %@AI@%character width, a dialog box appears, warning you that the maximum
  4156. %@AI@%character width will increase. %@CR:C6A00060066 @%%@CR:C6A00060067 @%%@AE@%
  4157. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4158.  
  4159.  
  4160. %@3@%%@CR:C6A00060068 @%%@AB@%6.2.5  Storing Changes to a Character%@AE@%%@EH@%%@NL@%
  4161.  
  4162. You can store changes to a character by selecting it in the Font-viewing
  4163. window.%@CR:C6A00060069 @%%@CR:C6A00060070 @%%@NL@%
  4164.  
  4165. The Font Editor stores your selection by copying it back to the font buffer.
  4166. The Font-viewing window is updated to show the new character.  %@NL@%
  4167.  
  4168. You can also store changes to a character by making a new selection. The
  4169. Font Editor copies the old selection into the font buffer before copying the
  4170. new selection to the Character window. This is useful if you want to
  4171. continue editing characters in the same font.  %@NL@%
  4172.  
  4173.  
  4174. %@3@%%@CR:C6A00060071 @%%@AB@%6.2.6  Canceling Changes to a Character%@AE@%%@EH@%%@NL@%
  4175.  
  4176. To recover from an editing mistake, use either the Undo command or the
  4177. Refresh command from the Edit menu.%@CR:C6A00060072 @%%@NL@%
  4178.  
  4179. The Undo command restores the character window to its state before the last
  4180. change in the window.%@CR:C6A00060073 @%%@CR:C6A00060074 @%%@NL@%
  4181.  
  4182. The Undo command cannot cancel changes made to a character that you have
  4183. stored in the buffer.  %@NL@%
  4184.  
  4185. To cancel all changes you have made to a character, use the Refresh command
  4186. from the Edit menu. The Refresh command replaces the current character in
  4187. the character window with a copy from the Font window.  %@NL@%
  4188.  
  4189. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4190. NOTE
  4191.  
  4192. %@AI@%You cannot cancel changes to a character by selecting a new character.
  4193. %@AI@%Selecting a new character, or reselecting the current character, causes the
  4194. %@AI@%Font Editor to store all changes to the character in the font buffer. Only
  4195. %@AI@%the Refresh command cancels changes. %@AE@%
  4196. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4197.  
  4198.  
  4199. %@2@%%@CR:C6A00060075 @%%@AB@%6.3  Editing a Font%@AE@%%@EH@%%@NL@%
  4200.  
  4201. To change the height, width, and character-mapping ANSI value of a font, use
  4202. the Size command in the Font menu. The command displays a dialog box that
  4203. contains the following options:%@CR:C6A00060076 @%%@CR:C6A00060077 @%%@CR:C6A00060078 @%%@CR:C6A00060079 @%%@CR:C6A00060080 @%%@CR:C6A00060081 @%%@CR:C6A00060082 @%%@NL@%
  4204.  
  4205. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  4206. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4207. Character Pixel Height            Defines the height (in pixels) of the 
  4208.                                   characters in the font. %@CR:C6A00060083 @%
  4209.  
  4210. Maximum Width (variable-width     Defines the width (in pixels) of the 
  4211. fonts only)                       widest possible character in a 
  4212.                                   variable-pitch font. %@CR:C6A00060084 @%
  4213.  
  4214. Character Pixel Width             Defines the width (in pixels) of all 
  4215. (fixed-pitch fonts only)          characters in a fixed-pitch font. In 
  4216.                                   fixed-pitch fonts all characters have 
  4217.                                   equal width. %@CR:C6A00060085 @% 
  4218.  
  4219. First Character                   Defines the character value (for example,
  4220.                                   the ANSI value) of the first character 
  4221.                                   in the font. The first character is the 
  4222.                                   character to the far left when you 
  4223.                                   scroll the contents of the font-viewing 
  4224.                                   window to the far right. %@CR:C6A00060086 @%%@CR:C6A00060087 @% %@CR:C6A00060088 @%
  4225.  
  4226. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  4227. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4228. Last Character                    Defines the character value (for example,
  4229.                                   the ANSI value) of the last character in
  4230.                                   the font. The last character is the 
  4231.                                   character to the far right when you 
  4232.                                   scroll the contents of the font-viewing 
  4233.                                   window to the far left.%@CR:C6A00060089 @%%@CR:C6A00060090 @% 
  4234.  
  4235. Pitch  %@NL@%
  4236.  
  4237.                                   Defines the font as either Fixed or 
  4238.                                   Variable. Fixed and Variable are 
  4239.                                   mutually exclusive. %@CR:C6A00060091 @% %@CR:C6A00060092 @% %@CR:C6A00060093 @% %@CR:C6A00060094 @% %@CR:C6A00060095 @%%@CR:C6A00060096 @%
  4240.  
  4241.                                   You can change a font from fixed-pitch 
  4242.                                   to variable-pitch by selecting Variable 
  4243.                                   in the Size dialog box. You cannot 
  4244.                                   change a variable-pitch font to 
  4245.                                   fixed-pitch. 
  4246.  
  4247. Weight                            Lists options that define the font 
  4248.                                   weight, ranging from thin to heavy. Each
  4249.                                   option represents the specific degree of
  4250.                                   heaviness (i.e., thickness of stroke) of
  4251.                                   the font. The options are mutually 
  4252.                                   exclusive. %@CR:C6A00060097 @%%@CR:C6A00060098 @%
  4253.  
  4254.  
  4255. %@2@%%@CR:C6A00060099 @%%@AB@%6.4  Changing Font File Header Information%@AE@%%@EH@%%@NL@%
  4256.  
  4257. To change the information in the font file header, use the Header command in
  4258. the Font menu. The Header command displays a dialog box that contains the
  4259. following information about the font:%@CR:C6A00060100 @%%@CR:C6A00060101 @%%@CR:C6A00060102 @%%@CR:C6A00060103 @%%@NL@%
  4260.  
  4261. %@AB@%Item%@AE@%                              %@AB@%Description%@AE@%
  4262. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4263. Face Name                         The name used to distinguish the font 
  4264.                                   from other fonts. It is not necessarily 
  4265.                                   the same as the font filename. The face 
  4266.                                   name can be as many as 32 characters. %@CR:C6A00060104 @%
  4267.  
  4268. File Name                         The name of the font file being edited. %@CR:C6A00060105 @%
  4269.  
  4270. Copyright                         Either a copyright notice or additional 
  4271.                                   information about the font. It can be as
  4272.                                   many as 60 characters in length. %@CR:C6A00060106 @% 
  4273.  
  4274. Nominal Point Size                The point size of the characters in the 
  4275.                                   font. One point is equal to 
  4276.                                   approximately 1/72 of an inch. %@CR:C6A00060107 @% 
  4277.  
  4278. %@AB@%Item%@AE@%                              %@AB@%Description%@AE@%
  4279. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4280. Height of Ascent                  The distance (in pixels) from the top of
  4281.                                   an ascender to the baseline. %@CR:C6A00060108 @%
  4282.  
  4283. Nominal Vert.                     The vertical resolution at which the 
  4284. Resolution                        characters were digitized. %@CR:C6A00060109 @%
  4285.  
  4286. Nominal Horiz.                    The horizontal resolution at which the 
  4287. Resolution                        characters were digitized. %@CR:C6A00060110 @%
  4288.  
  4289. External Leading                  The pixel height of the external leading.
  4290.                                   External leading is the vertical 
  4291.                                   distance (in rows) from the bottom of 
  4292.                                   one character cell to the top of the 
  4293.                                   character cell below it. The 
  4294.                                   Character-viewing window shows two 
  4295.                                   copies of the character, one above the 
  4296.                                   other, so that you can see the effect of
  4297.                                   the leading. %@CR:C6A00060111 @% %@CR:C6A00060112 @%
  4298.  
  4299. Internal Leading                  The pixel height of the internal leading.
  4300.                                   Internal leading is the vertical 
  4301.                                   distance (in rows) within a character 
  4302.                                   cell above the top of the tallest 
  4303.                                   letter; only marks such as accents, 
  4304.                                   umlauts, and tildes for capital letters 
  4305.                                   should appear within the space 
  4306.                                   designated as internal leading. %@CR:C6A00060113 @%%@CR:C6A00060114 @% 
  4307.  
  4308. Default Character                 The character value (for example, the 
  4309.                                   ANSI value) of the default character. 
  4310.                                   The default character is used whenever 
  4311.                                   your application tries to use a 
  4312.                                   character that does not exist in the 
  4313.                                   font. %@CR:C6A00060115 @%%@CR:C6A00060116 @%%@CR:C6A00060117 @%
  4314.  
  4315. Break Character                   The character value of the break 
  4316.                                   character. The break character is used 
  4317.                                   to pad lines that have been justified. 
  4318.                                   The break character is typically the 
  4319.                                   space character. (For example, in the 
  4320.                                   ANSI character set, the value is 32.) %@CR:C6A00060118 @%
  4321.  
  4322. ANSI, OEM, or                     These options define the character set. 
  4323. SYMBOL                            The ANSI character set (value zero) is 
  4324.                                   the default Windows character set. The 
  4325.                                   OEM character set (value 255) is 
  4326.                                   machine-specific. The Symbol character 
  4327.                                   set (value 2) contains special 
  4328.                                   characters typically used to represent 
  4329.                                   mathematical and scientific formulas. 
  4330.                                   The number to the right of these options
  4331.                                   defines the character set. It can be any
  4332.                                   value from 0 to 255, but only 0, 2, and 
  4333.                                   255 have a predefined meaning. %@CR:C6A00060119 @% %@CR:C6A00060120 @%%@CR:C6A00060121 @%
  4334.  
  4335. %@AB@%Item %@AE@%                             %@AB@%Description%@AE@%
  4336. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4337. Font Family                       The family to which the font belongs. 
  4338.                                   Font families define the general 
  4339.                                   characteristics of the font as follows: 
  4340.                                   %@CR:C6A00060122 @% %@CR:C6A00060123 @%
  4341.  
  4342.                                   %@AB@%Family%@AE@% %@AB@%%@AE@%     %@AB@%Description%@AE@%
  4343.                                   %@AB@%Name%@AE@%        
  4344. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4345.                                   Roman       Proportionally-spaced fonts 
  4346.                                               with serifs.
  4347.  
  4348.                                   Modern      Fixed-pitch fonts. 
  4349.  
  4350.                                   Swiss       Proportionally-spaced fonts 
  4351.                                               without serifs.
  4352.  
  4353.                                   Decorative  Novelty fonts.
  4354.  
  4355.                                   Script      Cursive or script fonts.
  4356.  
  4357.                                   Dontcare    Custom font.
  4358.  
  4359.                                   Italic      This option defines an 
  4360.                                               italic font.
  4361.  
  4362.                                   Underline   This option defines an 
  4363.                                               underlined font. %@CR:C6A00060124 @% 
  4364.  
  4365.                                   Strikeout   This option defines a font 
  4366.                                               whose characters have been 
  4367.                                               struck out. %@CR:C6A00060125 @%
  4368.  
  4369.  
  4370. %@2@%%@CR:C6A00060126 @%%@AB@%6.5  Summary%@AE@%%@EH@%%@NL@%
  4371.  
  4372. The Font Editor lets you modify existing fonts on the screen to create new
  4373. fonts for your application. For an introduction to Windows fonts, see
  4374. Chapter 18, "Fonts," in %@AI@%Guide to Programming%@AE@%.  %@NL@%
  4375.  
  4376.  
  4377.  
  4378.  
  4379.  
  4380.  
  4381. %@CR:C6A-Part 03 @%%@1@%%@AB@%PART III  Debugging and Optimization Tools%@AE@%%@EH@%%@NL@%
  4382. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4383.  
  4384. Part 3 describes Microsoft Windows debugging and optimization tools.  The
  4385. SDK includes three debuggers: Code View for Windows, Symbolic  Debugger, and
  4386. Windows 80386 Debugger. Use Code View for Windows to debug your application
  4387. with protected-mode (standard or 386 enhanced) Windows, and the Symbolic
  4388. Debugger to debug your application with real-mode Windows. Use the 80386
  4389. Debugger for more advanced debugging in protected mode.  %@NL@%
  4390.  
  4391. The SDK also includes tools that let you monitor messages and analyze memory
  4392. management. Spy lets you monitor messages sent to a specified window or to
  4393. all windows. It is useful for verifying that the messages you think a window
  4394. is receiving are, in fact, being received. Heap Walker, Profiler, Swap, and
  4395. Shaker help you analyze memory management. Heap Walker is useful for
  4396. analyzing your application when it allocates objects in the global heap.
  4397. Profiler lets you determine the amount of time Windows spends executing
  4398. sections of code. Swap ets you analyze the calls, swaps, discards, and
  4399. returns that occur when your application runs. It is useful for minimizing
  4400. the number of procedure calls that occur across segment boundaries. Shaker
  4401. lets you see the effect of memory movement on your applications.  %@NL@%
  4402.  
  4403.  
  4404.  
  4405.  
  4406.  
  4407.  
  4408. %@CR:C6A00070001 @%%@1@%%@AB@%Chapter 7  Debugging in Protected Mode: CodeView for Windows%@AE@%%@EH@%%@NL@%
  4409. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4410.  
  4411. Version 3.0 of the Microsoft CodeView(R) for Windows (%@AB@%CVW%@AE@%) debugger is a
  4412. powerful, easy-to-use tool for analyzing the behavior of programs. With %@AB@%CVW%@AE@%,
  4413. you have the power to test completely the execution of your program and
  4414. examine your data simultaneously. You can isolate problems quickly because
  4415. you can display any combination of variables─global or local─%@AI@%while%@AE@% you halt
  4416. or trace a program's execution.%@CR:C6A00070002 @%%@NL@%
  4417.  
  4418. The %@AB@%CVW%@AE@% debugger provides a variety of ways to analyze a program. You can
  4419. use the debugger to examine source code, disassemble machine code, or
  4420. examine a mixed display that shows you precisely what machine instructions
  4421. correspond to each of your C-language statements. You can also monitor the
  4422. occurrence of specific Windows messages.  %@NL@%
  4423.  
  4424. %@AB@%CVW%@AE@% is similar to CodeView (CV) for DOS version 3.0. If you are familiar
  4425. with CV for DOS, see Section 7.2.2, "Differences between CVW and CodeView
  4426. for DOS," for a concise description of %@AB@%CVW%@AE@%'s unique features.%@CR:C6A00070003 @%%@CR:C6A00070004 @%%@CR:C6A00070005 @%%@NL@%
  4427.  
  4428. This chapter serves as a complement to the %@AB@%CVW%@AE@% on-line Help system. A
  4429. significant portion of the %@AB@%CVW%@AE@% documentation is on-line. For information on
  4430. using the %@AB@%CVW%@AE@% on-line Help system, see Section 7.7, "Getting On-line Help in
  4431. %@AB@%CVW%@AE@%."  %@NL@%
  4432.  
  4433. This chapter describes the following:  %@NL@%
  4434.  
  4435.  
  4436.   ■   Requirements for using %@AB@%CVW%@AE@%%@NL@%
  4437.  
  4438.   ■   Differences between %@AB@%CVW%@AE@% other Microsoft debuggers%@NL@%
  4439.  
  4440.   ■   Preparing to run %@AB@%CVW%@AE@% %@NL@%
  4441.  
  4442.   ■   Starting %@AB@%CVW%@AE@%%@NL@%
  4443.  
  4444.   ■   Working with the %@AB@%CVW%@AE@% screen%@NL@%
  4445.  
  4446.   ■   Displaying program data%@NL@%
  4447.  
  4448.   ■   Controlling program execution%@NL@%
  4449.  
  4450.   ■   Advanced %@AB@%CVW%@AE@% debugging techniques%@NL@%
  4451.  
  4452.   ■   Customizing %@AB@%CVW%@AE@% behavior with the TOOLS.INI file%@NL@%
  4453.  
  4454.   ■   Using %@AB@%CVW%@AE@% to debug a sample application%@NL@%
  4455.  
  4456. %@STUB@%      %@AI@%NOTE  %@AE@%%@AB@%CVW%@AE@% supports the Microsoft Mouse, or any fully compatible
  4457.       pointing device. All operations are first described using the mouse.
  4458.       The keyboard command follows.%@NL@%
  4459.  
  4460.  
  4461.  
  4462. %@2@%%@CR:C6A00070006 @%%@AB@%7.1  Requirements for Use%@AE@%%@EH@%%@NL@%
  4463.  
  4464. To use version 3.0 of %@AB@%CVW%@AE@%, your system must meet the standard requirements
  4465. for running the Microsoft Windows Software Development Kit (SDK). For a list
  4466. of the SDK requirements, see the %@AI@%Installation and Update Guide%@AE@%. %@AB@%CVW%@AE@%
  4467. specifically requires the following:  %@NL@%
  4468.  
  4469.  
  4470.   ■   A secondary monochrome display adapter and monitor. (%@AB@%CVW%@AE@% version 3.0
  4471.       does not support a serial terminal.) For IBM PS/2 systems, %@AB@%CVW%@AE@%
  4472.       supports (through the %@AB@%/8%@AE@% option) a dual-monitor configuration, where
  4473.       an 8514/a monitor serves as the Windows screen and a VGA monitor
  4474.       serves as the debugging screen.%@NL@%
  4475.  
  4476.   ■   At least 384K of extended memory. For applications compiled with many
  4477.       symbols, 1 megabyte or more of extended memory is required.%@CR:C6A00070007 @%%@NL@%
  4478.  
  4479.   ■   For 80386-based systems, the following entry in the [386enh] section
  4480.       of your SYSTEM.INI file:
  4481.  
  4482. %@AS@%      device=windebug.386%@AE@%
  4483. %@NL@%
  4484.  
  4485. %@STUB@%      The SDK %@AB@%INSTALL%@AE@% program automatically adds this entry to your
  4486.       SYSTEM.INI file.%@NL@%
  4487.  
  4488.   ■   A PATH environment variable that lists the directory containing
  4489.       CVW.EXE, WINDEBUG.DLL, WINDEBUG.386, and CVW.HLP. The SDK %@AB@%INSTALL%@AE@%
  4490.       program will place WINDEBUG.DLL and WINDEBUG.386 in the same directory
  4491.       as CVW.EXE.%@NL@%
  4492.  
  4493.  
  4494.  
  4495. %@2@%%@CR:C6A00070008 @%%@AB@%7.2  Comparing %@AB@%CVW%@AE@% with Other Microsoft Debuggers%@AE@%%@EH@%%@NL@%
  4496.  
  4497. If you have programmed in the Windows environment, you may have used the
  4498. Symbolic Debugger %@AB@%(SYMDEB)%@AE@% or %@AB@%CVW%@AE@% version 2.0 to debug Windows applications.
  4499. Or you may have used CodeView (CV) for DOS, which accompanies the Microsoft
  4500. C Optimizing Compiler. This section describes the features and functions of
  4501. %@AB@%CVW%@AE@% that are different from these other Microsoft debugging tools.  %@NL@%
  4502.  
  4503.  
  4504. %@3@%%@CR:C6A00070009 @%%@AB@%7.2.1  Differences between CVW and SYMDEB%@AE@%%@EH@%%@NL@%
  4505.  
  4506. %@AB@%CVW%@AE@% has all the capabilities of %@AB@%SYMDEB%@AE@% and a number of features that %@AB@%SYMDEB%@AE@%
  4507. does not provide. The following list summarizes differences between %@AB@%SYMDEB%@AE@%
  4508. and %@AB@%CVW%@AE@%.%@CR:C6A00070010 @%%@NL@%
  4509.  
  4510. %@AB@%SYMDEB Feature%@AE@%                    %@AB@%CVW Feature%@AE@%
  4511. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4512. Debugs applications in real       Debugs applications in protected mode.
  4513. mode.                             
  4514.  
  4515. Examines only global (static)     Examines both global and local
  4516. variables.                        variables.
  4517.  
  4518. When examining variables, you     Examines memory directly, but also uses 
  4519. must specify simple memory        the C expression evaluators to combine 
  4520. addresses or symbol names.        any program variables with higher 
  4521.                                   level-language syntax.
  4522.  
  4523. Provides only breakpoints to      Provides breakpoints, tracepoints, and 
  4524. halt execution.                   watchpoints to set Boolean conditions 
  4525.                                   and then break execution whenever these 
  4526.                                   conditions become true. 
  4527.  
  4528. Does not set breakpoints or       Sets breakpoints and tracepoints on 
  4529. tracepoints on Windows messages.  Windows messages.
  4530.  
  4531. Uses only line-oriented           Uses line-oriented or menu-driven 
  4532. commands.                         commands.
  4533.  
  4534. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4535. NOTE 
  4536.  
  4537. %@AI@%%@AB@%CVW%@AE@%%@AI@% version 3.0 supports Windows in protected mode (that is, standard and
  4538. %@AI@%386 enhanced modes) only; it does not support  Windows in real mode. Use
  4539. %@AI@%%@AE@%%@AI@%%@AB@%SYMDEB%@AE@%%@AE@%%@AI@% for real-mode debugging.%@AE@%%@AE@%
  4540. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4541.  
  4542.  
  4543. %@3@%%@CR:C6A00070011 @%%@AB@%7.2.2  Differences between CVW and CodeView for DOS%@AE@%%@EH@%%@NL@%
  4544.  
  4545. Like CV for DOS, %@AB@%CVW%@AE@% allows you to display and modify %@AI@%any%@AE@% program variable,
  4546. section of addressable memory, or processor register. Also like CV for DOS,
  4547. %@AB@%CVW%@AE@% lets you monitor the path of execution and precisely control where
  4548. execution pauses. However, CV for DOS and %@AB@%CVW%@AE@% differ in the following ways:%@CR:C6A00070012 @%%@NL@%
  4549.  
  4550. %@AB@%CV for DOS Feature%@AE@%                %@AB@%CVW Feature%@AE@%
  4551. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4552. Starts from the DOS prompt.       Starts from within Windows.
  4553.  
  4554. ALT+/ repeats a search.           CTRL+R repeats a search.
  4555.  
  4556. Exits back to DOS.                Under normal termination conditions, 
  4557.                                   exits back to Windows. Abnormal 
  4558.                                   terminations of %@AB@%CVW%@AE@% may cause the 
  4559.                                   Windows session to be terminated also.
  4560.  
  4561. In addition to these differences %@AB@%CVW%@AE@% includes the following unique features:
  4562. %@NL@%
  4563.  
  4564.  
  4565.   ■   The ability to track your application's segments and data as Windows
  4566.       moves their locations in memory. As items are moved, the debugger
  4567.       readjusts its symbol table accordingly.%@NL@%
  4568.  
  4569.   ■   The %@AB@%(lh)%@AE@% and %@AB@%(gh)%@AE@% type casts, which you can use to dereference local
  4570.       and global handles of a memory object into near and far pointer
  4571.       addresses. For a more detailed description, see "Dereferencing Memory
  4572.       Handles" in Section  7.8.6.%@NL@%
  4573.  
  4574.   ■   Windows-specific commands. %@AB@%CVW%@AE@% has six new commands:%@NL@%
  4575.  
  4576.  
  4577. %@AB@%Command%@AE@%                           %@AB@%What it does%@AE@%
  4578. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  4579. %@AB@%wdl%@AE@% (Windows Display Local Heap)  Displays a list of the memory objects in
  4580.                                   the local heap.
  4581.  
  4582. %@AB@%wdg%@AE@% (Windows Display Global       Displays a list of the memory objects in
  4583. Heap)                             the global heap.
  4584.  
  4585. %@AB@%wdm%@AE@% (Windows Display Module       Displays a list of the application and 
  4586. List)                             library modules known by Windows.
  4587.  
  4588. %@AB@%wwm%@AE@% (Windows Watch Message)       Displays a Windows message or class of 
  4589.                                   messages in the %@AB@%CVW%@AE@% 
  4590.                                   Command window.
  4591.  
  4592. %@AB@%wbm%@AE@% (Windows Break Message)       Sets a breakpoint on a Windows message 
  4593.                                   or class of messages. %@CR:C6A00070013 @%
  4594.  
  4595. %@AB@%wka%@AE@% (Windows Kill Application)    Terminates the currently executing task.
  4596.                                   You should use this command with caution.
  4597.                                   See Section 7.10.4,
  4598.                                   "Interrupting Your Program," for more 
  4599.                                   information.%@CR:C6A00070014 @%
  4600.  
  4601.  
  4602. %@2@%%@CR:C6A00070015 @%%@AB@%7.3  Preparing to Run CVW%@AE@%%@EH@%%@NL@%
  4603.  
  4604. Before beginning a %@AB@%CVW%@AE@% debugging session, you must do the following:  %@NL@%
  4605.  
  4606.  
  4607.   ■   Set up a secondary monitor on which to display %@AB@%CVW%@AE@% information.%@NL@%
  4608.  
  4609.   ■   Ensure that the Windows application you are going to debug has been
  4610.       compiled and linked properly.%@NL@%
  4611.  
  4612.  
  4613. In addition to these mandatory steps, it is also recommended that you set up
  4614. a debugging version of Windows.  %@NL@%
  4615.  
  4616. The following sections describe how to prepare your system for running %@AB@%CVW%@AE@%.
  4617. %@NL@%
  4618.  
  4619.  
  4620. %@3@%%@CR:C6A00070016 @%%@AB@%7.3.1  Setting Up a Secondary Monitor%@AE@%%@EH@%%@NL@%
  4621.  
  4622. In addition to the graphics adapter card and graphics display monitor
  4623. required for your Windows display, you need a monochrome adapter card and
  4624. monochrome display monitor to use %@AB@%CVW%@AE@%.%@CR:C6A00070017 @%%@NL@%
  4625.  
  4626. To set up a secondary monitor for debugging, do the following:  %@NL@%
  4627.  
  4628.  
  4629.   1.  Install a secondary monochrome adapter card in a free slot on your
  4630.       computer and connect the monochrome monitor to the port in the back.%@NL@%
  4631.  
  4632.   2.  Set the secondary-display-adapter switches to the appropriate
  4633.       settings, according to the display adapter and computer manufacturer
  4634.       recommendations.%@NL@%
  4635.  
  4636.  
  4637. If your system is an IBM PS/2, it must be configured with an 8514/a monitor
  4638. as the primary monitor, and a VGA as the secondary monitor. To use this
  4639. configuration, specify the %@AB@%/8%@AE@% (8514/a) option when you choose the Run
  4640. command from the %@AB@%CVW%@AE@% File menu. If your VGA monitor is monochrome, you must
  4641. also use the %@AB@%/B%@AE@% (black and white) option. The 8514/a serves as the Windows
  4642. screen and the VGA as the debugging screen.  %@NL@%
  4643.  
  4644. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4645. IMPORTANT
  4646.  
  4647. %@AI@%Do not attempt to run non-Windows applications or the DOS shell while
  4648. %@AI@%running %@AB@%CVW%@AE@%%@AI@% with the %@AE@%%@AI@%%@AB@%/8%@AE@%%@AE@%%@AI@% option.%@AE@%%@AE@%
  4649. ────────────────────────────────────────────────────────────────────────────%@NL@%
  4650.  
  4651. By default, the debugging screen operates in 50-line mode in this
  4652. configuration. If you specify the %@AB@%/8%@AE@% option, you can optionally specify the
  4653. %@AB@%/25%@AE@% or %@AB@%/43%@AE@% option for 25- or 43-line mode, respectively, on the VGA
  4654. debugging screen.  %@NL@%
  4655.  
  4656. With the secondary monitor connected to your system, you can view %@AB@%CVW%@AE@% output
  4657. and Windows output simultaneously.  %@NL@%
  4658.  
  4659.  
  4660. %@3@%%@CR:C6A00070018 @%%@AB@%7.3.2  Setting Up the Debugging Version of Windows%@AE@%%@EH@%%@NL@%
  4661.  
  4662. You can run %@AB@%CVW%@AE@% with either the debugging or retail version of Windows.  %@NL@%
  4663.  
  4664. The debugging version performs error checking which is not available in the
  4665. retail version. For example, the debugging version of Windows checks whether
  4666. a window handle passed to a Windows function is valid. When the debugging
  4667. version of Windows detects such an error, it reports a fatal exit. If this
  4668. happens while you are running %@AB@%CVW%@AE@%, the fatal exit is reported in the %@AB@%CVW%@AE@%
  4669. Command window. Section 7.11, "Handling Abnormal Termination of the
  4670. Application," discusses this error handling in greater detail.  %@NL@%
  4671.  
  4672. Another advantage to using the debugging version of Windows with %@AB@%CVW%@AE@% is the
  4673. additional support which the Windows core dynamic-link libraries (DLLs)
  4674. (KRNL286.EXE, KRNL386.EXE, GDI.EXE, and USER.EXE) provide for debugging.
  4675. These DLLs contain symbol information which makes it easier to determine the
  4676. cause of an error. For example, if your application causes a general
  4677. protection (GP) fault while running with the debugging version, Windows can
  4678. display symbol information for the Windows code that was executing when the
  4679. GP fault was detected. If, instead, you were running with the retail version
  4680. of Windows, Windows would only be able to display CS:IP address values of
  4681. the code that was executing when the fault occurred.  %@NL@%
  4682.  
  4683. %@AB@%CVW%@AE@% does not automatically use these Windows core DLL symbols. To provide
  4684. %@AB@%CVW%@AE@% access to these symbols, you must specify one or more of the core DLLs
  4685. either using the %@AB@%/L%@AE@% command-line option or in response to the DLL prompt
  4686. within %@AB@%CVW%@AE@%. If you are running %@AB@%CVW%@AE@% with Windows in standard mode, specify
  4687. KRNL286.EXE. In 386 enhanced mode, specify KRNL386.EXE. Section 7.4.4,
  4688. "Starting a Debugging Session for DLLs," explains how to load symbols from a
  4689. DLL.  %@NL@%
  4690.  
  4691. Installing the debugging version of Windows requires only three simple
  4692. steps:  %@NL@%
  4693.  
  4694.  
  4695.   1.  Rename or copy the KRNL286.EXE, KRNL386.EXE, GDI.EXE, and USER.EXE
  4696.       files located in the Windows system directory. If you accepted the
  4697.       default Windows directory name offered by Windows Setup, the Windows
  4698.       system directory is named \WINDOWS\SYSTEM. %@NL@%
  4699.  
  4700.   2.  Copy the debugging version of these files from the Windows development
  4701.       debugging directory (named \WINDEV\DEBUG by default) to the Windows
  4702.       system directory.%@NL@%
  4703.  
  4704.   3.  Copy the corresponding symbol files from the debugging directory to
  4705.       the system directory.%@NL@%
  4706.  
  4707.  
  4708.  
  4709. %@3@%%@CR:C6A00070019 @%%@AB@%7.3.3  Preparing Windows Applications for Debugging%@AE@%%@EH@%%@NL@%
  4710.  
  4711. To prepare a Windows application for use with %@AB@%CVW%@AE@%, take the following steps:
  4712. %@NL@%
  4713.  
  4714.  
  4715.   1.  Compile your C source code with the %@AB@%/Zi%@AE@% option and, optionally, the
  4716.       %@AB@%/Od%@AE@% options.%@CR:C6A00070020 @%%@NL@%
  4717.  
  4718. %@STUB@%      The %@AB@%/Zi%@AE@% option directs the compiler to produce object files that
  4719.       contain CodeView symbolic information. The %@AB@%/Od%@AE@% option disables the
  4720.       compiler's optimization. If optimization is enabled, the code
  4721.       generated by the compiler does not match as closely the statements in
  4722.       the C source code. Using the %@AB@%/Od%@AE@% option makes debugging easier.%@NL@%
  4723.  
  4724. %@STUB@%      For example:%@NL@%
  4725.  
  4726. %@AS@%      CL -d -c -AS -Gsw -Zpei -Od OUTPUT.C%@AE@%
  4727.  
  4728.   2.  Link your application with the %@AB@%/CO%@AE@% option.%@NL@%
  4729.  
  4730. %@STUB@%      The %@AB@%/CO%@AE@% option directs the linker to produce an executable file that
  4731.       contains CodeView information. This information is used directly by
  4732.       %@AB@%CVW%@AE@%. %@NL@%
  4733.  
  4734. %@STUB@%      Note that no other switches, intermediate files, or programs (such as
  4735.       %@AB@%MAPSYM%@AE@%, used with %@AB@%SYMDEB%@AE@%) are required for %@AB@%CVW%@AE@%. For example:%@NL@%
  4736.  
  4737. %@AS@%      LINK OUTPUT,,,/NOD /CO SLIBW SLIBCEW, OUTPUT.DEF%@AE@%
  4738.  
  4739.  
  4740. After compiling and linking your application with these options, you can
  4741. start a %@AB@%CVW%@AE@% debugging session.%@CR:C6A00070021 @%%@NL@%
  4742.  
  4743.  
  4744. %@2@%%@CR:C6A00070022 @%%@AB@%7.4  Starting a Debugging Session%@AE@%%@EH@%%@NL@%
  4745.  
  4746. Like most Windows applications, you can start CodeView for Windows several
  4747. ways. For a complete description of how to start Windows applications, see
  4748. the %@AI@%Windows User's Guide%@AE@%. To specify %@AB@%CVW%@AE@% options, you must choose the Run
  4749. command from the File menu in Program Manager. See Section 7.4.5, "Using %@AB@%CVW%@AE@%
  4750. File Run Options," for more information on %@AB@%CVW%@AE@% options.%@CR:C6A00070023 @%%@NL@%
  4751.  
  4752. You can run %@AB@%CVW%@AE@% to perform the following tasks:  %@NL@%
  4753.  
  4754.  
  4755.   ■   Debug a single application%@NL@%
  4756.  
  4757.   ■   Debug multiple instances of an application%@NL@%
  4758.  
  4759.   ■   Debug multiple applications%@NL@%
  4760.  
  4761.   ■   Debug dynamic-link libraries (DLLs)%@NL@%
  4762.  
  4763.  
  4764. This section describes the methods you use to perform these tasks, and
  4765. summarizes the syntax of the Run command in the File menu of %@AB@%CVW%@AE@%.  %@NL@%
  4766.  
  4767.  
  4768. %@3@%%@CR:C6A00070024 @%%@AB@%7.4.1  Starting a Debugging Session for a Single Application%@AE@%%@EH@%%@NL@%
  4769.  
  4770. After you start %@AB@%CVW%@AE@% from Windows, %@AB@%CVW%@AE@% will display the Command Line dialog
  4771. box on your secondary monitor. To start debugging a single application:  %@NL@%
  4772.  
  4773.  
  4774.   1.  At the Command Line prompt, type the name of the application. If you
  4775.       do not include an extension, %@AB@%CVW%@AE@% assumes the .EXE extension by
  4776.       default. You can also include any arguments that the application
  4777.       recognizes. The following shows the syntax of the command to start
  4778.       debugging a single application:%@NL@%
  4779.  
  4780. %@STUB@%      %@AB@%appname«.EXE» «%@AE@%%@AI@%application_arguments%@AE@%%@AB@%»%@AE@%%@NL@%
  4781.  
  4782.   2.  Press ENTER or click OK.%@NL@%
  4783.  
  4784. %@STUB@%      %@AB@%CVW%@AE@% displays the following prompt:%@NL@%
  4785.  
  4786. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  4787.  
  4788. %@STUB@%      Since you are debugging only one application and no DLLs, press ENTER
  4789.       or click OK. %@AB@%CVW%@AE@% loads the application and displays the source code
  4790.       for the application's WinMain routine on the debugging screen.%@NL@%
  4791.  
  4792.   3.  Set breakpoints in the code, if you desire.%@NL@%
  4793.  
  4794.   4.  Use the %@AB@%go%@AE@% command to resume execution of the application. %@NL@%
  4795.  
  4796.  
  4797. If you want to avoid the start-up dialog boxes, you can start %@AB@%CVW%@AE@% more
  4798. quickly by specifying the application name as an argument in the Run command
  4799. line, as follows:  %@NL@%
  4800.  
  4801.  
  4802.   1.  Choose the Run command from the Windows File menu.%@NL@%
  4803.  
  4804.   2.  Type the application name and any application arguments in the %@AB@%CVW%@AE@%
  4805.       command line. The following shows the syntax of the command line to
  4806.       start debugging a single application:%@NL@%
  4807.  
  4808. %@STUB@%      %@AB@%CVW «%@AE@%%@AI@%cvw_options%@AE@%%@AB@%» appname«.EXE» «%@AE@%%@AI@%application_arguments%@AE@%%@AB@%»%@AE@% %@NL@%
  4809.  
  4810.   3.  Press ENTER or click OK.%@NL@%
  4811.  
  4812.  
  4813.  
  4814. %@3@%%@CR:C6A00070025 @%%@AB@%7.4.2  Starting a Debugging Session for Multiple Instances of an Application%@AE@%%@EH@%%@NL@%
  4815.  
  4816. Windows can run multiple instances of an application simultaneously, which
  4817. can be a potential problem for your application. For example, two instances
  4818. of an application might interfere with each other, or perhaps one could
  4819. corrupt the data of the other.  %@NL@%
  4820.  
  4821. To help you solve problems associated with running multiple instances of a
  4822. program, %@AB@%CVW%@AE@% allows you to debug multiple instances of an application
  4823. simultaneously. You can determine which instance of an application you are
  4824. looking at by examining the DS register at any breakpoint.%@CR:C6A00070026 @%%@NL@%
  4825.  
  4826. To debug multiple instances of an application, perform the following steps:
  4827. %@NL@%
  4828.  
  4829.  
  4830.   1.  Start %@AB@%CVW%@AE@% as usual for your application.%@NL@%
  4831.  
  4832.   2.  Run one or more additional instances of your application by choosing
  4833.       the Run command from the File menu in Windows. %@NL@%
  4834.  
  4835.  
  4836. Specifying your application name more than once when starting %@AB@%CVW%@AE@% does not
  4837. have the effect of loading multiple instances of the application.  %@NL@%
  4838.  
  4839. The breakpoints you set in your application will apply to all instances of
  4840. the application. To determine which instance of the application has the
  4841. current focus in %@AB@%CVW%@AE@%, examine the DS register.  %@NL@%
  4842.  
  4843.  
  4844. %@3@%%@CR:C6A00070027 @%%@AB@%7.4.3  Starting a Debugging Session for Multiple Applications%@AE@%%@EH@%%@NL@%
  4845.  
  4846. You can debug two or more applications at the same time, such as a DDE
  4847. Client and Server. However, global symbols shared by both applications (such
  4848. as the symbol name "WINMAIN") are not distinguished. %@AB@%CVW%@AE@% always resolves
  4849. symbol references to the first application named when you started %@AB@%CVW%@AE@%.  %@NL@%
  4850.  
  4851. Perform the following steps to debug more than one application at the same
  4852. time:  %@NL@%
  4853.  
  4854.  
  4855.   1.  Start %@AB@%CVW%@AE@% as usual for a single application.%@NL@%
  4856.  
  4857.   2.  Provide the name of the second application when %@AB@%CVW%@AE@% displays this
  4858.       prompt:
  4859.  
  4860. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  4861. %@NL@%
  4862.  
  4863. %@STUB@%      You %@AI@%must%@AE@% include the .EXE extension of the filename of the second
  4864.       application.%@NL@%
  4865.  
  4866.   3.  Set breakpoints in either or both applications, using the File Open
  4867.       Module command to display the source code for the different modules.%@NL@%
  4868.  
  4869.   4.  Use the %@AB@%go%@AE@% command to continue execution of the first application. %@NL@%
  4870.  
  4871.   5.  Choose the Run command from the File menu in Windows to start
  4872.       execution of the second application.%@NL@%
  4873.  
  4874.  
  4875. Alternatively, you can use the %@AB@%/L%@AE@% option on the Run command line in %@AB@%CVW%@AE@% to
  4876. load the symbols for a second application, as shown:  %@NL@%
  4877.  
  4878. %@AS@%  cvw /l second.exe first.exe%@AE@%
  4879.  
  4880. The %@AB@%/L%@AE@% option and the name of the second application must precede the name
  4881. of the first application on the Run command line. You can repeat the %@AB@%/L%@AE@%
  4882. option for each application to be included in the debugging session.  %@NL@%
  4883.  
  4884. Once %@AB@%CVW%@AE@% starts, choose the Run command from the File menu in Windows to
  4885. start execution of the second application.  %@NL@%
  4886.  
  4887.  
  4888. %@3@%%@CR:C6A00070028 @%%@AB@%7.4.4  Starting a Debugging Session for DLLs%@AE@%%@EH@%%@NL@%
  4889.  
  4890. You can debug one or more DLLs while you are debugging an application. As
  4891. with multiple applications, global symbols shared by both applications are
  4892. not distinguished.  %@NL@%
  4893.  
  4894. Perform the following steps to debug a DLL at the same time as an
  4895. application:  %@NL@%
  4896.  
  4897.  
  4898.   1.  Start %@AB@%CVW%@AE@% as usual for the application.%@NL@%
  4899.  
  4900.   2.  Provide the name of the DLL when %@AB@%CVW%@AE@% displays this prompt:
  4901.  
  4902. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  4903. %@NL@%
  4904.  
  4905. %@STUB@%      %@AB@%CVW%@AE@% assumes the .DLL extension if you do not supply an extension with
  4906.       the filename. If your DLL has another extension (such as .DRV), you
  4907.       must specify it explicitly.%@NL@%
  4908.  
  4909.   3.  Set breakpoints in either the application or the DLL, using the File
  4910.       Open Module command to display the source code for the different
  4911.       modules.%@NL@%
  4912.  
  4913.   4.  Use the %@AB@%go%@AE@% command to continue execution of the application. %@NL@%
  4914.  
  4915.  
  4916. Alternatively, you can use the %@AB@%/L%@AE@% option on the %@AB@%CVW%@AE@% File Run command line to
  4917. specify the DLL, as shown:  %@NL@%
  4918.  
  4919. %@AS@%  cvw /l appdll appname.exe%@AE@%
  4920.  
  4921. The %@AB@%/L%@AE@% option and the name of the DLL must precede the name of the first
  4922. application on the %@AB@%CVW%@AE@% File Run command line. You can repeat the %@AB@%/L%@AE@% option
  4923. for each DLL to be included in the debugging session. The .DLL extension is
  4924. the default extension for the %@AB@%/L%@AE@% option.  %@NL@%
  4925.  
  4926. %@AB@%CVW%@AE@% allows you to debug the LibEntry initialization routine of a DLL. If
  4927. your application implicitly loads the library, then a special technique is
  4928. required to debug the LibEntry routine. An application implicitly loads a
  4929. DLL if the library routines are imported in the application's
  4930. module-definition (.DEF) file, or if your application imports library
  4931. routines through an import library when you link the application. An
  4932. application explicitly loads a DLL by calling the %@AB@%LoadLibrary%@AE@% function.  %@NL@%
  4933.  
  4934. If your application implicitly loads the DLL and you specify the application
  4935. at the Command Line prompt, %@AB@%CVW%@AE@% automatically loads the DLL and executes the
  4936. DLL's LibEntry routine when %@AB@%CVW%@AE@% loads the application. This gives you no
  4937. opportunity to debug the LibEntry routine. To avoid this problem, perform
  4938. the following steps:  %@NL@%
  4939.  
  4940.  
  4941.   1.  Do not provide the name of your application at the Command Line
  4942.       prompt. Instead, provide the name of any "dummy" application which
  4943.       does not implicitly load the library.%@NL@%
  4944.  
  4945.   2.  Enter the name of your DLL, being sure to include the extension if it
  4946.       is not .DLL, at the following prompt:
  4947.  
  4948. %@AS@%      Name any other DLL or executable with debug info:%@AE@%
  4949. %@NL@%
  4950.  
  4951.   3.  Use the File Open Module command to display the source code for the
  4952.       library module containing the LibEntry routine. Set breakpoints in the
  4953.       LibEntry routine.%@NL@%
  4954.  
  4955.   4.  Use the File Open Module command to display the source code for other
  4956.       library or application modules and set desired breakpoints.%@NL@%
  4957.  
  4958.   5.  Use the %@AB@%go%@AE@% command to start execution of the "dummy" application.%@NL@%
  4959.  
  4960.   6.  Execute your application (that is, the application that implicitly
  4961.       loads the DLL) by choosing the Run command from the File menu in
  4962.       Windows. %@AB@%CVW%@AE@% will resume control when the breakpoint in the LibEntry
  4963.       routine is encountered.%@NL@%
  4964.  
  4965.  
  4966. Alternatively, you can use the %@AB@%CVW%@AE@% File Run command line to identify the
  4967. "dummy" application, your application, and the DLL, as shown:  %@NL@%
  4968.  
  4969. %@AS@%  cvw /l appdll dummyapp%@AE@%
  4970.  
  4971.  
  4972. %@3@%%@CR:C6A00070029 @%%@AB@%7.4.5  Using CVW File Run Options%@AE@%%@EH@%%@NL@%
  4973.  
  4974. Sections 7.4.1 through 7.4.4 illustrated different ways to use the %@AB@%CVW%@AE@% File
  4975. Run command line. The following shows the general syntax of this command
  4976. line:  %@NL@%
  4977.  
  4978. %@AS@%  CVW «cvw_options» app_name«.EXE» «app_arguments»%@AE@%
  4979.  
  4980. None of the parameters are case-sensitive.  %@NL@%
  4981.  
  4982. The following list describes these parameters.  %@NL@%
  4983.  
  4984. %@TH:  90  5342 02 15 30 31 @%Parameter      Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%cvw_options%@AE@%    Specifies one or more                options that modify how %@AB@%CVW%@AE@%                runs. Acceptable options                are:               Option                        Purpose               %@AB@%/L%@AE@% %@AI@%dll_or_exe%@AE@%                 Specifies the name of an                                              application or DLL that has                                              been compiled and linked with                                             %@AB@%CVW%@AE@% symbols. %@AB@%CVW%@AE@% assumes the                                              default file extension .DLL                                              if no extension is supplied.                                              You can use the %@AB@%/L%@AE@% option                                              more than once to specify                                              multiple DLLs or executable                                              files.               %@AB@%/C%@AE@% %@AI@%command%@AE@%                    Specifies one or more %@AB@%CVW%@AE@%                                              commands which %@AB@%CVW%@AE@% executes                                              when it loads the application                                             specified by the %@AI@%app_name%@AE@%                                              parameter. The commands must                                              be enclosed in double                                              quotation marks ( " ) and                                              separated with semicolons ( ;                                             ).               %@AB@%/M%@AE@%                            Disables the use of the mouse                                             at the debugging screen. You                                              should use this option when                                              you set breakpoints in code                                              that is responsive to mouse                                              movements on the Windows                                              (application) screen.               %@AB@%/TSF%@AE@%                          Toggles the save state-file                                              status. See Section                                              <NO>7</NO>.5, "Saving Session                                             Information," for details.               %@AB@%/8%@AE@%                            Allows %@AB@%CVW%@AE@% to recognize a                                              dual-monitor configuration.                                              See <NO>7</NO>.3.1, "Setting                                              Up a Secondary Monitor," for                                              more information.               %@AB@%/B%@AE@%                            Specifies a monochrome VGA                                              monitor used as the secondary                                             display with an 8514/a                                              display. This option is valid                                             only in conjunction with the %@AB@%%@AE@%                                             %@AB@%/8%@AE@% option.               Option                        Purpose               %@AB@%/25%@AE@%                           Specifies 25-line mode for                                              the secondary VGA monitor.                                              This option is valid only in                                              conjunction with the %@AB@%/8%@AE@%                                              option.               %@AB@%/43%@AE@%                           Specifies 43-line mode for                                              the secondary VGA monitor.                                              This option is valid only in                                              conjunction with the %@AB@%/8%@AE@%                                              option.                %@AB@%/50%@AE@%                           Specifies 50-line mode for                                              the secondary VGA monitor.                                              This option is valid only in                                              conjunction with the %@AB@%/8%@AE@%                                              option. The %@AB@%/50%@AE@% option is not                                             required, since 50-line mode                                              is the default for the                                              dual-monitor configuration.%@AI@%app_name%@AE@%       Specifies the pathname of                the application for which %@AB@%%@AE@%               %@AB@%CVW%@AE@% will load symbols and                issue an initial breakpoint.               The .EXE extension is                optional.%@AI@%app_arguments%@AE@%  Specifies one or more                arguments recognized by the                application that %@AB@%CVW%@AE@% loads.%@TE:  90  5342 02 15 30 31 @%
  4985.  
  4986.  
  4987. %@2@%%@CR:C6A00070030 @%%@AB@%7.5  Saving Session Information%@AE@%%@EH@%%@NL@%
  4988.  
  4989. After your session, %@AB@%CVW%@AE@% stores session information in a file called
  4990. CURRENT.STS, which is located in the directory pointed to by the INIT
  4991. environment variable or in the current directory. If this file does not
  4992. already exist, %@AB@%CVW%@AE@% automatically creates it. Session information includes:  %@NL@%
  4993.  
  4994.  
  4995.   ■   CodeView display windows that were opened.%@NL@%
  4996.  
  4997.   ■   Breakpoint locations.%@NL@%
  4998.  
  4999.  
  5000. CodeView for Windows saves this information, which becomes the default the
  5001. next time you run a %@AB@%CVW%@AE@% session for that application.%@CR:C6A00070031 @%%@NL@%
  5002.  
  5003. You can disable this feature by placing the following entry in your
  5004. TOOLS.INI file: (The default is "y" ─yes.)  %@NL@%
  5005.  
  5006. %@AS@%  [cvw]
  5007. %@AS@%  StateFileRead: n%@AE@%
  5008.  
  5009. The %@AB@%/TSF%@AE@% option temporarily toggles this setting when you run %@AB@%CVW%@AE@%. That is,
  5010. if TOOLS.INI disables this feature, running %@AB@%CVW%@AE@% with the %@AB@%/TSF%@AE@% option saves
  5011. session information for that session only.  %@NL@%
  5012.  
  5013. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5014. NOTE
  5015.  
  5016. %@AI@%If your Windows session abnormally terminates while %@AB@%CVW%@AE@%%@AI@% is running, the
  5017. %@AI@%CURRENT.STS file may be corrupted. This may cause %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% to fail when it first
  5018. %@AI@%tries to execute the application you are debugging. If this happens, delete
  5019. %@AI@%the CURRENT.STS file before attempting to run %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% again.%@AE@%%@AE@%
  5020. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5021.  
  5022.  
  5023. %@2@%%@CR:C6A00070032 @%%@AB@%7.6  Working with the CVW Screen%@AE@%%@EH@%%@NL@%
  5024.  
  5025. When you start %@AB@%CVW%@AE@%, the %@AB@%CVW%@AE@% menu bar and three display windows─the Local
  5026. window, the Source window, and the Command window─will appear on your
  5027. secondary monitor. Figure 7.1 illustrates how the screen appears during a
  5028. debugging session.  %@NL@%
  5029.  
  5030. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  5031.  
  5032.  
  5033. %@3@%%@CR:C6A00070033 @%%@AB@%7.6.1  Using CVW Display Windows%@AE@%%@EH@%%@NL@%
  5034.  
  5035. %@AB@%CVW%@AE@% divides the screen into logically separate sections called display
  5036. windows, so that a large amount of information can be displayed in an
  5037. organized and easy-to-read fashion. Each %@AB@%CVW%@AE@% display window is a distinct
  5038. area on your monitor that operates independently of the other display
  5039. windows. The name of each display window appears in the top of the window's
  5040. frame. The following list describes the seven types of %@AB@%CVW%@AE@% display windows:%@CR:C6A00070034 @%%@NL@%
  5041.  
  5042. %@AB@%CVW Display Window%@AE@%                %@AB@%Purpose%@AE@%
  5043. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5044. Source window                     Displays the source code. You can open a
  5045.                                   second source window to view an include 
  5046.                                   file, another source file, or the same 
  5047.                                   source file at a different
  5048.                                   location.
  5049.  
  5050. Command window                    Accepts debugging commands.
  5051.  
  5052. Watch window                      Displays the current values of selected 
  5053.                                   variables.
  5054.  
  5055. Local window                      Lists the values of all variables local 
  5056.                                   to the current function or block.
  5057.  
  5058. Memory window                     Shows the contents of memory. You can 
  5059.                                   open a second Memory window to view a 
  5060.                                   different section of memory.
  5061.  
  5062. Register window                   Displays the contents of the 
  5063.                                   microprocessor's registers, as well as 
  5064.                                   the processor flags.
  5065.  
  5066. 8087 window                       Displays the registers of the 
  5067.                                   coprocessor or its software emulator.
  5068.  
  5069. Help window                       Displays the Help options or any Help 
  5070.                                   information that you request. 
  5071.  
  5072.  
  5073. %@4@%%@AB@%Opening Display Windows%@AE@%%@EH@%%@NL@%
  5074.  
  5075. There are two ways to open %@AB@%CVW%@AE@% display windows:%@CR:C6A00070035 @%%@NL@%
  5076.  
  5077.  
  5078.   ■   Choose a window from the View menu. (Note that you can open more than
  5079.       one Source or Memory window.)%@NL@%
  5080.  
  5081.   ■   Perform an operation that automatically opens a window if it is not
  5082.       already open. For example, selecting a Watch variable automatically
  5083.       opens the Watch window.%@NL@%
  5084.  
  5085.  
  5086. CodeView continually and automatically updates the contents of all its
  5087. display windows.  %@NL@%
  5088.  
  5089.  
  5090. %@4@%%@AB@%Selecting Display Windows%@AE@%%@EH@%%@NL@%
  5091.  
  5092. To select a window, click anywhere inside of it. You can also press F6 or
  5093. SHIFT+F6 to move the focus from one window to the next.%@CR:C6A00070036 @%%@NL@%
  5094.  
  5095. The selected window is called the "current" window and is marked in three
  5096. ways:  %@NL@%
  5097.  
  5098.  
  5099.   ■   The window's name is displayed in white.%@NL@%
  5100.  
  5101.   ■   The text cursor appears in the window.%@NL@%
  5102.  
  5103.   ■   The vertical and horizontal scroll bars are moved into the window.%@NL@%
  5104.  
  5105.  
  5106. Typing commands into the Source window causes %@AB@%CVW%@AE@% to temporarily shift its
  5107. focus to the Command window. Whatever you type is appended to the last line
  5108. in the Command window. If the Command window is closed, %@AB@%CVW%@AE@% beeps in
  5109. response to your entry and ignores the input.  %@NL@%
  5110.  
  5111.  
  5112. %@4@%%@AB@%Adjusting Display Windows%@AE@%%@EH@%%@NL@%
  5113.  
  5114. %@AB@%CVW%@AE@% display windows often contain more information than they can display on
  5115. the screen. Although you cannot change the relative positions of the display
  5116. windows, you can manipulate a selected window using the mouse, as follows:%@CR:C6A00070037 @%%@NL@%
  5117.  
  5118.  
  5119.   ■   To scroll the window vertically or horizontally, use the vertical or
  5120.       horizontal scroll bar.%@NL@%
  5121.  
  5122.   ■   To maximize a window so that it fills the screen, click the Up arrow
  5123.       at the right end of the window's top border. To restore the window to
  5124.       its previous size and position, click the Double arrow at the right
  5125.       end of the top border.%@NL@%
  5126.  
  5127.   ■   To change the size of a window:
  5128.  
  5129.       1.  Position the cursor anywhere on the border between two windows.%@NL@%
  5130.  
  5131.       2.  Press and hold down the left mouse button. %@NL@%
  5132.  
  5133. %@STUB@%          Two double arrows will appear on the line.%@NL@%
  5134.  
  5135.       3.  Drag the mouse to enlarge or reduce the window. %@NL@%
  5136. %@NL@%
  5137.  
  5138.   ■   To remove a window, click the small, dotted box at the left end of the
  5139.       top border. %@NL@%
  5140.  
  5141. %@STUB@%      The adjacent windows automatically expand to recover the empty space.%@NL@%
  5142.  
  5143.  
  5144. You can also use the following keyboard commands:%@CR:C6A00070038 @%%@NL@%
  5145.  
  5146. %@AB@%Keyboard Command%@AE@%                  %@AB@%Description%@AE@%
  5147. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5148. PAGE UP or PAGE DOWN              Scrolls through the text vertically.
  5149.  
  5150. CTRL+F10                          Maximizes a selected display window.
  5151.  
  5152. CTRL+F8                           Changes the size of a selected display 
  5153.                                   window.
  5154.  
  5155. CTRL+F4                           Removes a selected display window.
  5156.  
  5157. You can also choose the Maximize, Size, and Close commands from the View
  5158. menu to manipulate a selected display window.  %@NL@%
  5159.  
  5160. The different %@AB@%CVW%@AE@% display windows can help you to conduct a variety of
  5161. debugging activities simultaneously. These activities are initiated and
  5162. controlled with %@AB@%CVW%@AE@% debugging commands, which can be typed in the %@AB@%CVW%@AE@%
  5163. Command window or selected using the %@AB@%CVW%@AE@% menus.  %@NL@%
  5164.  
  5165.  
  5166. %@3@%%@CR:C6A00070039 @%%@AB@%7.6.2  Using the CVW Menu Bar%@AE@%%@EH@%%@NL@%
  5167.  
  5168. In addition to display windows, the %@AB@%CVW%@AE@% screen includes a menu bar, which
  5169. contains the following menus:%@CR:C6A00070040 @%%@NL@%
  5170.  
  5171. %@TH: 154  7674 02 34 42 @%Menu                              Command%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%File                              This menu contains the following                                   commands:                                  Open Source opens any text file and                                   reads it into the currently active                                   source window.                                  Open Module opens the source file of any                                  module for which %@AB@%CVW%@AE@% information has                                   been loaded and reads it into the                                   currently active source window.                                  Exit ends your %@AB@%CVW%@AE@% session and returns                                   you to Windows.Edit                              This menu contains the following                                   commands:                                  Copy copies selected text to the paste                                   buffer                                   Paste inserts text from the paste buffer                                  into the active window at the present                                   cursor location, if that location is                                   valid (for example, text cannot be                                   pasted into the source window).View                              This menu contains the following                                   commands:                                  Source opens a new Source window. Memory                                  opens a new Memory window.                                  Register acts as a switch to open and                                   close the Register window.                                  8087 acts as a switch to open and close                                   the 8087 window.                                  Local acts as a switch to open and close                                  the Local window.                                  Watch acts as a switch to open and close                                  the Watch window.                                  Command acts as a switch to open and                                   close the Command window.                                  Help acts as a switch to open and close                                   the Help window.                                  Maximize enlarges the current window so                                   that it fills the screen.                                  Size changes the size of the current                                   window.                                  Close closes the current window.Search%@CR:C6A00070041 @%                            This menu contains the following                                   commands:                                  Find searches for the next occurrence of                                  a string or a regular expression that                                   you supply in the Find dialog box.                                  Selected Text searches for the next                                   occurrence of a string of selected text.                                  Repeat the Last Find searches for the                                   next occurrence of whatever you                                   specified in the previous Find command.                                  Label/Function searches for a function                                   or label definition in the active Source                                  window and, if one is found, changes the                                  input focus to the active Source window.Run                               This menu contains the following                                   command:                                  Animate continues the execution of a                                   program while displaying the execution                                   path in the Source window. This type of                                   display is called an "animated trace"                                   display.Watch                             This menu contains the following                                   commands:                                  Add Watch adds an expression to the                                   Watch window.                                  Delete Watch deletes an expression from                                   the Watch window.                                  Set Breakpoint tells the program where                                   to halt execution; you can set                                   breakpoints on lines of source code,                                   variables and expressions, and Windows                                   messages.                                  Edit Breakpoint performs editing                                   functions on breakpoints; they can be                                   added, removed, modified, enabled or                                   disabled.                                  Quick Watch selects one expression for                                   the Quick Watch window.Options                           This menu contains the following                                   commands:                                  Source Window sets the display                                   characteristics of the active Source                                   window.                                  Memory Window sets the display                                   characteristics of the active Memory                                   window.                                  Trace Speed sets the speed of program                                   tracing and execution.                                  Case Sensitivity, when turned on, treats                                  uppercase and lowercase letters as                                   different characters. When turned off,                                   it does not differentiate between                                   uppercase and lowercase letters.                                  386 Instructions, when turned on,                                   recognizes all 80386 instructions in                                   32-bit values. When turned off, it reads                                  all instructions as 16-bit values Calls                             The contents and size of this menu                                   change as your program executes. It                                   shows the currently executing routine                                   and the trail of routines from which it                                   was called. Your application must                                   execute, at least, the beginning of the                                   WinMain procedure before %@AB@%CVW%@AE@% will                                   display the current routine. When you                                   select one of the lines in the Calls                                   menu, %@AB@%CVW%@AE@% displays the source code                                   corresponding to the calling location in                                  the                                   active source window.Help                              This menu contains Help information on                                   various CodeView topics.%@TE: 154  7674 02 34 42 @%
  5172.  
  5173. For a more detailed description of the %@AB@%CVW%@AE@% menu and commands, refer to %@AB@%CVW%@AE@%
  5174. Help.  %@NL@%
  5175.  
  5176.  
  5177. %@2@%%@CR:C6A00070042 @%%@AB@%7.7  Getting On-line Help in %@AB@%CVW%@AE@%%@AE@%%@EH@%%@NL@%
  5178.  
  5179. %@AB@%CVW%@AE@% on-line Help contains detailed information and examples not found in
  5180. this chapter. You can get on-line help by choosing a command from the Help
  5181. menu described in the previous section, or selecting an item on your screen
  5182. and pressing F1. Help is available on items such as commands, menus%@CR:C6A00070043 @%, dialog
  5183. boxes, and error messages.%@CR:C6A00070044 @%%@NL@%
  5184.  
  5185.  
  5186. %@2@%%@CR:C6A00070045 @%%@AB@%7.8  Displaying Program Data%@AE@%%@EH@%%@NL@%
  5187.  
  5188. %@AB@%CVW%@AE@% offers a variety of ways to display program variables, processor
  5189. registers, and memory. You can also modify the values of all these items as
  5190. the program executes. This section describes how to display:%@CR:C6A00070046 @%%@NL@%
  5191.  
  5192.  
  5193.   ■   Variables in the Watch window.%@NL@%
  5194.  
  5195.   ■   Expressions in the Watch window.%@NL@%
  5196.  
  5197.   ■   Arrays and structures in the Watch window.%@NL@%
  5198.  
  5199.   ■   A single expression in the Quick Watch window.%@NL@%
  5200.  
  5201.   ■   Windows messages in the Command window.%@NL@%
  5202.  
  5203.   ■   Memory in the Memory window.%@NL@%
  5204.  
  5205.   ■   The contents of registers in the Register window.
  5206. %@NL@%
  5207.  
  5208.  
  5209.  
  5210. %@3@%%@CR:C6A00070047 @%%@AB@%7.8.1  Displaying Variables%@AE@%%@EH@%%@NL@%
  5211.  
  5212. You can use the Watch window to monitor the value of a given variable
  5213. throughout the execution of your program. For example, %@AB@%do%@AE@%, %@AB@%for%@AE@%, and %@AB@%while%@AE@%
  5214. loops can cause problems when they don't terminate correctly. By displaying
  5215. loop variables in the Watch window, you can determine if a loop variable
  5216. achieves its proper value.%@CR:C6A00070048 @%%@NL@%
  5217.  
  5218. To add a variable to the Watch window:  %@NL@%
  5219.  
  5220.  
  5221.   1.  In the Source window, use the mouse or the DIRECTION keys to position
  5222.       the cursor on the name of the variable you want to watch.%@NL@%
  5223.  
  5224.   2.  Select the Add Watch command from the Watch menu, or press CONTROL+W.%@NL@%
  5225.  
  5226. %@STUB@%      A dialog box will appear with the selected variable's name displayed
  5227.       in the Expression field.%@NL@%
  5228.  
  5229.   3.  Press ENTER or click the OK button to add the variable to the Watch
  5230.       window.%@NL@%
  5231.  
  5232. %@STUB@%      If you want to add a different variable than the one shown in the
  5233.       dialog box, type its name over the one displayed, and then press
  5234.       ENTER.%@NL@%
  5235.  
  5236.  
  5237. The Watch window appears at the top of the screen. Adding a Watch variable
  5238. opens the Watch window automatically if it is not already open.  %@NL@%
  5239.  
  5240. When you add a local variable, you may get the following message:  %@NL@%
  5241.  
  5242. %@AS@%  Watch Expression Not in Context%@AE@%
  5243.  
  5244. This message appears when program execution has not yet reached the C
  5245. function that defines the local variable. Global variables (those declared
  5246. outside C functions) never cause %@AB@%CVW%@AE@% to display this message; you can watch
  5247. them from anywhere in the program.  %@NL@%
  5248.  
  5249. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5250. NOTE
  5251.  
  5252. %@AI@%If you are debugging more than one application or DLL, and if two or more of
  5253. %@AI@%these contain global variables with the same name, %@AB@%CVW%@AE@%%@AI@% will display the
  5254. %@AI@%variable of only the first application or DLL containing that variable name.
  5255. %@AI@%%@AE@%%@AE@%
  5256.  
  5257. %@AI@%For example, if you are debugging App1 and App2, and both contain a global
  5258. %@AI@%variable named hInst, %@AB@%CVW%@AE@%%@AI@% will always display the value of hInst in App1,
  5259. %@AI@%even if %@AE@%%@AI@%%@AB@%CVW%@AE@%%@AE@%%@AI@% stopped at a breakpoint in App2.%@AE@%%@AE@%
  5260. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5261.  
  5262. The Watch window will hold as many variables as you like; the quantity is
  5263. limited only by available memory. You can scroll through the Watch window to
  5264. position it at those variables you want to view. %@AB@%CVW%@AE@% automatically updates
  5265. all watched variables as the program runs, including those not currently
  5266. visible.  %@NL@%
  5267.  
  5268. To remove a variable from the Watch window:  %@NL@%
  5269.  
  5270.  
  5271.   1.  Choose the Delete Watch command from the Watch menu.%@NL@%
  5272.  
  5273.   2.  Scroll through the dialog box and select the variable you want to
  5274.       remove.%@NL@%
  5275.  
  5276.  
  5277. You can also position the cursor on any line in the Watch window and press
  5278. CONTROL+Y to delete the line.%@CR:C6A00070049 @%%@NL@%
  5279.  
  5280.  
  5281. %@3@%%@CR:C6A00070050 @%%@AB@%7.8.2  Displaying Expressions%@AE@%%@EH@%%@NL@%
  5282.  
  5283. You might have noticed that the Add Watch dialog box prompts for an
  5284. expression, not simply a variable name. You can add any valid combination of
  5285. variables, constants, or operators as an expression for %@AB@%CVW%@AE@% to evaluate and
  5286. display in the Watch window.%@CR:C6A00070051 @%%@NL@%
  5287.  
  5288. The advantage of evaluating expressions is that you can reduce several
  5289. variables to a single value, which can be easier to interpret than the
  5290. components that make it up. For example, imagine a %@AB@%for%@AE@% loop with two
  5291. variables whose ratio is supposed to remain constant. You suspect that one
  5292. of these variables sometimes takes the wrong value. With (var1 / var2)
  5293. displayed as an expression in the Watch window, you can easily see when the
  5294. quotient changes, without having to mentally divide two numbers.  %@NL@%
  5295.  
  5296. You can also display Boolean expressions. For example, if a variable is
  5297. never supposed to be greater than 100 or less than 25, the expression (var >
  5298. 100) evaluates to 1 (true) when var goes out-of-bounds.  %@NL@%
  5299.  
  5300.  
  5301. %@3@%%@CR:C6A00070052 @%%@AB@%7.8.3  Displaying Arrays and Structures%@AE@%%@EH@%%@NL@%
  5302.  
  5303. A program variable is usually a scalar quantity (a single character, integer
  5304. or floating-point value). The variable appears in the Watch window with the
  5305. variable name to the left, followed by an equal sign (%@AB@%=%@AE@%), and the current
  5306. value. The Watch window must provide a different way to display "aggregate"
  5307. data items, such as arrays and structures.%@CR:C6A00070053 @%%@NL@%
  5308.  
  5309. Arrays and structures contain multiple values that can be arranged in one or
  5310. more layers. You can control how these variables appear in the Watch
  5311. window─whether all, part, or none of their internal structure is displayed.
  5312. %@NL@%
  5313.  
  5314. An array initially appears in the Watch window in this form:  %@NL@%
  5315.  
  5316. %@AS@%  +Wordholder[]  = [...]%@AE@%
  5317.  
  5318. The brackets indicate that this variable contains more than one element. The
  5319. plus sign (%@AB@%+%@AE@%) indicates that the variable has more elements than are
  5320. displayed on the screen. You can expand the variable to display any or all
  5321. of its components; this technique is called "dereferencing."  %@NL@%
  5322.  
  5323. To dereference (expand) the array, double-click anywhere on the line. You
  5324. can also position the cursor on the line and press ENTER. For example, if
  5325. Wordholder is a six-character array containing the word "Basic," the Watch
  5326. window display changes to:  %@NL@%
  5327.  
  5328. %@AS@%  -Wordholder[]
  5329. %@AS@%     [0]  =  66 'B'
  5330. %@AS@%     [1]  =  97 'a'
  5331. %@AS@%     [2]  =  115 's'
  5332. %@AS@%     [3]  =  105 'i'
  5333. %@AS@%     [4]  =  99 'c'
  5334. %@AS@%     [5]  =  0 ''%@AE@%
  5335.  
  5336. Note that both the individual character values and their ASCII decimal
  5337. equivalents are listed. The minus sign (-) indicates no further expansion is
  5338. possible. To contract the array, double-click its line again or position the
  5339. cursor on the line and press ENTER.  %@NL@%
  5340.  
  5341.  
  5342. %@4@%%@AB@%Displaying Character Arrays%@AE@%%@EH@%%@NL@%
  5343.  
  5344. If viewing a character array in this form is inconvenient, cast the
  5345. variable's name to a character pointer by placing the following in front of
  5346. the name:  %@NL@%
  5347.  
  5348. %@AS@%  (char *)%@AE@%
  5349.  
  5350. The character array is then displayed as a string delimited by apostrophes.%@CR:C6A00070054 @%%@NL@%
  5351.  
  5352.  
  5353. %@4@%%@AB@%Displaying Multidimensional Arrays%@AE@%%@EH@%%@NL@%
  5354.  
  5355. You can display arrays with more than one dimension. For example, imagine a
  5356. 5-by-5 integer array named Matrix, whose diagonal elements are the numbers 1
  5357. through 5 and whose other elements are zero. Unexpanded, the array is
  5358. displayed like this:%@CR:C6A00070055 @%%@NL@%
  5359.  
  5360. %@AS@%  +Matrix[]  = [...]%@AE@%
  5361.  
  5362. Double-clicking Matrix (or pressing ENTER) changes the display to:  %@NL@%
  5363.  
  5364. %@AS@%  -Matrix[]
  5365. %@AS@%    +[0][]  =  [...]
  5366. %@AS@%    +[1][]  =  [...]
  5367. %@AS@%    +[2][]  =  [...]
  5368. %@AS@%    +[3][]  =  [...]
  5369. %@AS@%    +[4][]  =  [...]%@AE@%
  5370.  
  5371. The actual values of the elements are not shown yet. You have to descend one
  5372. more level to see them. For example, to view the elements of the third row
  5373. of the array, position the cursor anywhere on the +[2] line and press ENTER.
  5374. The following code shows the third row of the array dereferenced:  %@NL@%
  5375.  
  5376. %@AS@%  -Matrix[]
  5377. %@AS@%    +[0][]  =  [...]
  5378. %@AS@%    +[1][]  =  [...]
  5379. %@AS@%    -[2][]
  5380. %@AS@%       [0]  = 0
  5381. %@AS@%       [1]  = 0
  5382. %@AS@%       [2]  = 3
  5383. %@AS@%       [3]  = 0
  5384. %@AS@%       [4]  = 0
  5385. %@AS@%    +[3][]  =  [...]
  5386. %@AS@%    +[4][]  =  [...]%@AE@%
  5387.  
  5388. Dereferencing the fifth row (+[4]) of the array produces this display:  %@NL@%
  5389.  
  5390. %@AS@%  -Matrix[]
  5391. %@AS@%    +[0][]  =  [...]
  5392. %@AS@%    +[1][]  =  [...]
  5393. %@AS@%    -[2][]
  5394. %@AS@%       [0]  = 0
  5395. %@AS@%       [1]  = 0
  5396. %@AS@%       [2]  = 3
  5397. %@AS@%       [3]  = 0
  5398. %@AS@%       [4]  = 0
  5399. %@AS@%    +[3][]  =  [...]
  5400. %@AS@%    -[4][]
  5401. %@AS@%       [0]  = 0
  5402. %@AS@%       [1]  = 0
  5403. %@AS@%       [2]  = 0
  5404. %@AS@%       [3]  = 0
  5405. %@AS@%       [4]  = 5%@AE@%
  5406.  
  5407. Any element of an array or structure can be independently expanded or
  5408. contracted; you need not display every element of the variable. If you only
  5409. want to view one or two elements of a large array, specify the particular
  5410. array or structure elements in the expression field of the Add Watch dialog
  5411. box.  %@NL@%
  5412.  
  5413. You can dereference a pointer in the same way as an array or structure. The
  5414. Watch window will display the pointer address, followed by all the elements
  5415. of the variable to which the pointer currently refers. You can display
  5416. multiple levels of indirection (that is, pointers referencing other
  5417. pointers) simultaneously.  %@NL@%
  5418.  
  5419.  
  5420. %@4@%%@AB@%Displaying Dynamic Array Elements%@AE@%%@EH@%%@NL@%
  5421.  
  5422. An array may have dynamic elements that change as some other variable
  5423. changes. Just as you can display a particular element of an array by
  5424. specifying its subscript, you can also display a dynamic array element, by
  5425. specifying its variable subscript. For example, suppose that the loop
  5426. variable p is a subscript for the array variable Catalogprice. The Watch
  5427. window expression Catalogprice[p] displays only the array element currently
  5428. specified by the variable p, not the entire array.%@CR:C6A00070056 @%%@NL@%
  5429.  
  5430. You can mix constant and variable subscripts. For example, the expression
  5431. BigArray[3][i] displays only the element in the third row of the array to
  5432. which the index variable i points.  %@NL@%
  5433.  
  5434.  
  5435. %@3@%%@CR:C6A00070057 @%%@AB@%7.8.4  Using the Quick Watch Command%@AE@%%@EH@%%@NL@%
  5436.  
  5437. Using the Quick Watch command is a convenient way to take a quick look at a
  5438. variable or expression. Since the Quick Watch window can only display one
  5439. variable at a time, you would not use it for most of the variables you want
  5440. to view.%@CR:C6A00070058 @%%@NL@%
  5441.  
  5442. Selecting the Quick Watch command from the Watch menu (or pressing SHIFT+F9)
  5443. displays the Quick Watch dialog box. If the text cursor is in the Source,
  5444. Local, or Watch window, the variable at the current cursor position appears
  5445. in the dialog box.  %@NL@%
  5446.  
  5447. The Quick Watch display automatically expands arrays and structures to their
  5448. first level. For example, an array with three dimensions will expand to the
  5449. first dimension. You can expand or contract an element just as you would in
  5450. the Watch window; position the cursor on the appropriate line and press
  5451. ENTER. If the array needs more lines than the Quick Watch window can
  5452. display, drag the mouse along the scroll bar, or press DOWN ARROW or PAGE
  5453. DOWN to view the rest of the array.  %@NL@%
  5454.  
  5455. You can add Quick Watch variables to the Watch window. If you decide to add
  5456. a Quick Watch item to the Watch window, select the Add Watch button. Arrays
  5457. and structures appear in the Watch window expanded as they were displayed in
  5458. the Quick Watch box.  %@NL@%
  5459.  
  5460.  
  5461. %@3@%%@CR:C6A00070059 @%%@AB@%7.8.5  Tracing Windows Messages%@AE@%%@EH@%%@NL@%
  5462.  
  5463. You can trace the occurrence of a Windows message or an entire class of
  5464. Windows messages by using the %@AB@%wwm%@AE@% (Watch Windows Message) command. %@AB@%CVW%@AE@% will
  5465. display the messages in the %@AB@%CVW%@AE@% Command window.%@CR:C6A00070060 @%%@NL@%
  5466.  
  5467. To trace a Windows message or message class, type the %@AB@%wwm%@AE@% command in the
  5468. Command window. The syntax for the command is:  %@NL@%
  5469.  
  5470. %@AS@%  wwm winproc msgname | msgclasses%@AE@%
  5471.  
  5472. The %@AI@%winproc%@AE@% parameter is the symbol name or address of an application's
  5473. window function. The %@AI@%msgname%@AE@% parameter is the name of a Windows message,
  5474. such as WM_PAINT. The %@AI@%msgclasses%@AE@% parameter is a string of characters that
  5475. identify one or more classes of messages to be traced. The classes are
  5476. consistent with those defined in the Windows Spy application; they are:  %@NL@%
  5477.  
  5478. %@AB@%Message Class%@AE@%                     %@AB@%Type of Windows Message%@AE@%
  5479. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5480. m                                 mouse 
  5481.  
  5482. w                                 window management
  5483.  
  5484. n                                 input
  5485.  
  5486. s                                 system
  5487.  
  5488. i                                 initialization
  5489.  
  5490. c                                 clipboard
  5491.  
  5492. d                                 DDE
  5493.  
  5494. z                                 nonclient
  5495.  
  5496. For example, the following command traces all mouse and input messages sent
  5497. to MainWndProc:  %@NL@%
  5498.  
  5499. %@AS@%  wwm MainWndProc mn%@AE@%
  5500.  
  5501. The %@AB@%CVW%@AE@% Command window displays Windows messages in the following  format:  %@NL@%
  5502.  
  5503. %@AS@%  HWND:lc00 wParm:0000 lParm:000000 msg:000F WM_PAINT%@AE@%
  5504.  
  5505.  
  5506. %@3@%%@CR:C6A00070061 @%%@AB@%7.8.6  Displaying Memory%@AE@%%@EH@%%@NL@%
  5507.  
  5508. Selecting the Memory command from the View menu opens a Memory window. %@AB@%CVW%@AE@%
  5509. allows you to have two Memory windows open at one time.%@CR:C6A00070062 @%%@NL@%
  5510.  
  5511. By default, memory is displayed as hexadecimal byte values, with 16 bytes
  5512. per line. At the end of each line is a second display of the same memory in
  5513. ASCII form. Values that correspond to printable ASCII characters (decimal 32
  5514. through 127) are displayed in that form. Values outside this range are shown
  5515. as periods ( . ).  %@NL@%
  5516.  
  5517. Byte values are not always the most convenient way to view memory. If the
  5518. area of memory you are examining contains character strings or
  5519. floating-point values, you might prefer to view them in a directly readable
  5520. form. The Memory Window command of the Options menu displays a dialog box
  5521. with a variety of display options:  %@NL@%
  5522.  
  5523.  
  5524.   ■   ASCII characters%@NL@%
  5525.  
  5526.   ■   Byte, word, or double-word binary values%@NL@%
  5527.  
  5528.   ■   Signed or unsigned integer decimal values%@NL@%
  5529.  
  5530.   ■   Short (32-bit), long (64-bit), or 10-byte (80-bit) floating-point
  5531.       values%@NL@%
  5532.  
  5533.  
  5534. You can also directly cycle through these display formats by pressing
  5535. SHIFT+F3.  %@NL@%
  5536.  
  5537. If a section of memory cannot be displayed as a valid floating-point number,
  5538. the number shown includes the characters NAN (not a number).  %@NL@%
  5539.  
  5540.  
  5541. %@4@%%@AB@%Displaying Local and Global Memory Objects%@AE@%%@EH@%%@NL@%
  5542.  
  5543. %@AB@%CVW%@AE@% also allows you to display global and local memory objects in their
  5544. respective Windows heaps. You can display the heap of global memory objects
  5545. with the %@AB@%wdg%@AE@% (Display Global Heap) command, and the heap of local memory
  5546. objects with the %@AB@%wdl%@AE@% (Display Local Heap) command. Both of these commands
  5547. will display the entire heap of global or local memory objects in the
  5548. Command window.%@CR:C6A00070063 @%%@NL@%
  5549.  
  5550. For the %@AB@%wdg%@AE@% command, you can specify the single object parameter to display
  5551. a partial list of the global heap. When you use the single object parameter
  5552. with the %@AB@%wdg%@AE@% command, the Command window will display the first five memory
  5553. objects in the global heap, starting at the handle rather than at the
  5554. beginning of the heap. The following illustrates the output format of the
  5555. %@AB@%wdg%@AE@% (Display Global Heap) command:  %@NL@%
  5556.  
  5557. %@AS@%  "                           
  5558. %@AS@%  047E   (0A7D) 00000020b   MYAPP    PRIV MOVEABLE DISCARDABLE
  5559. %@AS@%                                                
  5560. %@AS@%  0A6D          00000134b   MYAPP    DATA FIXED PGLOCKED=0001
  5561. %@AS@%                                
  5562. %@AS@%  0806  (0805)  00000600b   PDB (0465)
  5563. %@AS@%  
  5564. %@AS@%  FREE          000000A0b%@AE@%
  5565.  
  5566. The following describes the indicated fields:  %@NL@%
  5567.  
  5568. %@TH:  36  1121 01 03 36 37 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%"  A global memory handle value.    Global memory objects are    displayed in the order in which    Windows manages them, which is    typically not in ascending handle    order.   A memory selector. This value is    not displayed if the selector    value is the same as the global    handle, as is the case for DATA    objects.   The length in bytes of the global    memory object.   The name of the application or    library module that allocated the    object. The name "PDB" is for    Process Descriptor Block.    The type of global memory object:   Type                                Meaning   PRIV                                Application or DLL global data, or                                        system object   CODE                                Code segment   DATA                                Data segment of application or DLL   FREE                                Free memory block in the global                                        heap%@TE:  36  1121 01 03 36 37 @%
  5569.  
  5570. %@TH:  30   976 01 02 37 37 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%  One or more of the following   combinations of memory allocation   attributes:  %@AB@%MOVEABLE %@AE@%  %@AB@%MOVEABLE DISCARDABLE%@AE@%  %@AB@%FIXED%@AE@%  The disposition of the object if it  is moveable:  Disposition                          Meaning  LOCKED=%@AI@%number%@AE@%                        Number of times the object has been                                       locked with the %@AB@%GlobalLock%@AE@% or %@AB@%%@AE@%                                       %@AB@%LockData%@AE@% functions  PGLOCKED=%@AI@%number%@AE@%                      Number of times Windows has locked                                        the object in its linear address                                        space.  The owner handle of the Process   Descriptor Block.  A free memory block, followed by   the size of the free block.%@TE:  30   976 01 02 37 37 @%
  5571.  
  5572. The following shows the output of the %@AB@%wdl%@AE@% (Display Local Heap) command:  %@NL@%
  5573.  
  5574. %@AS@%  "             
  5575. %@AS@%  190A:  000A   BUSY   (16DA)%@AE@%
  5576.  
  5577. The following describes the indicated fields:  %@NL@%
  5578.  
  5579. %@TH:  16   482 01 03 36 37 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%"  The offset of the local memory    object in the local data segment.   The length in bytes of the object.   One of the following dispositions:   Disposition                         Meaning   BUSY                                Currently allocated   FREE                                A free block in the local heap   A local memory handle%@TE:  16   482 01 03 36 37 @%
  5580.  
  5581.  
  5582. %@4@%%@AB@%Displaying Variables with a Live Expression%@AE@%%@EH@%%@NL@%
  5583.  
  5584. Section 7.8.4, "Using the Quick Watch Command," explained how to display a
  5585. specific array element by adding the appropriate expression to the Watch
  5586. window. It is also possible to watch a particular array element or structure
  5587. element in the Memory window. This %@AB@%CVW%@AE@% display feature is called a "live
  5588. expression."%@CR:C6A00070064 @%%@NL@%
  5589.  
  5590. "Live" means that the area of memory displayed changes to reflect the value
  5591. of a pointer or subscript. For example, if Buffer is an array and pBuf is a
  5592. pointer to     that array, then *pBuf points to the array element currently
  5593. referenced. A live expression displays the section of memory beginning with
  5594. this element.  %@NL@%
  5595.  
  5596. %@AB@%CVW%@AE@% displays live expressions in a Memory window. To create a live
  5597. expression:  %@NL@%
  5598.  
  5599.  
  5600.   1.  Select the Memory Window command from the Options menu.%@NL@%
  5601.  
  5602.   2.  Select the live expression check box and type the name of the element
  5603.       you want to view. %@NL@%
  5604.  
  5605. %@STUB@%      For example, if StrgPtr is a pointer to an array of characters, and
  5606.       you want to see what it currently points to, type:%@NL@%
  5607.  
  5608. %@AS@%      *StrgPtr%@AE@%
  5609.  
  5610.   3.  Click the OK button or press ENTER.%@NL@%
  5611.  
  5612.  
  5613. A new Memory window opens. The first memory location in the window is the
  5614. first memory location of the live expression. The section of memory
  5615. displayed changes to the section the pointer currently references.  %@NL@%
  5616.  
  5617. You can use the Memory Window command of the Options menu to display the
  5618. value of the live expression in a readable form. This is especially
  5619. convenient when the live expression represents strings or floating-point
  5620. values, which are difficult to interpret in hexadecimal form.  %@NL@%
  5621.  
  5622. It is usually more convenient to view an item in the Watch window than as a
  5623. live expression. However, you might find some items easier to view as live
  5624. expressions. For example, you can examine what is currently at the top of
  5625. the stack by specifying SS:SP as the live expression.  %@NL@%
  5626.  
  5627.  
  5628. %@4@%%@AB@%Dereferencing Memory Handles%@AE@%%@EH@%%@NL@%
  5629.  
  5630. In a Windows application, the %@AB@%LocalLock%@AE@% and %@AB@%GlobalLock%@AE@% functions are used to
  5631. dereference memory handles into near or far pointers. In a debugging
  5632. session, you may know the handle of the memory object, but might not know
  5633. what near or far address it dereferences to, unless you are debugging in an
  5634. area where the program has just completed a %@AB@%LocalLock%@AE@% and %@AB@%GlobalLock%@AE@%
  5635. function call. To get the near and far pointer addresses for your local and
  5636. global handles, use the %@AB@%(lh)%@AE@% and %@AB@%(gh)%@AE@% type casts. For example, you could use
  5637. %@AB@%(lh)%@AE@% to dereference the array in the following code:%@CR:C6A00070065 @%%@NL@%
  5638.  
  5639. %@AS@%  HANDLE hLocalMem;
  5640. %@AS@%  int near *pnArray;
  5641. %@AS@%  hLocalMem = LocalAlloc(LMEM_MOVEABLE,100);
  5642. %@AS@%  pnArray = LocalLock(hLocalMem);
  5643. %@AS@%       /* load values into the array */
  5644. %@AS@%  LocalUnlock(hLocalMem);%@AE@%
  5645.  
  5646. To properly display this array in %@AB@%CVW%@AE@%, you would use the following command:
  5647. %@NL@%
  5648.  
  5649. %@AS@%  dw (lh)hLocalMem%@AE@%
  5650.  
  5651. If you set a breakpoint immediately after the %@AB@%LocalLock%@AE@% function, you could
  5652. find out where the local object was allocated in the application's data
  5653. segment by looking at the value of the pnArray variable. To display the
  5654. value of pnArray, use the following %@AB@%CVW%@AE@% command:  %@NL@%
  5655.  
  5656. %@AS@%  dw pnArray%@AE@%
  5657.  
  5658. Note that you cannot rely on the value of pnArray anywhere else in the
  5659. program because it may change or the memory object may move.  %@NL@%
  5660.  
  5661. If the memory object is a string, you can display it using double type
  5662. casting, as shown:  %@NL@%
  5663.  
  5664. %@AS@%  HANDLE hGlobalMem;
  5665. %@AS@%  LPSTR  lpstr;
  5666. %@AS@%  
  5667. %@AS@%  hGlobalMem = GlobalAlloc(GMEM_MOVEABLE, 10L)
  5668. %@AS@%  lpstr = GlobalLock(hGlobalMem);
  5669. %@AS@%  lstrcpy(lpstr,"ABCDEF");
  5670. %@AS@%  GlobalUnlock(hGlobalMem);%@AE@%
  5671.  
  5672. You could then display the contents of the string with the following
  5673. statement:  %@NL@%
  5674.  
  5675. %@AS@%  ? *(char far*) (gh)lpstr,s%@AE@%
  5676.  
  5677. The %@AB@%(gh)%@AE@% type cast will return a pointer to the far address of the global
  5678. memory object.  %@NL@%
  5679.  
  5680.  
  5681. %@3@%%@CR:C6A00070066 @%%@AB@%7.8.7  Displaying the Contents of Registers%@AE@%%@EH@%%@NL@%
  5682.  
  5683. Selecting the Register command from the View menu (or pressing F2) opens a
  5684. window on the right side of the screen. The current values of the
  5685. microprocessor's registers appear in this window.%@CR:C6A00070067 @%%@NL@%
  5686.  
  5687. At the bottom of the window are a group of mnemonics representing the
  5688. processor flags. When you first open the Register window, all values are
  5689. shown in normal-intensity video. Any subsequent changes are marked in
  5690. high-intensity video. For example, suppose the overflow flag is not set when
  5691. the Register window is first opened. The corresponding mnemonic is NV and it
  5692. appears in normal-intensity video. If the overflow flag is subsequently set,
  5693. the mnemonic changes to OV and appears in high-intensity video.  %@NL@%
  5694.  
  5695. Selecting the 386 Instructions command from the Options menu displays the
  5696. registers as 32-bit values. This command is valid only if your computer uses
  5697. an 80386 processor. Selecting this command a second time changes the
  5698. registers back to 16-bit values.  %@NL@%
  5699.  
  5700. You can also display the registers of an 8087/287/387 coprocessor in a
  5701. separate window by selecting the 8087 command from the View menu. If your
  5702. program uses the coprocessor emulator, the emulated registers are displayed
  5703. instead.  %@NL@%
  5704.  
  5705.  
  5706. %@3@%%@CR:C6A00070068 @%%@AB@%7.8.8  Displaying Windows Modules%@AE@%%@EH@%%@NL@%
  5707.  
  5708. The %@AB@%wdm%@AE@% (Dump Modules) command displays a list of all the DLL and task
  5709. modules that Windows has loaded. For each module, the list shows the module
  5710. handle, the type of module (DLL or task), the name of the module, and the
  5711. pathname of the module.  %@NL@%
  5712.  
  5713.  
  5714. %@2@%%@CR:C6A00070069 @%%@AB@%7.9  Modifying Program Data%@AE@%%@EH@%%@NL@%
  5715.  
  5716. You can easily change the values of variables, memory locations, or
  5717. registers displayed in the Watch, Local, Memory, Register, or 8087 window.
  5718. Simply position the cursor at the value you want to change and type in the
  5719. appropriate value. If you change your mind, press ALT+BACKSPACE to undo the
  5720. last change you made.  %@NL@%
  5721.  
  5722. The Memory window displays the starting address of each line in
  5723. segment:offset form. Altering the address automatically shifts the display
  5724. to the corresponding section of memory. If that section is not used by your
  5725. program, memory locations are displayed as double question marks (??).%@CR:C6A00070070 @%%@NL@%
  5726.  
  5727. You can also change the values of memory locations by modifying the right
  5728. side of the memory display, which shows memory values in ASCII form. For
  5729. example, to change a byte from decimal 75 to decimal 85, place the cursor
  5730. over the letter K, which corresponds to the position where the memory value
  5731. is 75 (K is ASCII 75), and type in U (U is ASCII 85).  %@NL@%
  5732.  
  5733. To change a processor flag, click its mnemonic; or position the cursor on a
  5734. mnemonic, and then press any key (except TAB or SPACEBAR). Repeat these
  5735. operations to restore the flag to its previous setting.  %@NL@%
  5736.  
  5737. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5738. IMPORTANT
  5739.  
  5740. %@AI@%You should be especially cautious when altering "machine-level" values. The
  5741. %@AI@%effect of changing a register, flag, or memory location may vary from no
  5742. %@AI@%effect at all to crashing the operating system. You can alter most items
  5743. %@AI@%from the Watch window; although sometimes it is useful to modify a register
  5744. %@AI@%or memory directly.%@AE@%
  5745. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5746.  
  5747. One example of altering memory directly would be to replace values in the AX
  5748. register. C functions return their values through this register. By altering
  5749. the AX register directly, you can change a returned value without having to
  5750. execute the function that returns it.%@CR:C6A00070071 @%%@NL@%
  5751.  
  5752.  
  5753. %@2@%%@CR:C6A00070072 @%%@AB@%7.10  Controlling Program Execution%@AE@%%@EH@%%@NL@%
  5754.  
  5755. This section describes how you can use %@AB@%CVW%@AE@% to control the execution of your
  5756. application.%@CR:C6A00070073 @%%@NL@%
  5757.  
  5758. There are two possible forms of program execution in CodeView for Windows:  %@NL@%
  5759.  
  5760. %@AB@%Program Execution%@AE@%                 %@AB@%Description%@AE@%
  5761. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5762. Continuous                        The program executes until either a 
  5763.                                   previously specified "breakpoint" has 
  5764.                                   been reached or the program terminates 
  5765.                                   normally.
  5766.  
  5767. Single-step                       The program pauses after each line of 
  5768.                                   code has been executed. %@CR:C6A00070074 @%
  5769.  
  5770. Sections 7.10.1, "Continuous Execution," and 7.10.2, "Single-Step
  5771. Execution," explain the most effective way to use each form of execution.
  5772. Section 7.10.3, "Jumping to a Particular Location," explains how to force
  5773. the system to jump to a particular location in your program. Section 7.10.4,
  5774. "Interrupting Your Program," tells you how to interrupt your program.  %@NL@%
  5775.  
  5776.  
  5777. %@3@%%@CR:C6A00070075 @%%@AB@%7.10.1  Continuous Execution%@AE@%%@EH@%%@NL@%
  5778.  
  5779. Continuous execution lets you quickly execute bug-free sections of code. The
  5780. simplest way to initiate continuous execution is to click the right mouse
  5781. button on the line of code you want to debug or examine in more detail. The
  5782. program executes at full speed up to the start of this line, then pauses.
  5783. You can do the same thing by positioning the text cursor on this line, then
  5784. pressing F7.%@CR:C6A00070076 @%%@NL@%
  5785.  
  5786. You can also pause execution at a specific line of code with a breakpoint.
  5787. %@AB@%CVW%@AE@% provides you with several types of breakpoints to control your program's
  5788. execution. The sections that follow describe how to use breakpoints.  %@NL@%
  5789.  
  5790.  
  5791. %@4@%%@AB@%Selecting Breakpoint Lines%@AE@%%@EH@%%@NL@%
  5792.  
  5793. You can skip over the parts of the program that you don't want to examine by
  5794. specifying one or more lines as breakpoints. The program executes at full
  5795. speed up to the first breakpoint, then pauses. Pressing F5 continues program
  5796. execution up to the next breakpoint, and so on. You can set as many
  5797. breakpoints as you want, provided that you have available memory.%@CR:C6A00070077 @%%@NL@%
  5798.  
  5799. There are several ways to set breakpoints:  %@NL@%
  5800.  
  5801.  
  5802.   ■   Double-click anywhere on the desired breakpoint line. The selected
  5803.       line is highlighted to show that it is a breakpoint. To remove the
  5804.       breakpoint, double-click on the line a second time.%@NL@%
  5805.  
  5806.   ■   Position the cursor anywhere on the line at which you want execution
  5807.       to pause. Press F9 to select the line as a breakpoint and highlight
  5808.       it. Press F9 a second time to remove the breakpoint and highlighting.%@NL@%
  5809.  
  5810.   ■   Display the Set Breakpoint dialog box by choosing Set Breakpoint from
  5811.       the Watch menu. Choose one of the breakpoint options that permits you
  5812.       to specify a line (location). The line on which the text cursor
  5813.       currently rests is the default breakpoint line in the Location field.
  5814.       If this line is not the location you want, replace it with the line
  5815.       number where you want the breakpoint. When you type in a new line
  5816.       number, make sure that you precede it with a period.%@NL@%
  5817.  
  5818.  
  5819. A breakpoint line must be a program line that represents executable code.
  5820. You cannot select a blank line, a comment line, or a declaration line (such
  5821. as a variable declaration or a preprocessor statement) as a breakpoint.%@CR:C6A00070078 @%%@NL@%
  5822.  
  5823. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5824. NOTE
  5825.  
  5826. %@AI@%By default, Microsoft compilers optimize your code. In the process of
  5827. %@AI@%optimization, some lines of code may be repositioned or reorganized for more
  5828. %@AI@%efficient execution. These changes can prevent CodeView from recognizing the
  5829. %@AI@%corresponding lines of source code as breakpoints. Therefore, it is a good
  5830. %@AI@%idea to disable optimization during development (use the %@AB@%/Od%@AE@%%@AI@% switch). You
  5831. %@AI@%can restore optimization once debugging is completed.%@AE@%%@AE@%
  5832. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5833.  
  5834. A breakpoint can also be set at a function or an explicit address. To set a
  5835. breakpoint at a function, simply enter its name in the Set Breakpoint dialog
  5836. box. To set a breakpoint at an address, enter the address in CS:IP form.  %@NL@%
  5837.  
  5838. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5839. NOTE
  5840.  
  5841. %@AI@%If you are debugging more than one application or DLL that share names for
  5842. %@AI@%certain window procedures (such as MainWndProc), you can only refer by name
  5843. %@AI@%to the procedure that is defined in the first application or DLL.%@AE@%
  5844. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5845.  
  5846. You can remove a breakpoint by selecting it in the Source window and
  5847. pressing F9 or the using the Edit Breakpoints screen of the Watch menu. When
  5848. your program pauses at a breakpoint, you can continue execution by pressing
  5849. F5 or clicking the F5 button in the display. %@CR:C6A00070079 @%  %@NL@%
  5850.  
  5851.  
  5852. %@4@%%@AB@%Setting Breakpoint Values%@AE@%%@EH@%%@NL@%
  5853.  
  5854. Breakpoints are not limited to specific lines of code. %@AB@%CVW%@AE@% can also break
  5855. execution when an expression reaches a particular value, or just changes
  5856. value. Use one of the following methods to set a breakpoint value:%@CR:C6A00070080 @%%@NL@%
  5857.  
  5858.  
  5859.   ■   To pause execution when an expression %@AI@%changes%@AE@% value, type the name of
  5860.       the expression in the expression field.%@NL@%
  5861.  
  5862.   ■   To pause execution when a expression %@AI@%reaches%@AE@% a particular value, type
  5863.       an expression that is usually false in the Expression field of the Set
  5864.       Breakpoint dialog box. %@NL@%
  5865.  
  5866. %@STUB@%      For example, if you want to pause when a variable called looptest
  5867.       equals 17, type:%@NL@%
  5868.  
  5869. %@AS@%      looptest == 17. %@AE@%
  5870.  
  5871. %@STUB@%      Execution will halt when this statement becomes true.%@NL@%
  5872.  
  5873.  
  5874. You can also use the Set Breakpoint dialog box to combine value breakpoints
  5875. with line breakpoints so that execution stops at a specific line only if an
  5876. expression has simultaneously reached a particular value, or changed value.
  5877. %@NL@%
  5878.  
  5879. For large variables (such as arrays or character strings), you can specify
  5880. the number of bytes you want checked (up to 32K) in the length field.  %@NL@%
  5881.  
  5882. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5883. NOTE
  5884.  
  5885. %@AI@%When a breakpoint is tied to a variable, %@AB@%CVW%@AE@%%@AI@% must check the variable's value
  5886. %@AI@%after each machine instruction is executed. This computational overhead
  5887. %@AI@%slows execution greatly. For maximum speed when debugging, either tie value
  5888. %@AI@%breakpoints to specific lines, or only set value breakpoints after you have
  5889. %@AI@%reached the section of code that needs to be debugged.%@AE@%%@AE@%
  5890. ────────────────────────────────────────────────────────────────────────────%@NL@%
  5891.  
  5892.  
  5893. %@4@%%@AB@%Setting Breakpoints on Windows Messages%@AE@%%@EH@%%@NL@%
  5894.  
  5895. In the Windows environment, you can also set a breakpoint on a Windows
  5896. message or an entire class of Windows messages. This feature lets you track
  5897. your application's response to user input and window-management messages.%@CR:C6A00070081 @%%@NL@%
  5898.  
  5899. To set a breakpoint on a Windows message or message class, type the %@AB@%wbm%@AE@%
  5900. (Windows Breakpoint Message) command in the Watch window. The syntax for the
  5901. command is:  %@NL@%
  5902.  
  5903. %@AS@%  wbm winproc msgname | msgclasses%@AE@%
  5904.  
  5905. The %@AI@%winproc%@AE@% parameter is the symbol name or address of an application's
  5906. window function. The %@AI@%msgname%@AE@% parameter is the name of a Windows message,
  5907. such as WM_PAINT. The %@AI@%msgclasses%@AE@% parameter is a string of characters that
  5908. identify one or more classes of messages. The classes are consistent with
  5909. those defined in the Windows Spy application; they are:  %@NL@%
  5910.  
  5911. %@AB@%Message Class%@AE@%                     %@AB@%Type of Windows Message%@AE@%
  5912. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5913. m                                 mouse 
  5914.  
  5915. w                                 window management
  5916.  
  5917. n                                 input
  5918.  
  5919. s                                 system
  5920.  
  5921. %@AB@%Message Class%@AE@%                     %@AB@%Types of Windows Message%@AE@%
  5922. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  5923. i                                 initialization
  5924.  
  5925. c                                 clipboard
  5926.  
  5927. d                                 DDE
  5928.  
  5929. z                                 nonclient
  5930.  
  5931. For example, if your application is failing to refresh the client area of a
  5932. window, you might set a breakpoint on the WM_PAINT message so that you can
  5933. watch your program's behavior. The following command will halt execution
  5934. whenever the application's MainWndProc function receives a WM_PAINT message:
  5935. %@NL@%
  5936.  
  5937. %@AS@%  wbm MainWndProc WM_PAINT%@AE@%
  5938.  
  5939.  
  5940. %@4@%%@AB@%Using Breakpoints%@AE@%%@EH@%%@NL@%
  5941.  
  5942. Here are several examples that show how breakpoints can help you find the
  5943. cause of a problem.%@CR:C6A00070082 @%%@NL@%
  5944.  
  5945. One of the most common bugs is a %@AB@%for%@AE@% loop that executes too many or too few
  5946. times. If you set a breakpoint that encloses the loop statements, the
  5947. program pauses after each iteration. With the loop variable or critical
  5948. program variables in the Watch or Local windows, you can easily see what the
  5949. loop is doing wrong.  %@NL@%
  5950.  
  5951. You do not have to pause a program the first time you reach a breakpoint.
  5952. %@AB@%CVW%@AE@% lets you specify the number of times you want to ignore the breakpoint
  5953. condition before pausing. To specify how many times a breakpoint line is
  5954. executed:  %@NL@%
  5955.  
  5956.  
  5957.   1.  Choose the Set Breakpoint command from the Watch menu.%@NL@%
  5958.  
  5959.   2.  Type the decimal number in the Pass Count field of the dialog box.%@NL@%
  5960.  
  5961.  
  5962. For example, suppose your program repeatedly calls a function to create a
  5963. binary tree. You suspect that something goes wrong with the process about
  5964. halfway through. You could mark the line that calls the function as the
  5965. breakpoint, then specify how many times this line is to execute before
  5966. execution pauses. Running the program creates a representative (but
  5967. unfinished) tree structure that can be examined from the Watch window. You
  5968. can then continue your analysis using "single-step" execution, which is
  5969. described in the next section.  %@NL@%
  5970.  
  5971. Another programming error is erroneously assigning a value to a variable. If
  5972. you enter a variable in the expression field of the Set Breakpoint dialog
  5973. box, execution will break every time the variable changes value. By
  5974. evaluating a variable expression, you can halt execution when its value
  5975. changes unintentionally.  %@NL@%
  5976.  
  5977. Breakpoints are a convenient way to pause the program so that you can assign
  5978. new values to variables. For example, if a limit value is set by a variable,
  5979. you can change the value to see if it affects the program's execution.
  5980. Similarly, you can pass a variety of values to a %@AB@%switch%@AE@% statement to see if
  5981. they are correctly processed. This ability to alter variables is an
  5982. especially convenient way to test new functions without having to write a
  5983. stand-alone test program.  %@NL@%
  5984.  
  5985. When your program reaches a breakpoint and you change a variable, you might
  5986. want to watch each step execute while you check the value of that variable.
  5987. You can do this with a %@AB@%CVW%@AE@% technique called "single-stepping."  %@NL@%
  5988.  
  5989.  
  5990. %@3@%%@CR:C6A00070083 @%%@AB@%7.10.2  Single-Step Execution%@AE@%%@EH@%%@NL@%
  5991.  
  5992. When single-stepping, %@AB@%CVW%@AE@% pauses after each line of code is executed. If a
  5993. line contains more than one executable statement, %@AB@%CVW%@AE@% executes all the
  5994. statements on the line before pausing. The next line to be executed is
  5995. highlighted in reverse video.  %@NL@%
  5996.  
  5997. You can use either the Step function or the Trace function to single-step
  5998. through a program. Step does not display each function call as the program
  5999. executes. All the code in the function is executed; but the function appears
  6000. to execute as a single step. To use Step, press F10. Trace displays each
  6001. step of every function for which %@AB@%CVW%@AE@% has symbolic information. Each line of
  6002. the function is executed as a separate step. To use Trace, press F8. (%@AB@%CVW%@AE@%
  6003. has no symbolic information about run-time functions; therefore, they are
  6004. executed as a single step.) You can alternate between Trace and Step as you
  6005. like. The method you use depends on whether you want to see what happens
  6006. within a particular function.%@CR:C6A00070084 @%%@NL@%
  6007.  
  6008. You can trace through the program continuously, without having to press F8,
  6009. by choosing the Animate command from the Run menu. The speed of execution is
  6010. controlled by the Trace Speed command from the Options menu. You can halt
  6011. animated execution at any time by pressing any key.%@CR:C6A00070085 @%%@CR:C6A00070086 @%%@NL@%
  6012.  
  6013. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6014. NOTE
  6015.  
  6016. %@AI@%Attempting to step or trace through Windows start-up code while viewing
  6017. %@AI@%assembly-language listing will cause unpredictable results. To step through
  6018. %@AI@%your program while viewing assembly-language instructions, first set a
  6019. %@AI@%breakpoint at the WinMain function and begin stepping through the program
  6020. %@AI@%only after the breakpoint has been reached.%@AE@%
  6021. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6022.  
  6023.  
  6024. %@3@%%@CR:C6A00070087 @%%@AB@%7.10.3  Jumping to a Particular Location%@AE@%%@EH@%%@NL@%
  6025.  
  6026. At times you may wish to force the system to jump to a particular location
  6027. in your program during execution. For example, you might want to avoid
  6028. executing code that you know has bugs, or you might want to repeatedly
  6029. execute a particularly troublesome portion of your program.  %@NL@%
  6030.  
  6031. To jump to a specific location in your application:  %@NL@%
  6032.  
  6033.  
  6034.   1.  Choose the Source command from the Options menu and select the Mix
  6035.       Source and Assembly and the Show Machine Code options.%@NL@%
  6036.  
  6037.   2.  In the Source window, view the line of source code to which you want
  6038.       to jump.%@NL@%
  6039.  
  6040.   3.  Examine the code offset of the first machine instruction for the
  6041.       assembled statement.%@NL@%
  6042.  
  6043.   4.  Use the %@AB@%rip%@AE@% (Register IP) command to change the IP register to this
  6044.       code offset, supplying the value as a hexadecimal number.%@NL@%
  6045.  
  6046.  
  6047. %@AB@%CVW%@AE@% highlights the line to which you have jumped.  %@NL@%
  6048.  
  6049. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6050. IMPORTANT
  6051.  
  6052. %@AI@%Do not jump from one procedure to another. Jumping from one procedure to
  6053. %@AI@%another disrupts the stack. %@AE@%
  6054.  
  6055. %@AI@%When jumping to a specific point in your application, remember that
  6056. %@AI@%assembled source code for a given statement may rely on memory values and
  6057. %@AI@%registers set in previous instructions that you have skipped. This is
  6058. %@AI@%particularly true if you have not disabled optimization by compiling the
  6059. %@AI@%source module using the %@AB@%-Od%@AE@%%@AI@% option.%@AE@%%@AE@%
  6060. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6061.  
  6062.  
  6063. %@3@%%@CR:C6A00070088 @%%@AB@%7.10.4  Interrupting Your Program%@AE@%%@EH@%%@NL@%
  6064.  
  6065. There may be times when you want to halt your program immediately. You can
  6066. force an immediate interrupt of a %@AB@%CVW%@AE@% session by pressing
  6067. CONTROL+ALT+SYSREQ. You then have the opportunity to change debugging
  6068. options, such as adding breakpoints and modifying variables. To resume
  6069. continuous execution, just press F5; to single-step, press F10.%@CR:C6A00070089 @%  %@NL@%
  6070.  
  6071. You should take care when you interrupt the %@AB@%CVW%@AE@% session. For example, if you
  6072. interrupted the session while Windows code or other system code was
  6073. executing, attempting to use the Step or Trace functions will produce
  6074. unpredictable results. When you interrupt the %@AB@%CVW%@AE@% session, it is usually
  6075. safest to set breakpoints in your code and then resume continuous execution,
  6076. rather than using Step or Trace.  %@NL@%
  6077.  
  6078. An infinite loop in your code presents a special problem. Again, since you
  6079. should avoid using Step or Trace after interrupting your program, you should
  6080. try to locate the loop by setting breakpoints in places you suspect are in
  6081. the loop.  %@NL@%
  6082.  
  6083. Whether or not you locate the infinite loop, you will have to terminate your
  6084. application. The %@AB@%wka%@AE@% (Windows Kill Application) command terminates the
  6085. currently executing task. Since this task is not necessarily your program,
  6086. you should use the %@AB@%wka%@AE@% command only when your application is the currently
  6087. executing task.  %@NL@%
  6088.  
  6089. If your application is the currently executing task and is executing a
  6090. module containing symbol information, the %@AB@%CVW%@AE@% Source window will highlight
  6091. the current instruction. However, if your application contains modules that
  6092. were not compiled with the %@AB@%/Zi%@AE@% option, it will be more difficult to
  6093. determine whether the assembly-language code displayed in the Source window
  6094. belongs to your application or to another task. In this case, use the %@AB@%wdg%@AE@%
  6095. (Windows Dump Global Heap) command, supplying the value in the CS register
  6096. as the parameter. %@AB@%CVW%@AE@% will display a listing that will indicate whether the
  6097. code segment belongs to your application. If it does, you can use the %@AB@%wka%@AE@%
  6098. command without affecting other tasks. However, the %@AB@%wka%@AE@% command does not
  6099. perform all the cleanup tasks associated with the normal termination of a
  6100. Windows application. For example, GDI objects created during the execution
  6101. of the program but not destroyed before you terminated the program will
  6102. remain allocated in the system-wide global heap. This will reduce the amount
  6103. of memory available during your Windows session. Because of this, you should
  6104. use the %@AB@%wka%@AE@% command to terminate the application only if you cannot
  6105. terminate it normally.  %@NL@%
  6106.  
  6107. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6108. NOTE
  6109.  
  6110. %@AI@%The %@AB@%wka%@AE@%%@AI@% command simulates a fatal error in your application. Because of
  6111. %@AI@%this, when you use the %@AE@%%@AI@%%@AB@%wka%@AE@%%@AE@%%@AI@% command, Windows displays an "Unexpected
  6112. %@AI@%Application Error" message box. %@AE@%%@AE@%
  6113.  
  6114. %@AI@%After you close this message box, Windows may not release subsequent mouse
  6115. %@AI@%input messages from the system queue until you press a key. If this happens,
  6116. %@AI@%the cursor will move on the Windows screen, but Windows will not appear to
  6117. %@AI@%respond to the mouse. After you press any key, Windows will then respond to
  6118. %@AI@%all mouse events that occurred before you pressed the key. %@AE@%
  6119. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6120.  
  6121.  
  6122. %@2@%%@CR:C6A00070090 @%%@AB@%7.11  Handling Abnormal Termination of the Application%@AE@%%@EH@%%@NL@%
  6123.  
  6124. Your application can terminate abnormally in one of two ways while you are
  6125. debugging it with %@AB@%CVW%@AE@%. It can cause a fatal exit, or it can cause a GP
  6126. fault. In both cases, %@AB@%CVW%@AE@% regains control, giving you the opportunity to
  6127. examine the state of the system when your application terminated. In
  6128. particular, you can often determine the location in your application's code
  6129. where the error occurred, or which call caused the error. %@AB@%CVW%@AE@% allows you to
  6130. view registers, dump the global heap, display memory, and examine the source
  6131. code.  %@NL@%
  6132.  
  6133. Once you have determined where the error occurred, use the %@AB@%q%@AE@% command to
  6134. terminate %@AB@%CVW%@AE@%. In most cases, control will return to Windows.  %@NL@%
  6135.  
  6136.  
  6137. %@3@%%@CR:C6A00070091 @%%@AB@%7.11.1  Handling a Fatal Exit%@AE@%%@EH@%%@NL@%
  6138.  
  6139. If the abnormal termination was a fatal exit, and the application was
  6140. running with the retail version of Windows, the %@AB@%CVW%@AE@% Command window displays
  6141. the following:  %@NL@%
  6142.  
  6143. %@AS@%  Trap 13 (0DH) -- General Protection Fault.%@AE@%
  6144.  
  6145. The CS:IP register contains an address in the Windows code itself. This
  6146. small amount of information provides little to help you locate the last call
  6147. that your application made before the error was detected.  %@NL@%
  6148.  
  6149. If, however, your application was running with the debugging version of
  6150. Windows, the %@AB@%CVW%@AE@% Command window displays a stack trace that is much more
  6151. useful for finding the error in your source code.  %@NL@%
  6152.  
  6153. After the stack trace appears in the %@AB@%CVW%@AE@% Command window, Windows displays
  6154. this prompt:  %@NL@%
  6155.  
  6156. %@AS@%  Abort, Break, or Ignore?%@AE@%
  6157.  
  6158. To locate the cause of the error, press B. This allows %@AB@%CVW%@AE@% to regain control
  6159. from Windows.  %@NL@%
  6160.  
  6161. In most cases, the stack trace will have scrolled off the top of the %@AB@%CVW%@AE@%
  6162. Command window, but once %@AB@%CVW%@AE@% regains control, you can scroll it back to
  6163. examine the entire stack trace. The following information appears at the top
  6164. of the stack trace:  %@NL@%
  6165.  
  6166.  
  6167.   ■   A fatal exit number. See the %@AI@%Reference, Volume 2%@AE@%, for a listing of the
  6168.       possible fatal exit numbers.%@NL@%
  6169.  
  6170.   ■   The CS:IP address or the name of the Windows function where the error
  6171.       was detected, or the name of the last Windows function called before
  6172.       the error was detected. %@NL@%
  6173.  
  6174.  
  6175. Following this information, additional Windows functions might be listed in
  6176. the stack trace. Somewhere near the top of the stack trace a CS:IP address
  6177. will be listed without a Windows function name. In most cases, this is the
  6178. location in the source code of your application where the call to a Windows
  6179. function occurred that triggered the fatal exit.  %@NL@%
  6180.  
  6181. To examine this location in your source code, open a Source window if
  6182. necessary and use the %@AB@%v%@AE@% command followed by the CS:IP address, being sure to
  6183. precede both the segment and the offset with the "0x" hexadecimal prefix.
  6184. For example, if %@AB@%CVW%@AE@% indicates that the error occurred at 07DA:0543 in your
  6185. application, enter the following command:  %@NL@%
  6186.  
  6187. %@AS@%  v 0x07DA:0x0543%@AE@%
  6188.  
  6189. If you had compiled the module where the error occurred using the C Compiler
  6190. %@AB@% -Zi%@AE@% option, the %@AB@%CVW%@AE@% Source window displays the location in your code where
  6191. the errant call to a Windows function occurred.  %@NL@%
  6192.  
  6193. The first CS:IP address without a name in the stack trace may point to a
  6194. location in your code without symbols. For example, the code might be in a
  6195. DLL you didn't specify with the %@AB@%/L%@AE@% command-line option or at the %@AB@%CVW%@AE@% prompt.
  6196. Or the address might be in a module that you did not compile with the %@AB@%-Zi%@AE@%
  6197. option. In such cases, %@AB@%CVW%@AE@% reports that no source code is available. If this
  6198. happens, continue down the stack trace, using the %@AB@%v%@AE@% command with each
  6199. unnamed CS:IP address. You likely will find a location in a module that was
  6200. compiled with the %@AB@%-Zi%@AE@% option, and this location might have made a call into
  6201. one of your modules which you did not compile using the %@AB@%-Zi%@AE@% option.  %@NL@%
  6202.  
  6203. Section 7.16, "A Sample Session in CVW," shows a sample fatal-exit stack
  6204. trace and how to use that information to locate an error.  %@NL@%
  6205.  
  6206.  
  6207. %@3@%%@CR:C6A00070092 @%%@AB@%7.11.2  Handling a GP Fault%@AE@%%@EH@%%@NL@%
  6208.  
  6209. When a GP fault occurs, %@AB@%CVW%@AE@% displays a message in the Command window to
  6210. notify you of the event. If the GP fault occurred at an instruction in one
  6211. of your modules, %@AB@%CVW%@AE@% displays the corresponding source code if it had been
  6212. compiled using the %@AB@%-Zi%@AE@% option. You can obtain information about the chain of
  6213. calls leading up to the GP fault using the %@AB@%CVW%@AE@% Call menu. This displays a
  6214. backtrace of calls in the form of a series of segments and offsets, starting
  6215. at the most recent call.  %@NL@%
  6216.  
  6217. If your application was running with the debugging version of Windows, the
  6218. backtrace will show window function names next to some of the segment/offset
  6219. pairs. By examining the window function names, you might be able to
  6220. determine where in your code the error occurred.  %@NL@%
  6221.  
  6222.  
  6223. %@2@%%@CR:C6A00070093 @%%@AB@%7.12  Ending a CVW Session%@AE@%%@EH@%%@NL@%
  6224.  
  6225. To terminate a %@AB@%CVW%@AE@% session, use the Exit command in the File menu, or type
  6226. the %@AB@%q%@AE@% (Quit) command in the Command window.%@CR:C6A00070094 @%%@NL@%
  6227.  
  6228.  
  6229. %@2@%%@CR:C6A00070095 @%%@AB@%7.13  Restarting a %@AB@%CVW%@AE@% Debugging Session%@AE@%%@EH@%%@NL@%
  6230.  
  6231. You can terminate your application without terminating %@AB@%CVW.%@AE@% While Windows is
  6232. terminating the application, it will notify %@AB@%CVW%@AE@%, and %@AB@%CVW%@AE@% will display the
  6233. following message:  %@NL@%
  6234.  
  6235. %@AS@%  Program terminated normally (0)%@AE@%
  6236.  
  6237. The value in parentheses is the return value of the WinMain function. This
  6238. value is usually the %@AI@%wParam%@AE@% parameter of the WM_QUIT message, which in turn
  6239. is the value of the %@AI@%nExitCode%@AE@% parameter passed to the %@AB@%PostQuitMessage%@AE@%
  6240. function.  %@NL@%
  6241.  
  6242. If you were debugging more than one application or DLL, you can then use the
  6243. %@AB@%go%@AE@% command to continue the debugging session. You can also restart the
  6244. application you just terminated by using the %@AB@%go%@AE@% command and then restarting
  6245. your application through Windows File Manager or Program Manager.%@CR:C6A00070096 @%%@NL@%
  6246.  
  6247.  
  6248. %@2@%%@CR:C6A00070097 @%%@AB@%7.14  Advanced %@AB@%CVW%@AE@% Techniques%@AE@%%@EH@%%@NL@%
  6249.  
  6250. Once you are comfortable displaying and changing variables, and controlling
  6251. the program's execution, you might want to experiment with the following
  6252. advanced techniques:  %@NL@%
  6253.  
  6254.  
  6255.   ■   Using multiple Source windows%@NL@%
  6256.  
  6257.   ■   Calling functions%@NL@%
  6258.  
  6259.   ■   Checking for undefined pointers%@NL@%
  6260.  
  6261.   ■   Handling register variables%@NL@%
  6262.  
  6263.   ■   Redirecting CodeView input and output
  6264. %@NL@%
  6265.  
  6266.  
  6267.  
  6268. %@3@%%@CR:C6A00070098 @%%@AB@%7.14.1  Using Multiple Source Windows%@AE@%%@EH@%%@NL@%
  6269.  
  6270. You can have two Source windows open at the same time. The windows can
  6271. display two different sections of source code for the same program. They can
  6272. both track CS:IP addresses; or, one can display a high-level listing and one
  6273. can display an assembly-language listing. You can move freely between the
  6274. Source windows, executing a single line of source code or a single assembly
  6275. instruction at a time.%@CR:C6A00070099 @%%@NL@%
  6276.  
  6277.  
  6278. %@3@%%@CR:C6A00070100 @%%@AB@%7.14.2  Calling Functions%@AE@%%@EH@%%@NL@%
  6279.  
  6280. You can call any C function in your program from the Command window or the
  6281. Watch window. The format for calling C functions is:  %@NL@%
  6282.  
  6283. %@AI@%?funcname (varlist)%@AE@%  %@NL@%
  6284.  
  6285. %@AB@%CVW%@AE@% evaluates the function and displays its returned value in the Command
  6286. window.  %@NL@%
  6287.  
  6288. The function does not have to be one that is called by your program. You can
  6289. evaluate any function that is included in the .OBJ parameters specified on
  6290. the %@AB@%LINK%@AE@% command line.%@CR:C6A00070101 @%%@NL@%
  6291.  
  6292. This feature allows you to run functions from within %@AB@%CVW%@AE@% that you would not
  6293. normally include in the final version of your program. For example, you
  6294. could call a function that checks the integrity of the data structure.  %@NL@%
  6295.  
  6296. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6297. NOTE
  6298.  
  6299. %@AI@%Directly calling a Windows application procedure or dialog function might
  6300. %@AI@%have unpredictable results.%@AE@%
  6301. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6302.  
  6303.  
  6304. %@3@%%@CR:C6A00070102 @%%@AB@%7.14.3  Checking for Undefined Pointers%@AE@%%@EH@%%@NL@%
  6305.  
  6306. Until a pointer has been explicitly assigned a value, its value is
  6307. undefined. Its value can be completely random, or it can be some consistent
  6308. value that does not point to a useful data address (such as -1).  %@NL@%
  6309.  
  6310. Accessing a value through an uninitialized pointer address can cause
  6311. inexplicable or erratic program behavior, because the data is not being read
  6312. from or written to the intended location. For example, suppose that var1 is
  6313. mistakenly written to the address specified by an uninitialized pointer,
  6314. then var2 is also written there. When var1 is read back it does not have its
  6315. original value, having been overwritten by var2.  %@NL@%
  6316.  
  6317. At present, all Microsoft C static or global near pointers have an
  6318. uninitialized value of 0. That is, they point to the base address of the
  6319. data segment. (There is no guarantee, however, that future versions of the
  6320. Microsoft C Compiler will be the same; C language specifications do not
  6321. define the value of an uninitialized pointer.)  %@NL@%
  6322.  
  6323. You can take advantage of this consistency. If you specify DS:0 as a
  6324. breakpoint expression, %@AB@%CVW%@AE@% automatically halts execution if your program
  6325. attempts to write a nonzero value to a null pointer address. This is an easy
  6326. way to see whether or not you have initialized all of your pointers.%@CR:C6A00070103 @%%@NL@%
  6327.  
  6328.  
  6329. %@3@%%@CR:C6A00070104 @%%@AB@%7.14.4  Handling Register Variables%@AE@%%@EH@%%@NL@%
  6330.  
  6331. A register variable is stored in one of the microprocessor's registers,
  6332. rather than in RAM. This speeds up access to the variable.  %@NL@%
  6333.  
  6334. There are two ways for a conventional variable to become a register
  6335. variable. One way is declaring the variable as a register variable. If a
  6336. register is free, the compiler will store the variable there. The other way
  6337. occurs during optimization, when the compiler stores an often-used variable
  6338. (such as a loop variable) in a register to speed up execution.%@CR:C6A00070105 @%%@NL@%
  6339.  
  6340. Register variables can cause problems when debugging. As with local
  6341. variables, they are only visible within the function where they are defined.
  6342. In addition, a register variable might not always be displayed with its
  6343. current value.  %@NL@%
  6344.  
  6345. In general, it is a good idea to turn off all optimization (using the %@AB@%/Od%@AE@%
  6346. option when compiling) and to avoid declaring register variables until the
  6347. program has been fully debugged. Any side effects produced by optimization
  6348. or register variables can then be easily isolated.  %@NL@%
  6349.  
  6350.  
  6351. %@3@%%@CR:C6A00070106 @%%@AB@%7.14.5  Redirecting %@AB@%CVW%@AE@% Input and Output%@AE@%%@EH@%%@NL@%
  6352.  
  6353. You can cause %@AB@%CVW%@AE@% to receive input from an input file and generate output to
  6354. an output file. To redirect %@AB@%CVW%@AE@% input and output, use the %@AB@%CVW%@AE@% start-up
  6355. command with the %@AB@%/C%@AE@% option as follows:%@CR:C6A00070107 @%%@NL@%
  6356.  
  6357. %@AS@%  CVW /c "<infile; t >outfile" myprog%@AE@%
  6358.  
  6359. When you redirect input, %@AB@%CVW%@AE@% will execute any commands in %@AI@%infile%@AE@% during
  6360. start-up. When %@AB@%CVW%@AE@% exhausts all commands in the input file, focus
  6361. automatically shifts to the Command window.  %@NL@%
  6362.  
  6363. When you redirect output, it is both sent to %@AI@%outfile%@AE@% and echoed to the
  6364. Command window. The %@AB@%t%@AE@% parameter must precede the %@AB@%>%@AE@% in the command to send
  6365. output to the Command window.  %@NL@%
  6366.  
  6367. Redirection is a useful way to automate %@AB@%CVW%@AE@% start-up. It also lets you keep
  6368. a viewable record of command-line input and output, but no record of mouse
  6369. operations. Some applications (particularly interactive ones) may need
  6370. modification to allow for redirection of input to the application itself.  %@NL@%
  6371.  
  6372.  
  6373. %@2@%%@CR:C6A00070108 @%%@AB@%7.15  Customizing CVW with the TOOLS.INI File%@AE@%%@EH@%%@NL@%
  6374.  
  6375. The TOOLS.INI file customizes the behavior and user interface of several
  6376. Microsoft products. The TOOLS.INI file is a plain ASCII text file. You
  6377. should place it in a directory pointed to the INIT environment variable. (If
  6378. you do not use the INIT environment variable, CodeView for Windows only
  6379. looks for TOOLS.INI in its source directory.)%@CR:C6A00070109 @%%@NL@%
  6380.  
  6381. The CodeView for Windows section of TOOLS.INI is preceded by the following
  6382. line:  %@NL@%
  6383.  
  6384. %@AS@%  [cvw]%@AE@%
  6385.  
  6386. Most of the TOOLS.INI customizations control screen colors, but you can also
  6387. specify start-up commands or the name of the file that receives CodeView for
  6388. Windows output. The Help system contains full information about all of the
  6389. TOOLS.INI switches for %@AB@%CVW%@AE@%.  %@NL@%
  6390.  
  6391.  
  6392. %@2@%%@CR:C6A00070110 @%%@AB@%7.16  A Sample Session in %@AB@%CVW%@AE@%%@AE@%%@EH@%%@NL@%
  6393.  
  6394. The following sample session demonstrates how to use the %@AB@%CVW%@AE@% debugger to
  6395. examine a Windows application. The session will use the SDK sample
  6396. application called Output, which writes text and draws three shapes─a
  6397. rectangle, an ellipse, and a dashed semicircle─on the screen.  %@NL@%
  6398.  
  6399. Before you begin the %@AB@%CVW%@AE@% session, you must prepare the Output application
  6400. for debugging. Compile and link the Output make file after you make the
  6401. following changes to the %@AB@%CL%@AE@% and %@AB@%LINK%@AE@% commands:  %@NL@%
  6402.  
  6403.  
  6404.   1.  Add the %@AB@%-Zi%@AE@% option to %@AB@%CL%@AE@% command by changing %@AB@%-Zpe%@AE@% to %@AB@%-Zpei%@AE@%, and add
  6405.       the %@AB@%-Od%@AE@% option:
  6406.  
  6407. %@AS@%      CL -c -Gsw -Oas -Zpei -Od OUTPUT.C%@AE@%
  6408. %@NL@%
  6409.  
  6410.   2.  Add the %@AB@%-Co%@AE@% option to the %@AB@%LINK%@AE@% command:
  6411.  
  6412. %@AS@%      LINK OUTPUT,,,/NOD /CO SLIBCEW LIBW, OUTPUT.DEF%@AE@%
  6413. %@NL@%
  6414.  
  6415.  
  6416. After you compile with these options, start Windows and then start a %@AB@%CVW%@AE@%
  6417. session for Output. See Section 7.4, "Starting a Debugging Session," for
  6418. more information about starting %@AB@%CVW%@AE@%. To start the %@AB@%CVW%@AE@% session:  %@NL@%
  6419.  
  6420.  
  6421.   1.  Choose Run from the File menu in Windows and type the following
  6422.       command in the Run dialog box:
  6423.  
  6424. %@AS@%      CVW%@AE@%
  6425. %@NL@%
  6426.  
  6427. %@STUB@%      The debugging monitor displays the %@AB@%CVW%@AE@% Start-up dialog box.%@NL@%
  6428.  
  6429.   2.  Type the application name in the %@AB@%CVW%@AE@% Start-up dialog box:
  6430.  
  6431. %@AS@%      OUTPUT%@AE@%
  6432. %@NL@%
  6433.  
  6434. %@STUB@%      Your debugging monitor displays the DLL dialog box.%@NL@%
  6435.  
  6436.   3.  In this session, you will not be debugging additional DLLs, so leave
  6437.       the command line blank and press ENTER.%@NL@%
  6438.  
  6439.  
  6440. The %@AB@%CVW%@AE@% menu, the Source window, the Command window, and the Local window
  6441. appear on the debugging monitor. The Source window displays the source code
  6442. for Output. Notice its title:  %@NL@%
  6443.  
  6444. %@AS@%  source1 CS:IP output.c (ACTIVE)%@AE@%
  6445.  
  6446. The title indicates that the Source window is the active, or selected,
  6447. window.  %@NL@%
  6448.  
  6449. Before you start executing the application, set a breakpoint in your source
  6450. code. For example, you could halt Output after it displays text on the
  6451. user's screen, but before it draws the rectangle. You know that Output will
  6452. draw the rectangle in response to a Windows WM_PAINT message, so use the
  6453. Find command to scan the source code for WM_PAINT. To search for this
  6454. message:  %@NL@%
  6455.  
  6456.  
  6457.   1.  Choose the Find option from the %@AB@%CVW%@AE@% Search menu.%@NL@%
  6458.  
  6459. %@STUB@%      %@AB@%CVW%@AE@% displays the Find dialog box. %@NL@%
  6460.  
  6461.   2.  Type the following on the command line:
  6462.  
  6463. %@AS@%      WM_PAINT%@AE@%
  6464. %@NL@%
  6465.  
  6466. %@STUB@%      Select the Match Upper/Lower Case checkbox; press ENTER. %@NL@%
  6467.  
  6468. %@STUB@%      %@AB@%CVW%@AE@% finds the first occurrence of "WM_PAINT" in a comment. This is not
  6469.       the location you want. To continue the search:%@NL@%
  6470.  
  6471.   3.  Choose the Repeat Last Find option from the Search menu. %@NL@%
  6472.  
  6473. %@STUB@%      This time the Source window displays the %@AB@%case%@AE@% WM_PAINT: statement.
  6474.       This is the location you were looking for.%@NL@%
  6475.  
  6476.  
  6477. Within this %@AB@%case%@AE@% statement, find the %@AB@%Rectangle%@AE@% function. Scroll downward
  6478. through the Source window until you see the following code:  %@NL@%
  6479.  
  6480. %@AS@%  Rectangle (
  6481. %@AS@%                hDC
  6482. %@AS@%               ,nDrawX
  6483. %@AS@%               ,nDrawY
  6484. %@AS@%               ,nDraw + 50
  6485. %@AS@%               ,nDraw + 30
  6486. %@AS@%              );%@AE@%
  6487.  
  6488. Notice that the statement is spread over several lines. To set a breakpoint
  6489. on a multiline statement, you must position the cursor on the last line of
  6490. the statement. If you try to set a breakpoint on any other line, %@AB@%CVW%@AE@% will
  6491. not accept it. To set a breakpoint on this statement:  %@NL@%
  6492.  
  6493.  
  6494.   1.  Click the ");" characters─the last line of the statement. %@NL@%
  6495.  
  6496. %@STUB@%      The blinking cursor is now on this line. %@NL@%
  6497.  
  6498.   2.  Choose the Set Breakpoint command on the Options menu, or press F9.%@NL@%
  6499.  
  6500.  
  6501. %@AB@%CVW%@AE@% displays the line in bold characters to indicate that it is a
  6502. breakpoint. Also, the Command window displays the following message:  %@NL@%
  6503.  
  6504. %@AS@%  Break at: output.c!.297%@AE@%
  6505.  
  6506. You have two ways to display a list of the breakpoints:  %@NL@%
  6507.  
  6508.  
  6509.   ■   You can use the %@AB@%bl%@AE@% command. In the Command window, type:
  6510.  
  6511. %@AS@%      bl%@AE@%
  6512. %@NL@%
  6513.  
  6514. %@STUB@%      The Command window will display a list of the breakpoint messages. %@NL@%
  6515.  
  6516.   ■   You can use the Edit Breakpoints command on the Watch menu. The
  6517.       Breakpoint dialog box will display a list of breakpoint messages.%@NL@%
  6518.  
  6519.  
  6520. The message for the breakpoint you just set is:  %@NL@%
  6521.  
  6522. %@AS@%  0) E output.c!.297%@AE@%
  6523.  
  6524. The following table uses this message to illustrate the format for %@AB@%CVW%@AE@%
  6525. breakpoint messages:  %@NL@%
  6526.  
  6527. %@AB@%Message Content%@AE@%                   %@AB@%What it Means%@AE@%
  6528. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6529. 0)                                Indicates the sequence number of the 
  6530.                                   breakpoint in the Source Code. This is 
  6531.                                   the first breakpoint.
  6532.  
  6533. E                                 Indicates that the breakpoint is 
  6534.                                   Enabled.
  6535.  
  6536. output.c!.297                     Indicates that the breakpoint is set on 
  6537.                                   line number 297 of the OUTPUT.C source 
  6538.                                   code file.
  6539.  
  6540. When you are ready to execute the Output application, click in the Command
  6541. window and type the %@AB@%go%@AE@% command at the prompt:  %@NL@%
  6542.  
  6543. %@AS@%  g%@AE@%
  6544.  
  6545. The Output application will start running and displaying the text on the
  6546. user's screen (the Windows monitor). While the application is running,
  6547. Windows has control of the session. When the application reaches the
  6548. breakpoint line, %@AB@%CVW%@AE@% takes control and halts the application before the line
  6549. is executed. Notice that the %@AB@%CVW%@AE@% Source window displays the breakpoint line
  6550. in reverse video to indicate where the application has stopped.  %@NL@%
  6551.  
  6552. At this point, %@AB@%CVW%@AE@% has control of the session. You can use the %@AB@%CVW%@AE@% menus and
  6553. commands to display values, edit breakpoints, or otherwise modify your
  6554. debugging session.  %@NL@%
  6555.  
  6556. Instead of resuming continuous execution, single-step through the
  6557. application as it draws the rectangle on the Windows screen. To execute a
  6558. single statement, press F10. The Output application draws a rectangle on the
  6559. screen and then stops. The %@AB@%CVW%@AE@% Source window displays the next statement of
  6560. code in reverse video:  %@NL@%
  6561.  
  6562. %@AS@%  SelectObject(hDC, hGreenBrush);%@AE@%
  6563.  
  6564. Single-step through the next several statements by pressing F10. As you
  6565. single-step, the Output application draws each shape on the Windows screen
  6566. and then Windows passes control of the session back to %@AB@%CVW%@AE@%. You can resume
  6567. continuous execution at any time by pressing F5.  %@NL@%
  6568.  
  6569. When the application is finished executing, it passes control back to %@AB@%CVW%@AE@%.
  6570. To terminate %@AB@%CVW%@AE@%, select the Quit option from the File menu.  %@NL@%
  6571.  
  6572. If the application is running and you want to interrupt it and terminate
  6573. execution:  %@NL@%
  6574.  
  6575.  
  6576.   1.  Press CONTROL+ALT+SYSREQ. %@NL@%
  6577.  
  6578.   2.  Select the Quit command from the File menu in %@AB@%CVW%@AE@%.%@NL@%
  6579.  
  6580.  
  6581. You will be returned to Windows. Your application will continue to run.  %@NL@%
  6582.  
  6583. To see how %@AB@%CVW%@AE@% handles a fatal exit, you will need to introduce a severe
  6584. error into the code of Output. Replace the %@AI@%hDC%@AE@% parameter of the %@AB@%DrawText%@AE@%
  6585. function in the WM_PAINT case statement of MainWndProc with (HDC)0.
  6586. Recompile the application and run %@AB@%CVW%@AE@% to debug the application.  %@NL@%
  6587.  
  6588. When the debugging version of Windows reaches the call to %@AB@%DrawText%@AE@%, it
  6589. detects an invalid display-context handle and displays in the %@AB@%CVW%@AE@% Command
  6590. window a stack trace similar to the following:  %@NL@%
  6591.  
  6592. %@AS@%  FatalExit code = 0x0000
  6593. %@AS@%  Stack trace:
  6594. %@AS@%  GDI!_TEXT:VALIDATEHANDLE+0046
  6595. %@AS@%  GDI!_TEXT:GSV+0018
  6596. %@AS@%  USER!_WMG:DRAWTEXT+000D
  6597. %@AS@%  0A35:03E9
  6598. %@AS@%  USER!_FFFE:INTRNALUPDATEWINDOW+0033
  6599. %@AS@%  USER!_FFFE:UPDATEWINDOW+0019
  6600. %@AS@%  0A35:011E
  6601. %@AS@%  0A35:0031
  6602. %@AS@%  0A35:0629
  6603. %@AS@%  
  6604. %@AS@%  Abort, Break, or Ignore?%@AE@%
  6605.  
  6606. The fatal exit code value 0x0000 indicates that an invalid handle was passed
  6607. to a GDI function. See the %@AI@%Reference, Volume 2%@AE@% for a complete list of fatal
  6608. exit codes.  %@NL@%
  6609.  
  6610. To locate the cause of the error in your source code, respond to the prompt
  6611. by pressing B. %@AB@%CVW%@AE@% will then display:  %@NL@%
  6612.  
  6613. %@AS@%  Break caused by INT3 in code%@AE@%
  6614.  
  6615. Find the first CS:IP address without a label. In this case, it is 0A35:03E9.
  6616. Use the %@AB@%v%@AE@% command with this address, remembering to add the 0x hexadecimal
  6617. prefix, as shown:  %@NL@%
  6618.  
  6619. %@AS@%  v 0x0A35:0x03E9%@AE@%
  6620.  
  6621. %@AB@%CVW%@AE@% will display source code similar to the following:  %@NL@%
  6622.  
  6623. %@AS@%  DrawText (
  6624. %@AS@%   (HDC)0
  6625. %@AS@%     , szText
  6626. %@AS@%     , strlen(szText)
  6627. %@AS@%     , &rcTextBox
  6628. %@AS@%    , DT_CENTER |DT_EXTERNALLEADING | DT_NOCLIP
  6629. %@AS@%                   | DT_NOPREFIX | DT_WORDBREAK
  6630. %@AS@%  );%@AE@%
  6631.  
  6632. This is the function call that you changed to cause the fatal exit.  %@NL@%
  6633.  
  6634.  
  6635. %@2@%%@CR:C6A00070111 @%%@AB@%7.17  Summary%@AE@%%@EH@%%@NL@%
  6636.  
  6637. CodeView for Windows is a tool that lets you debug Windows applications in
  6638. protected mode. With %@AB@%CVW%@AE@% running on your secondary monitor, you can view and
  6639. modify program data, and control execution, as you run your Windows
  6640. application.  %@NL@%
  6641.  
  6642. For information related to CodeView for Windows, see the following:  %@NL@%
  6643.  
  6644. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  6645. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6646. Programming Windows applications  %@AI@%Guide to Programming%@AE@%
  6647.  
  6648. System requirements               %@AI@%Installation and Update Guide%@AE@%
  6649.  
  6650. Fatal exit codes                  %@AI@%Reference, Volume 2%@AE@%: Appendix C, 
  6651.                                   "Windows
  6652.                                   Debugging Messages"
  6653.  
  6654. %@AB@%CVW%@AE@% commands                      CVW on-line Help
  6655.  
  6656.  
  6657.  
  6658.  
  6659.  
  6660.  
  6661. %@CR:C6A00080001 @%%@1@%%@AB@%Chapter 8  Debugging in Real Mode: Symbolic Debugger%@AE@%%@EH@%%@NL@%
  6662. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6663.  
  6664. Microsoft Windows Symbolic Debugger (%@AB@%SYMDEB%@AE@%) is a debugging program that
  6665. helps you test executable files for applications that run in real mode. To
  6666. debug applications that run in protected mode, use the Microsoft CodeView
  6667. for Windows (%@AB@%CVW%@AE@%) debugger. %@AB@% %@AE@%For information on%@AB@% CVW%@AE@%, see Chapter 7,%@AB@% %@AE@%
  6668. "Debugging in Protected Mode: CodeView for Windows."%@AB@% %@AE@%%@CR:C6A00080002 @%%@AB@% %@AE@%%@CR:C6A00080003 @%%@NL@%
  6669.  
  6670. %@AB@%SYMDEB%@AE@% lets you refer to data and instructions by name rather than by
  6671. address. The Symbolic Debugger can access program locations through
  6672. addresses, global symbols, or line-number references, making it easy to
  6673. locate and debug specific sections of code. You can debug C programs at the
  6674. source-file level as well as at the machine level. You can display the
  6675. source statements of a program, the disassembled machine code of the
  6676. program, or a combination of source statements and disassembled machine
  6677. code.  %@NL@%
  6678.  
  6679. Using %@AB@%SYMDEB%@AE@%, you can display and execute program code, set breakpoints that
  6680. stop the execution of your program, examine and change values in memory, and
  6681. debug programs that use the floating-point emulation conventions used by
  6682. Microsoft languages.%@CR:C6A00080004 @%%@NL@%
  6683.  
  6684. This chapter describes the following topics:  %@NL@%
  6685.  
  6686.  
  6687.   ■   Preparing symbol files for an application%@NL@%
  6688.  
  6689.   ■   Setting up the debugging terminal%@NL@%
  6690.  
  6691.   ■   Starting %@AB@%SYMDEB%@AE@% with Windows%@NL@%
  6692.  
  6693.   ■   Working with symbol maps%@NL@%
  6694.  
  6695.   ■   Interpreting %@AB@%SYMDEB%@AE@%'s allocation messages%@NL@%
  6696.  
  6697.   ■   Setting breakpoints and interpreting backtraces%@NL@%
  6698.  
  6699.   ■   Displaying the application's code and viewing its source file%@NL@%
  6700.  
  6701.  
  6702. The chapter also provides the syntax and description of each %@AB@%SYMDEB%@AE@% command.
  6703. %@NL@%
  6704.  
  6705. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6706. NOTE
  6707.  
  6708. %@AI@%To use the Symbolic Debugger, you must have an extra monochrome card or a
  6709. %@AI@%serial terminal, or both.%@AE@%
  6710.  
  6711. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6712.  
  6713.  
  6714. %@2@%%@CR:C6A00080005 @%%@AB@%8.1  Preparing Symbol Files%@AE@%%@EH@%%@NL@%
  6715.  
  6716. Windows applications are difficult to debug without symbolic information
  6717. about Windows and the application. To take advantage of the Symbolic
  6718. Debugger's symbolic features, first prepare a symbol file that %@AB@%SYMDEB%@AE@% can
  6719. use.%@CR:C6A00080006 @%%@CR:C6A00080007 @%%@CR:C6A00080008 @%%@NL@%
  6720.  
  6721. The steps for setting up a symbol file depend on the method used to create
  6722. the program. The following sections describe those steps for applications
  6723. written in C or assembly language.  %@NL@%
  6724.  
  6725.  
  6726. %@3@%%@CR:C6A00080009 @%%@AB@%8.1.1  MAPSYM Program%@AE@%%@EH@%%@NL@%
  6727.  
  6728. The %@AB@%MAPSYM%@AE@% program creates symbol files for symbolic debugging. The program
  6729. converts the contents of an application's symbol map (.MAP) file into a form
  6730. suitable for loading with %@AB@%SYMDEB%@AE@%, copying the result to a symbol (.SYM)
  6731. file.%@CR:C6A00080010 @%%@CR:C6A00080011 @%%@CR:C6A00080012 @%%@CR:C6A00080013 @%%@NL@%
  6732.  
  6733.  
  6734. %@4@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  6735.  
  6736. %@AS@%  mapsym «{/ | -}l» «{/ | -}n» mapfilename%@AE@%
  6737.  
  6738. %@AB@%Parameter%@AE@%                         %@AB@%Description%@AE@%
  6739. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6740. %@AI@%mapfilename%@AE@%                       Specifies the filename for a symbol map 
  6741.                                   file that was created during linking. If
  6742.                                   you do not give a filename extension, 
  6743.                                   .MAP is assumed. If you do not give a 
  6744.                                   full pathname, the current directory and
  6745.                                   drive are assumed. The %@AB@%MAPSYM%@AE@% program 
  6746.                                   creates a new symbol file having the 
  6747.                                   same name as the map file but with the 
  6748.                                   .SYM extension.%@CR:C6A00080014 @%
  6749.  
  6750. %@AB@%/l%@AE@%                                Directs %@AB@%MAPSYM%@AE@% to display information 
  6751.                                   about the conversion on the screen. The 
  6752.                                   information includes the names of groups
  6753.                                   defined in the program, the program 
  6754.                                   start address, the number of segments, 
  6755.                                   and the number of symbols per segment. 
  6756.  
  6757. %@AB@%/n%@AE@%                                Directs %@AB@%MAPSYM%@AE@% to ignore line-number 
  6758.                                   information in the map file. The 
  6759.                                   resulting symbol file contains no 
  6760.                                   line-number information. 
  6761.  
  6762. In the following example, %@AB@%MAPSYM%@AE@% uses the symbol information in FILE.MAP to
  6763. create FILE.SYM on the current drive and directory:  %@NL@%
  6764.  
  6765. %@AS@%  mapsym /l file.map%@AE@%
  6766.  
  6767. Information about the conversion is sent to the screen.  %@NL@%
  6768.  
  6769. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6770. NOTE
  6771.  
  6772. %@AI@%The %@AB@%MAPSYM%@AE@%%@AI@% program always places the new symbol file in the current drive
  6773. %@AI@%and directory.%@AE@%%@AE@%
  6774.  
  6775. %@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
  6776. %@AI@%linking. To add line-number information to the map file, specify the
  6777. %@AI@%appropriate option when compiling, and specify the %@AE@%%@AI@%%@AB@%/linenumbers%@AE@%%@AE@%%@AI@% option when
  6778. %@AI@%linking.%@AE@%%@AE@%
  6779.  
  6780. %@AI@%The %@AB@%MAPSYM%@AE@%%@AI@% program can process up to 10,000 symbols for each segment in the
  6781. %@AI@%application, and up to 1024 segments.%@AE@%%@AE@%
  6782. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6783.  
  6784.  
  6785. %@3@%%@CR:C6A00080015 @%%@AB@%8.1.2  The Incremental Linker%@AE@%%@EH@%%@NL@%
  6786.  
  6787. Microsoft C version 6.0 includes , the incremental linker (%@AB@%ILINK%@AE@%). %@AB@%ILINK%@AE@%
  6788. directly creates .SYM files for use by the Symbolic Debugger (%@AB@%SYMDEB%@AE@%). If
  6789. you use %@AB@%ILINK%@AE@% to link your files and create .SYM files, you do not have to
  6790. use %@AB@%MAPSYM%@AE@%.  %@NL@%
  6791.  
  6792. For more information on %@AB@%ILINK%@AE@%, see the Microsoft C Optimizing Compiler
  6793. version 6.0 documentation.  %@NL@%
  6794.  
  6795.  
  6796. %@3@%%@CR:C6A00080016 @%%@AB@%8.1.3  Symbols with C-Language Applications%@AE@%%@EH@%%@NL@%
  6797.  
  6798. To prepare a symbol file for an application written in the C language,
  6799. follow these steps:%@CR:C6A00080017 @%%@CR:C6A00080018 @%%@NL@%
  6800.  
  6801.  
  6802.   1.  Compile your source file using the %@AB@%-Zd%@AE@% option to produce line numbers
  6803.       in the object file.%@NL@%
  6804.  
  6805. %@STUB@%      Debugging is easier if you disable the compiler's optimization using
  6806.       the %@AB@%-Od%@AE@% option.%@NL@%
  6807.  
  6808.   2.  Link the object file to produce an executable version of the program
  6809.       by specifying a map filename in the linker's command line and giving
  6810.       the %@AB@%/map%@AE@% and %@AB@%/linenumbers%@AE@% options.%@NL@%
  6811.  
  6812. %@STUB@%      Make sure the map filename is the same as the application's module
  6813.       name given in the module-definition file. %@NL@%
  6814.  
  6815.   3.  Use the %@AB@%MAPSYM%@AE@% program to produce a symbol file. For information about
  6816.       using %@AB@%MAPSYM%@AE@%, see Section 8.1.1, "MAPSYM Program."%@CR:C6A00080019 @%%@NL@%
  6817.  
  6818.  
  6819. The following example shows how to use symbols with C-language applications:
  6820. %@NL@%
  6821.  
  6822. %@AS@%  cl -d -c -AS -Gsw -Od -Zdp test.c
  6823. %@AS@%  link test,test,test/map/li,/NOD slibcew slibw, test
  6824. %@AS@%  mapsym test%@AE@%
  6825.  
  6826.  
  6827. %@3@%%@CR:C6A00080020 @%%@AB@%8.1.4  Symbols with Assembly-Language Applications%@AE@%%@EH@%%@NL@%
  6828.  
  6829. To prepare symbol files for Windows applications written in assembly
  6830. language, follow these steps:%@CR:C6A00080021 @%%@CR:C6A00080022 @%%@CR:C6A00080023 @%%@NL@%
  6831.  
  6832.  
  6833.   1.  Make sure that all symbols you might want to use with %@AB@%SYMDEB%@AE@% are
  6834.       declared public.%@NL@%
  6835.  
  6836. %@STUB@%      Segment and group names should not be declared public. They are
  6837.       automatically available for debugging.%@CR:C6A00080024 @%%@CR:C6A00080025 @%%@NL@%
  6838.  
  6839.   2.  Assemble your source file.%@NL@%
  6840.  
  6841.   3.  Link the object file to produce an executable version of the
  6842.       application by specifying a map filename in the linker's command line
  6843.       and giving the %@AB@%/map%@AE@% option.%@NL@%
  6844.  
  6845. %@STUB@%      Make sure the map filename is the same as the application's module
  6846.       name given in the module-definition file. %@NL@%
  6847.  
  6848.   4.  Use the %@AB@%MAPSYM%@AE@% program to create a symbol file. For information about
  6849.       using %@AB@%MAPSYM%@AE@%, see Section 8.1.1, "MAPSYM Program." %@CR:C6A00080026 @%%@NL@%
  6850.  
  6851.  
  6852. The following is an example of the syntax used when preparing symbol files,
  6853. written in assembly language, for debugging:  %@NL@%
  6854.  
  6855. %@AS@%  masm test;
  6856. %@AS@%  link test,test,test/map,slibw slibc libh,test
  6857. %@AS@%  mapsym test%@AE@%
  6858.  
  6859.  
  6860. %@2@%%@CR:C6A00080027 @%%@AB@%8.2  Setting Up the Debugging Terminal%@AE@%%@EH@%%@NL@%
  6861.  
  6862. While it is running, Windows takes complete control of the system console,
  6863. making debugging through the console impossible. To debug Windows
  6864. applications, you can either set up a remote terminal connected through the
  6865. computer's serial port, or set up a secondary monochrome display adapter and
  6866. monitor.%@CR:C6A00080028 @%%@CR:C6A00080029 @%%@NL@%
  6867.  
  6868.  
  6869. %@3@%%@CR:C6A00080030 @%%@AB@%8.2.1  Setting Up a Remote Terminal%@AE@%%@EH@%%@NL@%
  6870.  
  6871. To set up a remote terminal for debugging, follow these steps:%@CR:C6A00080031 @%%@NL@%
  6872.  
  6873.  
  6874.   1.  Select a serial port on your computer and connect a terminal to it. %@NL@%
  6875.  
  6876.   2.  Use the DOS MODE command to set the baud rate and line protocol of the
  6877.       serial port to correct values for use with the terminal.%@NL@%
  6878.  
  6879. %@STUB@%      Line protocol includes the number of stop bits, type of parity
  6880.       checking, and number of transmission bits used by the terminal.%@CR:C6A00080032 @%%@NL@%
  6881.  
  6882.   3.  When you start the Symbolic Debugger, redirect its input and output to
  6883.       the remote terminal using the %@AB@%= =%@AE@% command to specify a communication
  6884.       port.%@NL@%
  6885.  
  6886. %@STUB@%      For example, the following command redirects all subsequent %@AB@%SYMDEB%@AE@%
  6887.       command input and output to COM2:%@NL@%
  6888.  
  6889. %@AS@%      == com2 %@AE@%
  6890. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6891. NOTE
  6892.  
  6893. Debugging through a remote terminal disables the normal function of the
  6894. CONTROL+S%@AI@% key combination. Do not use this key combination while debugging
  6895. %@AI@%Windows
  6896. %@AI@%
  6897. %@AI@%
  6898. %@AI@%
  6899. %@AI@%
  6900. %@AI@%%@3@%%@CR:C6A00080035 @%%@AB@%8.2.2  Setting Up a Secondary Monitor%@AE@%%@EH@%%@NL@%
  6901.  
  6902. To set up a secondary monitor for debugging, follow these steps:%@CR:C6A00080036 @%%@CR:C6A00080037 @%%@CR:C6A00080038 @%%@CR:C6A00080039 @%%@NL@%
  6903.  
  6904.  
  6905.   1.  Install a secondary monochrome display adapter in a free slot of your
  6906.       computer and connect the monochrome monitor to it.%@NL@%
  6907.  
  6908.   2.  Set the secondary display adapter switches to the appropriate
  6909.       settings.%@NL@%
  6910.  
  6911. %@STUB@%      Follow the display adapter and computer manufacturer's
  6912.       recommendations.%@NL@%
  6913.  
  6914.   3.  When you start the Symbolic Debugger, use the %@AB@%/m%@AE@% option to redirect
  6915.       %@AB@%SYMDEB%@AE@% output to the secondary monitor. %@NL@%
  6916.  
  6917. %@STUB@%      %@AI@%NOTE  %@AE@%When the %@AB@%/m%@AE@% option is given, the Symbolic Debugger redirects
  6918.       output to the secondary monitor, but continues to use the system
  6919.       keyboard for input until the application being debugged is started.
  6920.       While the application is running, %@AB@%SYMDEB%@AE@% yields complete control of
  6921.       the keyboard to the application. As soon as the application reaches a
  6922.       breakpoint or terminates, %@AB@%SYMDEB%@AE@% reclaims the keyboard and permits
  6923.       user input again.%@CR:C6A00080040 @%%@NL@%
  6924.  
  6925.  
  6926.  
  6927. %@2@%%@CR:C6A00080041 @%%@AB@%8.3  Starting SYMDEB with Windows%@AE@%%@EH@%%@NL@%
  6928.  
  6929. To start the Symbolic Debugger with Windows, enter the following %@AB@%SYMDEB%@AE@%
  6930. command line at the DOS command prompt:%@CR:C6A00080042 @%%@NL@%
  6931.  
  6932. %@AS@%  SYMDEB «options» «symbolfiles» WIN.COM /R  «arguments»%@AE@%
  6933.  
  6934. The %@AI@%options%@AE@% parameter specifies one or more %@AB@%SYMDEB%@AE@% options. The %@AI@%symbolfiles%@AE@%
  6935. parameter specifies the names of symbol files. The %@AI@%arguments%@AE@% parameter
  6936. specifies arguments that you want to pass to WIN.COM.%@CR:C6A00080043 @%%@CR:C6A00080044 @%%@NL@%
  6937.  
  6938. If you want additional symbolic information about Windows, add the full
  6939. pathname of the debug, the nondebug, or the kernel version of the symbol
  6940. file, as in the following example:  %@NL@%
  6941.  
  6942. %@AS@%  ... ,APP.SYM\WM\DEBUG\GDI.SYM%@AE@%
  6943.  
  6944. Once started, the Symbolic Debugger displays a start-up message followed by
  6945. the %@AB@%SYMDEB%@AE@% command prompt (-). When you see the prompt you can enter %@AB@%SYMDEB%@AE@%
  6946. commands. These commands are described in Section 8.9, "SYMDEB Commands."  %@NL@%
  6947.  
  6948. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6949. NOTE 
  6950.  
  6951. %@AI@%To set breakpoints in discardable library code in a large frame EMS
  6952. %@AI@%environment, add the following entry to the [kernel] section of WIN.INI:%@AE@%
  6953. ────────────────────────────────────────────────────────────────────────────%@NL@%
  6954.  
  6955. %@AS@%  [Kernel]
  6956. %@AS@%  EnableEMSDebug=1%@AE@%
  6957.  
  6958. %@AI@%Adding the entry will slow down debugging.%@AE@%
  6959. The following section describes the elements of the %@AB@%SYMDEB%@AE@% command line.  %@NL@%
  6960.  
  6961.  
  6962. %@3@%%@CR:C6A00080045 @%%@AB@%8.3.1  Specifying SYMDEB Options%@AE@%%@EH@%%@NL@%
  6963.  
  6964. You can specify one or more %@AB@%SYMDEB%@AE@% options in the command line. These
  6965. options control the operation of the Symbolic Debugger. Options must appear
  6966. before WIN.COM on the command line so that %@AB@%SYMDEB%@AE@% will not interpret them as
  6967. program arguments.%@CR:C6A00080046 @%%@NL@%
  6968.  
  6969. The %@AB@%SYMDEB%@AE@% tool has the following command-line options:  %@NL@%
  6970.  
  6971. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@% %@CR:C6A00080047 @% %@CR:C6A00080048 @%
  6972. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  6973. %@AB@%/m%@AE@%                                Redirects %@AB@%SYMDEB%@AE@% output to a secondary 
  6974.                                   monochrome monitor and permits debugging
  6975.                                   of Windows applications without 
  6976.                                   redirecting input and output to a remote
  6977.                                   terminal. The %@AB@%SYMDEB%@AE@% utility assumes 
  6978.                                   that the necessary display adapter and 
  6979.                                   monitor are
  6980.                                   installed. %@CR:C6A00080049 @% 
  6981.  
  6982. %@AB@%/x%@AE@%                                Disables the "more" feature. Unless this
  6983.                                   option is specified, the Symbolic 
  6984.                                   Debugger automatically stops lengthy 
  6985.                                   output and does not continue the display
  6986.                                   until the user presses a key. The %@AB@%SYMDEB%@AE@%
  6987.                                   
  6988.                                   utility stops the output after 
  6989.                                   displaying enough lines to fill the 
  6990.                                   screen, then prompts the user to 
  6991.                                   continue by displaying the message 
  6992.                                   "[more]". If this option
  6993.                                   is specified, the Symbolic Debugger 
  6994.                                   continues to
  6995.                                   display output until the command is 
  6996.                                   completely
  6997.                                   executed. %@CR:C6A00080050 @% %@CR:C6A00080051 @%
  6998.  
  6999. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@%
  7000. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7001. %@AB@%/w%@AE@%%@AI@%number%@AE@%                          Sets the memory-allocation reporting 
  7002.                                   level. The reporting level defines what 
  7003.                                   kind of memory allocation and movement 
  7004.                                   messages the Symbolic Debugger will 
  7005.                                   display when Windows loads and moves 
  7006.                                   program segments. The %@AI@%number%@AE@% parameter 
  7007.                                   specifies the reporting level and can be
  7008.                                   0, 1, 2, or 3. Level 0 specifies no 
  7009.                                   reporting. Level 1, the default level if
  7010.                                   the %@AB@%/w%@AE@% option is not given, generates 
  7011.                                   allocation messages only. Level 2 
  7012.                                   generates movement messages only. Level 
  7013.                                   3 generates both allocation and movement
  7014.                                   messages. See Section 8.6, "Displaying 
  7015.                                   Allocation Messages," for more 
  7016.                                   information about allocation messages. %@CR:C6A00080052 @% 
  7017.  
  7018. %@AB@%/@%@AE@%%@AI@%filename%@AE@%                   Directs the Symbolic Debugger to load 
  7019.                                   macro definitions from the file 
  7020.                                   specified by %@AI@%filename%@AE@%. Macro definitions
  7021.                                   define the meaning of the debugger's 10 
  7022.                                   macro commands. The given file must 
  7023.                                   contain one or more macro definitions in
  7024.                                   the following form: %@CR:C6A00080053 @% %@CR:C6A00080054 @%
  7025.  
  7026.                                   %@AB@%m%@AE@%%@AI@%number%@AE@%%@AB@%=%@AE@%%@AI@%command-string%@AE@%
  7027.  
  7028.                                   Specifies the macro and one or more %@AB@%%@AE@%
  7029.                                   %@AB@%SYMDEB%@AE@% commands. The %@AI@%number%@AE@% parameter 
  7030.                                   specifies the macro; the %@AI@%command-string%@AE@% 
  7031.                                   parameter specifies commands.
  7032.  
  7033. %@AB@%/n%@AE@%                                Permits use of nonmaskable interrupts on
  7034.                                   non-IBM computers. To use nonmaskable 
  7035.                                   interrupts, you must have a system that 
  7036.                                   is equipped with the proper hardware, 
  7037.                                   such as the following products: %@CR:C6A00080055 @%
  7038.  
  7039.                                   ■ IBM Professional Debugging Facility
  7040.  
  7041.                                   ■ Software Probe (Atron Corporation)
  7042.  
  7043.                                   The %@AB@%SYMDEB%@AE@% utility requires only the 
  7044.                                   hardware provided with these products; 
  7045.                                   no additional software is needed. If you
  7046.                                   are using one of these products with a 
  7047.                                   non-IBM system, you must use the %@AB@%/n%@AE@% 
  7048.                                   option to take advantage of the break 
  7049.                                   capability. Using a 
  7050.                                   nonmaskable-interrupt break system is 
  7051.                                   more reliable than using the interactive
  7052.                                   break key because you can always stop 
  7053.                                   program execution regardless of the 
  7054.                                   state of interrupts and other conditions.
  7055.                                   %@CR:C6A00080056 @%%@CR:C6A00080057 @%%@CR:C6A00080058 @%
  7056.  
  7057. %@AB@%Option%@AE@%                            %@AB@%Meaning%@AE@%
  7058. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7059. %@AB@%/i%@AE@%«bm»                            Directs the Symbolic Debugger to use 
  7060.                                   features available on IBM-compatible 
  7061.                                   computers. The option is not necessary 
  7062.                                   if you have an IBM PC, because %@AB@%SYMDEB%@AE@% 
  7063.                                   automatically checks the hardware on 
  7064.                                   start-up. If %@AB@%SYMDEB%@AE@% does not find that 
  7065.                                   the hardware is an IBM PC, it assumes 
  7066.                                   that the hardware is a generic DOS 
  7067.                                   machine. Without this option, the
  7068.                                   Symbolic Debugger cannot take advantage 
  7069.                                   of special hardware features such as the
  7070.                                   IBM 8259
  7071.                                   Interrupt Controller, the IBM-style 
  7072.                                   video display, and other capabilities of
  7073.                                   the IBM basic input and
  7074.                                   output system (BIOS). %@CR:C6A00080059 @%
  7075.  
  7076. %@AB@%/f%@AE@%%@AI@%filename%@AE@%                        Prevents association of the named symbol
  7077.                                   file with the executable file that has 
  7078.                                   the same name. This option is rarely 
  7079.                                   used and is not recommended for 
  7080.                                   debugging Windows applications. 
  7081.  
  7082. %@AB@%/%@AE@%%@AI@%commands%@AE@%                         Directs the Symbolic Debugger to execute
  7083.                                   commands in the %@AI@%commands%@AE@% list 
  7084.                                   immediately after starting. Commands in 
  7085.                                   the list must be separated with 
  7086.                                   semicolons and the entire list must be 
  7087.                                   enclosed in double quotation marks. The 
  7088.                                   slash (/) is required. %@CR:C6A00080060 @% %@CR:C6A00080061 @%%@CR:C6A00080062 @% %@CR:C6A00080063 @%
  7089.  
  7090. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7091. NOTE
  7092.  
  7093. %@AI@%You can specify a hyphen instead of a slash for the option designator. You
  7094. %@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@%
  7095.  
  7096. %@AI@%Files containing a hyphen in the filename must be renamed before use with
  7097. %@AB@%SYMDEB%@AE@%%@AI@%. Otherwise, %@AE@%%@AI@%%@AB@%SYMDEB%@AE@%%@AE@%%@AI@% will interpret the hyphen as an option designator.%@AE@%%@AE@%
  7098. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7099.  
  7100.  
  7101. %@3@%%@CR:C6A00080070 @%%@AB@%8.3.2  Specifying Symbol Files%@AE@%%@EH@%%@NL@%
  7102.  
  7103. To debug a Windows application symbolically, you should load symbol files
  7104. for the following items:%@CR:C6A00080071 @%%@CR:C6A00080072 @%%@NL@%
  7105.  
  7106.  
  7107.   ■   The application%@NL@%
  7108.  
  7109.   ■   Windows kernel, user, and GDI (graphics device interface) libraries%@NL@%
  7110.  
  7111.   ■   Other Windows libraries used by the application%@NL@%
  7112.  
  7113.  
  7114. The symbol file for the application is not required. The symbol files for
  7115. the Windows libraries are optional, but recommended. They are helpful when
  7116. trying to trace calls made to routines that are not in the application or to
  7117. trace window messages.%@CR:C6A00080073 @%%@CR:C6A00080074 @%%@CR:C6A00080075 @%%@CR:C6A00080076 @%%@CR:C6A00080077 @%%@CR:C6A00080078 @%%@CR:C6A00080079 @%%@CR:C6A00080080 @%%@CR:C6A00080081 @%%@CR:C6A00080082 @%%@NL@%
  7118.  
  7119. You must give the complete filename and extension when naming a symbol file.
  7120. If the symbol file is not in the current directory, you must supply a full
  7121. pathname. All symbol files must be specified before the WIN.COM file.%@CR:C6A00080083 @%%@CR:C6A00080084 @%%@NL@%
  7122.  
  7123. You should always name the application's symbol file before any other symbol
  7124. files.  %@NL@%
  7125.  
  7126. The following example shows how to specify a symbol file:  %@NL@%
  7127.  
  7128. %@AS@%  SYMDEB \APP\TEST.SYM USER.SYM GDI.SYM \APP\TESTLIB.SYM WIN.COM /R%@AE@%
  7129.  
  7130. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7131. NOTE
  7132.  
  7133. %@AI@%The Windows symbol files for the kernel, user, and GDI libraries, WIN.COM,
  7134. %@AI@%USER.SYM, and GDI.SYM, are provided as part of the Microsoft Windows
  7135. %@AI@%Software Development Kit (SDK).%@AE@%
  7136.  
  7137. %@AI@%You can create symbol files for other Windows libraries by using the same
  7138. %@AI@%methods you used to create application symbol files.%@AE@%
  7139. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7140.  
  7141.  
  7142. %@3@%%@CR:C6A00080085 @%%@AB@%8.3.3  Passing the Application to Windows%@AE@%%@EH@%%@NL@%
  7143.  
  7144. You can pass the name of your application to Windows by placing the full
  7145. pathname on the %@AB@%SYMDEB%@AE@% command line immediately after the WIN.COM filename.
  7146. Windows receives the name as an argument when you start WIN.COM from within
  7147. %@AB@%SYMDEB%@AE@%. Windows uses the name to load and run the application.%@CR:C6A00080086 @%%@CR:C6A00080087 @%%@NL@%
  7148.  
  7149. The following example shows how to pass an application to Windows:  %@NL@%
  7150.  
  7151. %@AS@%  SYMDEB \APP\TEST.SYM WIN.COM /R \APP\TEST.EXE%@AE@%
  7152.  
  7153. If you do not supply your application's name as an argument, you can load
  7154. and start your application by starting WIN.COM and using the Windows shell
  7155. to load the application.  %@NL@%
  7156.  
  7157.  
  7158. %@3@%%@CR:C6A00080088 @%%@AB@%8.3.4  Using SYMDEB Keys%@AE@%%@EH@%%@NL@%
  7159.  
  7160. The Symbolic Debugger provides a number of special keys for controlling
  7161. input and output and program execution. The following is a list of these
  7162. keys:%@CR:C6A00080089 @%%@NL@%
  7163.  
  7164. %@AB@%Key%@AE@%                               %@AB@%Action%@AE@%
  7165. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7166. SCROLL LOCK                       Suspends and restores %@AB@%SYMDEB%@AE@% output. The
  7167.                                   key is typically used to temporarily 
  7168.                                   stop the output of lengthy displays. To 
  7169.                                   suspend output, press SCROLL LOCK. To 
  7170.                                   restore output, press the key again. %@CR:C6A00080090 @% %@CR:C6A00080091 @% %@CR:C6A00080092 @% %@CR:C6A00080093 @%
  7171.  
  7172. CONTROL + SYSREQ                  Generates an immediate breakpoint that 
  7173.                                   halts program execution and returns 
  7174.                                   control to the Symbolic Debugger. 
  7175.                                   (Available on the IBM PC/AT(R) only.) %@CR:C6A00080094 @% %@CR:C6A00080095 @% %@CR:C6A00080096 @%
  7176.                                   %@CR:C6A00080097 @%
  7177.  
  7178. %@AB@%Key%@AE@%                               %@AB@%Action%@AE@%
  7179. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7180. CONTROL + C                       Cancels the current %@AB@%SYMDEB%@AE@% command. This
  7181.                                   key combination does not apply to 
  7182.                                   commands that pass execution control to 
  7183.                                   the application being debugged.%@CR:C6A00080098 @%%@CR:C6A00080099 @%%@CR:C6A00080100 @%%@CR:C6A00080101 @%
  7184.  
  7185.  
  7186. %@2@%%@CR:C6A00080102 @%%@AB@%8.4  Working with Symbol Maps%@AE@%%@EH@%%@NL@%
  7187.  
  7188. Symbol files that the Symbolic Debugger has loaded for debugging are called
  7189. symbol maps. The Symbolic Debugger utility lets you examine symbol maps and
  7190. use the symbols in the maps to set breakpoints and display variables and
  7191. functions.%@CR:C6A00080103 @%%@CR:C6A00080104 @%%@NL@%
  7192.  
  7193. Although symbol maps are in memory, %@AB@%SYMDEB%@AE@% allows access to only one symbol
  7194. map at a time. You can display a list of symbol maps at any time, but to
  7195. display or use the symbols in a map, you must first open that map.  %@NL@%
  7196.  
  7197. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7198. NOTE
  7199.  
  7200. %@AI@%The Symbolic Debugger requires that the filename of the application's .SYM
  7201. %@AI@%file be the same as the application's module name (specified in the
  7202. %@AI@%application's module-definition file). If these names are not identical, the
  7203. %@AI@%Symbolic Debugger will not be able to determine the correct segment
  7204. %@AI@%addresses for symbols in the application.%@CR:C6A00080105 @%%@CR:C6A00080106 @%%@AE@%
  7205.  
  7206. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7207.  
  7208.  
  7209. %@3@%%@CR:C6A00080107 @%%@AB@%8.4.1  Listing the Symbol Maps%@AE@%%@EH@%%@NL@%
  7210.  
  7211. You can display a list of the symbol maps by using the %@AB@%x%@AE@% command with the
  7212. asterisk (*) argument. The command displays the names of all maps in memory,
  7213. the name of each segment belonging to a map, and the 16-bit paragraph
  7214. address of each segment. (The %@AB@%x%@AE@% command without an argument displays only
  7215. the open map.)%@CR:C6A00080108 @%%@CR:C6A00080109 @%%@CR:C6A00080110 @%%@NL@%
  7216.  
  7217. For example, type the following to display a list of the symbol maps:  %@NL@%
  7218.  
  7219. %@AS@%  -x *%@AE@%
  7220.  
  7221. The resulting list could look like the following:  %@NL@%
  7222.  
  7223. %@AS@%  [ 0000 TEST ]
  7224. %@AS@%          [ 0001 IGROUP ]
  7225. %@AS@%            0002 DGROUP
  7226. %@AS@%    0000 TESTLIB
  7227. %@AS@%            0001 _TEXT
  7228. %@AS@%            0002 DGROUP%@AE@%
  7229.  
  7230. The open map name is enclosed in brackets ([ ]). The active segment in the
  7231. map is also enclosed in brackets. Segment addresses appear immediately
  7232. before the segment names.%@CR:C6A00080111 @%%@CR:C6A00080112 @%%@CR:C6A00080113 @%%@CR:C6A00080114 @%%@NL@%
  7233.  
  7234. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7235. NOTE
  7236.  
  7237. %@AI@%The Symbolic Debugger does not display a segment's actual address until the
  7238. %@AI@%code or data corresponding to that segment has been loaded. If you list the
  7239. %@AI@%symbol maps before loading an application, %@AB@%SYMDEB%@AE@%%@AI@% displays low-memory
  7240. %@AI@%addresses as a warning that the segments are not yet in memory.%@AE@%%@AE@%
  7241. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7242.  
  7243. Once an application is loaded, %@AB@%SYMDEB%@AE@% appends a number to the end of the
  7244. data-segment name in the symbol map. This number shows which instance of the
  7245. application the data segment belongs to. If you load multiple instances of
  7246. an application, %@AB@%SYMDEB%@AE@% adds a new data-segment name to the symbol map for
  7247. that application.  %@NL@%
  7248.  
  7249. In the following example, %@AB@%SYMDEB%@AE@% places parentheses around the active data
  7250. segment to show which instance of the application is currently running:  %@NL@%
  7251.  
  7252. %@AS@%  [ 0000 TEST ]
  7253. %@AS@%          [ 88F0 IGROUP ]
  7254. %@AS@%          ( 87E0 DGROUP )
  7255. %@AS@%            8944 DGROUP1%@AE@%
  7256.  
  7257.  
  7258. %@3@%%@CR:C6A00080115 @%%@AB@%8.4.2  Opening a Symbol Map%@AE@%%@EH@%%@NL@%
  7259.  
  7260. To access the symbols in a symbol map, you must open the symbol map using
  7261. the %@AB@%xo%@AE@% command. For example, to open the symbol map named TEST, you would
  7262. type the following:%@CR:C6A00080116 @%%@CR:C6A00080117 @%%@NL@%
  7263.  
  7264. %@AS@%  -xo test!%@AE@%
  7265.  
  7266. The Symbolic Debugger opens the symbol map and lets you examine and use
  7267. symbols from the map.%@CR:C6A00080118 @%%@CR:C6A00080119 @%%@NL@%
  7268.  
  7269. You can use the %@AB@%xo%@AE@% command to open a different symbol map at any time.  %@NL@%
  7270.  
  7271.  
  7272. %@3@%%@CR:C6A00080120 @%%@AB@%8.4.3  Displaying Symbols%@AE@%%@EH@%%@NL@%
  7273.  
  7274. You can use the %@AB@%x?%@AE@% command to display the symbols in the open symbol map.
  7275. The command lists each symbol by name and also gives the symbol's address
  7276. offset. For example, to display the symbol TestWndProc%@AB@%,%@AE@% type the following:%@CR:C6A00080121 @%%@CR:C6A00080122 @%%@CR:C6A00080123 @%%@NL@%
  7277.  
  7278. %@AS@%  -x? testwndproc%@AE@%
  7279.  
  7280. The command displays the name and address of the segment to which the symbol
  7281. belongs, as in the following example:  %@NL@%
  7282.  
  7283. %@AS@%  [ 88E0 IGROUP ]
  7284. %@AS@%    005A TESTWNDPROC%@AE@%
  7285.  
  7286. The symbol's absolute address can be computed using the segment's address
  7287. and the symbol's offset. In the preceding example, the function TestWndProc
  7288. is in the segment IGROUP at address 88E0:005A.  %@NL@%
  7289.  
  7290. If the symbol is an external symbol (for example, a function or variable
  7291. defined outside of the application), no group name is given and the offset
  7292. is always zero, as shown in the following example:  %@NL@%
  7293.  
  7294. %@AS@%  0000 SHOWWINDOW%@AE@%
  7295.  
  7296. You can use the asterisk (*) as a wildcard character with the %@AB@%x%@AE@% command to
  7297. display more than one symbol at a time. For example, the following command
  7298. displays all symbols in the IGROUP segment:%@CR:C6A00080124 @%%@CR:C6A00080125 @%%@NL@%
  7299.  
  7300. %@AS@%  -x? igroup:*%@AE@%
  7301.  
  7302. The following command displays all symbols in the DGROUP segment that begin
  7303. with an underscore (_):  %@NL@%
  7304.  
  7305. %@AS@%  -x? dgroup:_*%@AE@%
  7306.  
  7307.  
  7308. %@2@%%@CR:C6A00080126 @%%@AB@%8.5  Starting the Application%@AE@%%@EH@%%@NL@%
  7309.  
  7310. You can start the application by using the %@AB@%g%@AE@% command. The command directs
  7311. the Symbolic Debugger to pass execution control to the program at the
  7312. current code address. (Immediately after starting %@AB@%SYMDEB%@AE@% with Windows, the
  7313. current code address is the start address of the WIN.COM. file.)%@CR:C6A00080127 @%%@CR:C6A00080128 @%%@CR:C6A00080129 @%%@NL@%
  7314.  
  7315. If you have supplied your application's filename as a WIN.COM argument on
  7316. the %@AB@%SYMDEB%@AE@% command line, WIN.COM starts your application automatically.
  7317. Otherwise, it starts the Windows shell, which will load and run your
  7318. application.  %@NL@%
  7319.  
  7320.  
  7321. %@2@%%@CR:C6A00080130 @%%@AB@%8.6  Displaying Allocation Messages%@AE@%%@EH@%%@NL@%
  7322.  
  7323. The Symbolic Debugger displays memory-allocation messages to show that
  7324. Windows has created, freed, or moved memory blocks. The messages are
  7325. intended to help you locate your application's program code and data in
  7326. memory. The messages can also be used to see the effect of the application
  7327. on Windows memory management. The Symbolic Debugger actually displays
  7328. messages only if the memory-allocation reporting level is set to an
  7329. appropriate value (see the %@AB@%/w%@AE@% option in Section 8.3.1, "Specifying SYMDEB
  7330. Options").%@CR:C6A00080131 @%%@CR:C6A00080132 @%%@NL@%
  7331.  
  7332. When Windows allocates a new block of memory and the reporting level is 1 or
  7333. 3, the Symbolic Debugger displays a message of the following form:  %@NL@%
  7334.  
  7335. %@AI@%module-name%@AS@%!%@AE@%segment-name=segment-address%@AS@%  %@AE@%%@AE@%%@NL@%
  7336.  
  7337. The %@AI@%module-name%@AE@% field specifies the name of the application or library to
  7338. receive the allocated memory. The %@AI@%segment-name%@AE@% field specifies the name of
  7339. the code or data segment within the application or library that will occupy
  7340. the memory block. The %@AI@%segment-address%@AE@% field specifies the 16-bit paragraph
  7341. address of the memory block.  %@NL@%
  7342.  
  7343. When Windows moves a block of memory and the reporting level is 2 or 3, the
  7344. Symbolic Debugger displays a message of the following form:  %@NL@%
  7345.  
  7346. %@AI@%old-address%@AE@% %@AS@%moved to%@AE@% %@AI@%new-address%@AE@%  %@NL@%
  7347.  
  7348. The %@AI@%old-address%@AE@% and %@AI@%new-address%@AE@% fields specify the old and new 16-bit
  7349. paragraph addresses of the memory block.  %@NL@%
  7350.  
  7351. When Windows frees a block of memory and the reporting level is 1 or 3, the
  7352. Symbolic Debugger displays a message of the following form:  %@NL@%
  7353.  
  7354. %@AI@%segment-address%@AE@% %@AS@%freed%@AE@%  %@NL@%
  7355.  
  7356. The %@AI@%segment-address%@AE@% field specifies the 16-bit paragraph address of the
  7357. block to be freed.  %@NL@%
  7358.  
  7359. The following is an example of allocation messages that %@AB@%SYMDEB%@AE@% might
  7360. display:  %@NL@%
  7361.  
  7362. %@AS@%  TEST!IGROUP=886F
  7363. %@AS@%  TEST!DGROUP=8799
  7364. %@AS@%  GDI!Code=1C32
  7365. %@AS@%  8344 moved to 8230
  7366. %@AS@%  7C12 freed%@AE@%
  7367.  
  7368.  
  7369. %@3@%%@CR:C6A00080133 @%%@AB@%8.6.1  Setting Breakpoints with Symbols%@AE@%%@EH@%%@NL@%
  7370.  
  7371. You can use the %@AB@%bp%@AE@% command and symbols to set breakpoints in your
  7372. application code even before loading the application. The %@AB@%bp%@AE@% command uses
  7373. the symbol to compute the instruction address at which to break execution.
  7374. If the application has not been loaded, %@AB@%SYMDEB%@AE@% sets a virtual breakpoint. A
  7375. virtual breakpoint has no effect on execution until the application is
  7376. actually loaded. Once an application is loaded, %@AB@%SYMDEB%@AE@% computes the actual
  7377. code addresses of all virtual breakpoints and enables the breakpoints.%@CR:C6A00080134 @%%@CR:C6A00080135 @%%@CR:C6A00080136 @%%@CR:C6A00080137 @%%@NL@%
  7378.  
  7379. For example, to set a breakpoint at the application's WinMain function, you
  7380. would type the following:%@CR:C6A00080138 @%%@CR:C6A00080139 @%%@NL@%
  7381.  
  7382. %@AS@%  -bp winmain%@AE@%
  7383.  
  7384. After you set the breakpoint, the application breaks and returns control to
  7385. %@AB@%SYMDEB%@AE@% when this address is encountered.  %@NL@%
  7386.  
  7387. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7388. NOTE
  7389.  
  7390. %@AI@%If you do not set breakpoints before starting the application, use an
  7391. %@AI@%interrupt key to break execution (see Section 8.3.4, "Using SYMDEB Keys,"
  7392. %@AI@%for more information on %@AB@%SYMDEB%@AE@%%@AI@% keys).%@CR:C6A00080140 @%%@CR:C6A00080141 @%%@AE@%%@AE@%
  7393. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7394.  
  7395.  
  7396. %@3@%%@CR:C6A00080142 @%%@AB@%8.6.2  Displaying Variables%@AE@%%@EH@%%@NL@%
  7397.  
  7398. You can use the %@AB@%d%@AE@% command to display the content of the application's global
  7399. variables. The command frequently takes the variable's symbol as an argument
  7400. and computes the variable's address using the address of the variable's
  7401. segment and its offset. The symbol map containing the symbol must be open.
  7402. See Section 8.9, "SYMDEB Commands," for details of arguments to the %@AB@%d%@AE@%
  7403. command.%@CR:C6A00080143 @%%@CR:C6A00080144 @%%@CR:C6A00080145 @%%@CR:C6A00080146 @%%@CR:C6A00080147 @%%@NL@%
  7404.  
  7405. When there are multiple instances of the application being debugged, %@AB@%SYMDEB%@AE@%
  7406. uses the address of the active data segment to compute a variable's address.
  7407. To display a variable in another instance, supply an absolute segment
  7408. address. For example, to display the value of %@AI@%hInstance%@AE@% in the first
  7409. instance, you must first determine the 16-bit paragraph address of the first
  7410. DGROUP segment by typing the following:  %@NL@%
  7411.  
  7412. %@AS@%  -x %@AE@%
  7413.  
  7414. %@AB@%SYMDEB%@AE@% displays the name and address of each segment in the open map, as in
  7415. the following example:  %@NL@%
  7416.  
  7417. %@AS@%  [ 0000 TEST ]
  7418. %@AS@%   [ 8A12 IGROUP ]
  7419. %@AS@%     89A0 DGROUP
  7420. %@AS@%   ( 8882 DGROUP1 )%@AE@%
  7421.  
  7422. Specify the address when typing the %@AB@%d%@AE@% command, as follows:  %@NL@%
  7423.  
  7424. %@AS@%  -dw 89A0:hinstance%@AE@%
  7425.  
  7426. %@AB@%SYMDEB%@AE@% displays the contents of the specified variable, as follows:  %@NL@%
  7427.  
  7428. %@AS@%  88AO:0010 0235 0000 0000 0000 0000 0000 0000 0000%@AE@%
  7429.  
  7430.  
  7431. %@3@%%@CR:C6A00080148 @%%@AB@%8.6.3  Displaying Application Source Statements%@AE@%%@EH@%%@NL@%
  7432.  
  7433. You can display the source statements of an application by using the %@AB@%v%@AE@%, %@AB@%s+%@AE@%,
  7434. and %@AB@%s&%@AE@% commands. The %@AB@%v%@AE@% command displays the source lines of the application
  7435. beginning with the source line corresponding to the current code address
  7436. (CS:IP). The %@AB@%s+%@AE@% command directs the Symbolic Debugger to display source
  7437. lines whenever you use the %@AB@%u%@AE@% command. The %@AB@%s&%@AE@% command directs the Symbolic
  7438. Debugger to display both source lines and unassembled code whenever you use
  7439. the %@AB@%u%@AE@% command. For more information on these commands, see Section 8.9,
  7440. "SYMDEB Commands."%@CR:C6A00080149 @%%@NL@%
  7441.  
  7442. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7443. NOTE
  7444.  
  7445. %@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@%
  7446. %@AI@%commands have no effect.%@AE@%%@AE@%
  7447.  
  7448. %@AI@%If the application source file is not in the current directory, or the file
  7449. %@AI@%does not have the same name as the symbol file, %@AB@%SYMDEB%@AE@%%@AI@% prompts for the
  7450. %@AI@%file's correct name and/or pathname.%@AE@%%@AE@%
  7451. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7452.  
  7453.  
  7454. %@2@%%@CR:C6A00080150 @%%@AB@%8.7  Quitting SYMDEB%@AE@%%@EH@%%@NL@%
  7455.  
  7456. You can terminate %@AB@%SYMDEB%@AE@% at any time by using the %@AB@%q%@AE@% command to return to the
  7457. DOS prompt. Before quitting %@AB@%SYMDEB%@AE@%, however, you must end the current
  7458. Windows session and restore the console display to its normal display modes.%@CR:C6A00080151 @%%@CR:C6A00080152 @%%@NL@%
  7459.  
  7460. Follow these general rules:  %@NL@%
  7461.  
  7462.  
  7463.   ■   Use the %@AB@%q%@AE@% command to quit, if you have not started Windows.%@NL@%
  7464.  
  7465.   ■   Open the Windows shell and choose the Close command from its System
  7466.       menu, then use the %@AB@%q%@AE@% command, if you have started Windows and it is
  7467.       still operational. Make sure that all instances of the shell are
  7468.       closed.%@NL@%
  7469.  
  7470. %@STUB@%      %@AI@%IMPORTANT  %@AE@%When Windows terminates as a result of a fatal exit, the
  7471.       Symbolic  Debugger displays a fatal-exit message and returns the
  7472.       %@AB@%SYMDEB%@AE@% prompt. Do not attempt to restart Windows or quit %@AB@%SYMDEB%@AE@%. You
  7473.       must reboot the system to continue.%@CR:C6A00080153 @%%@CR:C6A00080154 @%%@CR:C6A00080155 @%%@CR:C6A00080156 @%%@NL@%
  7474.  
  7475.  
  7476.  
  7477. %@2@%%@CR:C6A00080157 @%%@AB@%8.8  SYMDEB Command Overview and Tables%@AE@%%@EH@%%@NL@%
  7478.  
  7479. This section contains a complete listing of commands that can be used with
  7480. the Symbolic Debugger. It also describes the arguments and expressions used
  7481. with %@AB@%SYMDEB%@AE@% commands, as well as predefined names used as register and
  7482. register-flag names. Table 8.1 is a summary of the syntax and meaning of %@AB@%
  7483. %@AB@%SYMDEB%@AE@% commands:%@CR:C6A00080158 @%%@NL@%
  7484.  
  7485. Table 8.1  SYMDEB Commands
  7486.  
  7487. %@TH:  26  1247 02 38 38 @%Syntax                                Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%a %@AE@%«%@AI@%address%@AE@%»                           Assemble instruction mnemonics%@AB@%ba %@AE@%%@AI@%option size%@AE@% address«%@AI@%value%@AE@%»         Set address breakpoint(s) on 80386 «%@AI@%command-string%@AE@%»                      machines%@AB@%bc %@AE@%%@AI@%id-list%@AE@%                            Clear breakpoint(s) %@AB@%bd %@AE@%%@AI@%id-list%@AE@%                            Disable breakpoint(s)%@AB@%be %@AE@%%@AI@%id-list%@AE@%                            Enable breakpoint(s) %@AB@%bl%@AE@%                                    List breakpoint(s) %@AB@%bp%@AE@%«%@AI@%id%@AE@%» %@AI@%address %@AE@%«%@AI@%value%@AE@%»                Set breakpoint(s) «%@AI@%command-string%@AE@%»                      %@AB@%c %@AE@%%@AI@%range address%@AE@%                       Compare %@AB@%d %@AE@%«%@AI@%range%@AE@%»                             Dump memory using previous type %@AB@%da %@AE@%«%@AI@%range%@AE@%»                            Dump memory ASCII %@AB@%db %@AE@%«%@AI@%range%@AE@%»                            Dump memory bytes %@TE:  26  1247 02 38 38 @%
  7488.  
  7489. Table 8.1  SYMDEB Commands (continued)
  7490.  
  7491. %@TH: 121  5466 02 38 38 @%Syntax                                Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%dd %@AE@%«%@AI@%range%@AE@%»                            Dump memory doublewords  %@AB@%df%@AE@%                                    Display list of global free blocks%@AB@%dg%@AE@%                                    Display global heap %@AB@%dh%@AE@%                                    Display local heap for current data                                       segment register%@AB@%%@AE@%%@AB@%dl %@AE@%«%@AI@%range%@AE@%»                            Dump memory, long floating point %@AB@%dm%@AE@%                                    Display list of loaded modules%@AB@%dq%@AE@%                                    Dump list of current tasks, their                                       SS:BP, CS:IP, nEvents, priority,                                       module name, and queue handle%@AB@%ds %@AE@%«%@AI@%range%@AE@%»                            Dump memory, short floating point %@AB@%dt %@AE@%«%@AI@%range%@AE@%»                            Dump memory 10-byte reals  %@AB@%du%@AE@%                                    Display LRU list%@AB@%dw %@AE@%«%@AI@%range%@AE@%»                            Dump memory words %@AB@%e %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                     Enter using previous type %@AB@%ea %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter ASCII %@AB@%eb %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter bytes %@AB@%ed %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter doublewords %@AB@%el %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter long floating point %@AB@%es %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter short floating point %@AB@%et %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter 10-byte reals %@AB@%ew %@AE@%%@AI@%address %@AE@%«%@AI@%value%@AE@%»                    Enter words %@AB@%f %@AE@%%@AI@%range list%@AE@%                          Fill %@AB@%g %@AE@%«= %@AI@%startaddress %@AE@%» «%@AI@%breakaddress%@AE@%»...  Go %@AB@%h %@AE@%%@AI@%value1 value2%@AE@%                       Add hexadecimal command%@AB@%i %@AE@%%@AI@%value%@AE@%                               Input from port %@AB@%k %@AE@%«%@AI@%value%@AE@%»                             Backtrace stack  %@AB@%kt %@AE@%%@AI@%pdb %@AE@%«%@AI@%value%@AE@%»                        Backtrace task  %@AB@%kv %@AE@%«%@AI@%value%@AE@%»                            Annotate each stack frame with the                                       associated frame pointer value%@AB@%l %@AE@%«%@AI@%address %@AE@%«%@AI@%drive record count%@AE@%» »     Load %@AB@%m %@AE@%%@AI@%range address%@AE@%                       Move %@AB@%m%@AE@%%@AI@%id%@AE@%«= %@AI@%command-string%@AE@%»                 Define or execute macro %@AB@%n %@AE@%«%@AI@%filename%@AE@%»«%@AI@%arguments%@AE@%»               Set name %@AB@%o %@AE@%%@AI@%value byte%@AE@%                          Output to port %@AB@%p %@AE@%«= %@AI@%startaddress%@AE@%» «%@AI@%value%@AE@%»            Trace program instruction or call%@AB@%q%@AE@%                                     Quit %@AB@%r %@AE@%«%@AI@%register%@AE@%» « «= » %@AI@%value%@AE@%»            Register %@AB@%s %@AE@%%@AI@%range list%@AE@%                          Search %@AB@%s-%@AE@%                                    Set machine debugging only %@AB@%s&%@AE@%                                    Set machine and source debugging %@AB@%s+%@AE@%                                    Set source debugging only %@AB@%t %@AE@%«= %@AI@%startaddress%@AE@%» «%@AI@%value%@AE@%»            Trace program instruction %@AB@%u %@AE@%«%@AI@%range%@AE@%»                             Display unassembled instructions %@AB@%v %@AE@%%@AI@%range%@AE@%                               View source lines  %@AB@%w %@AE@%«%@AI@%address %@AE@%«%@AI@%drive record count%@AE@%» »     Write to disk or file %@AB@%x %@AE@%«*| ?» %@AI@%symbol%@AE@%                       Examine symbol(s) %@AB@%xo %@AE@%«%@AI@%symbol%@AE@%!»                          Open symbol map/segment %@AB@%z %@AE@%%@AI@%symbol value%@AE@%                        Set symbol value %@AB@%?%@AE@%                                     Display list of %@AB@%SYMDEB%@AE@% commands and                                       operators%@AB@%? %@AE@%%@AI@%expression%@AE@%                          Compute and display expression %@AB@%.%@AE@%                                     Display current source line %@AB@%< %@AE@%%@AI@%filename%@AE@%                            Redirect %@AB@%SYMDEB%@AE@% input %@AB@%> %@AE@%%@AI@%filename%@AE@%                            Redirect %@AB@%SYMDEB%@AE@% output %@AB@%= = f%@AE@%%@AI@%ilename%@AE@%                          Redirect %@AB@%SYMDEB%@AE@% input and output { %@AI@%filename%@AE@%                            Redirect program input } %@AI@%filename%@AE@%                            Redirect program output  %@AB@%~ %@AE@%%@AI@%filename%@AE@%                            Redirect program input and output %@AB@%! %@AE@%«%@AI@%dos-command%@AE@%»                       Shell escape %@AB@%* %@AE@%%@AI@%comment%@AE@%                             Comment %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE: 121  5466 02 38 38 @%
  7492.  
  7493. Any combination of uppercase and lowercase letters may be used in commands
  7494. and arguments. If a command uses two or more parameters, separate them with
  7495. a single comma (,) or one or more spaces.%@CR:C6A00080159 @%%@NL@%
  7496.  
  7497. The following provides examples of %@AB@%SYMDEB%@AE@% commands:  %@NL@%
  7498.  
  7499. %@AS@%  ds _avg L 10
  7500. %@AS@%  U .22
  7501. %@AS@%  f DS:100,110 ff,fe,01,00%@AE@%
  7502.  
  7503. For complete information about command syntax, see Section 8.9, "SYMDEB
  7504. Commands."  %@NL@%
  7505.  
  7506.  
  7507. %@3@%%@CR:C6A00080160 @%%@AB@%8.8.1  Command Arguments%@AE@%%@EH@%%@NL@%
  7508.  
  7509. Command arguments are numbers, symbols, line numbers, or expressions used to
  7510. specify addresses or values to be used by %@AB@%SYMDEB%@AE@% commands. The following is
  7511. a list of argument syntax and meaning:%@CR:C6A00080161 @%%@CR:C6A00080162 @%%@CR:C6A00080163 @%%@NL@%
  7512.  
  7513. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  7514. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7515. %@AI@%address%@AE@%                           Specifies absolute, relative, or 
  7516.                                   symbolic address of
  7517.                                   a variable or function. The Symbolic 
  7518.                                   Debugger permits a wide variety of 
  7519.                                   address types. See Section
  7520.                                    8.8.2, "Address Arguments," for a 
  7521.                                   complete description of address 
  7522.                                   arguments. 
  7523.  
  7524. %@AI@%byte%@AE@%                              Specifies a %@AI@%value%@AE@% argument representing 
  7525.                                   a byte value. It must be within the 
  7526.                                   range 0 to 255. 
  7527.  
  7528. %@AI@%command-string%@AE@%                    Specifies one or more %@AB@%SYMDEB%@AE@% commands. 
  7529.                                   If more than one command is given, they 
  7530.                                   must be separated by semicolons (;).
  7531.  
  7532. %@AI@%count%@AE@%                             Specifies a %@AI@%value%@AE@% argument representing 
  7533.                                   the number of disk records to read or 
  7534.                                   write. 
  7535.  
  7536. %@AI@%dos-command%@AE@%                       Specifies a DOS command. 
  7537.  
  7538. %@AI@%drive%@AE@%                             Specifies a %@AI@%value%@AE@% argument representing 
  7539.                                   a disk drive. Drives are numbered 0 for 
  7540.                                   A, 1 for B, 2 for C, and so on.
  7541.  
  7542. %@AI@%expression%@AE@%                        Specifies a combination of arguments and
  7543.                                   operators that represents a single value
  7544.                                   or address. See Section 8.8.3, 
  7545.                                   "Expressions," for a list and 
  7546.                                   explanation of expression operators. 
  7547.  
  7548. %@AI@%filename%@AE@%                          Specifies the name of a file or a device.
  7549.                                   The filename must follow the DOS 
  7550.                                   filenaming
  7551.                                   conventions. 
  7552.  
  7553. %@AI@%id%@AE@%                                Specifies a decimal number representing 
  7554.                                   a breakpoint or macro identifier. The 
  7555.                                   number must be within the range 0 to 9. 
  7556.  
  7557. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  7558. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7559. %@AI@%id-list%@AE@%                           Specifies one or more unique decimal 
  7560.                                   numbers representing a list of 
  7561.                                   breakpoint identifiers. The numbers must
  7562.                                   be within the range 0 to 9. If more than
  7563.                                   one number is given, they must be 
  7564.                                   separated using spaces or commas. The 
  7565.                                   wildcard character (*) can be used to 
  7566.                                   specify all breakpoints. %@CR:C6A00080164 @%
  7567.  
  7568. %@AI@%list%@AE@%                              Specifies one or more %@AI@%value%@AE@% arguments. 
  7569.                                   The values must be within the range 0 to
  7570.                                   65,535. If more than one value is given,
  7571.                                   they must be separated using spaces or 
  7572.                                   commas. 
  7573.  
  7574.                                   A %@AI@%list%@AE@% can also be specified as a list 
  7575.                                   of ASCII values. The list can contain 
  7576.                                   any combination of characters and must 
  7577.                                   be enclosed in either single or double 
  7578.                                   quotation marks. If the enclosing mark 
  7579.                                   appears within the list, it must be 
  7580.                                   given twice.
  7581.  
  7582. %@AI@%range%@AE@%                             Specifies an address range. Address 
  7583.                                   ranges have two forms: a start and end 
  7584.                                   address pair, and a start address and 
  7585.                                   object count. The first form consists of
  7586.                                   two %@AI@%address%@AE@% arguments, the first 
  7587.                                   specifying the start address and the 
  7588.                                   second specifying the end address. The 
  7589.                                   second form consists of an %@AI@%address%@AE@% 
  7590.                                   argument, the letter %@AB@%l%@AE@%, and a %@AI@%value%@AE@% 
  7591.                                   argument. The %@AI@%address%@AE@% specifies the 
  7592.                                   starting address; the %@AI@%value%@AE@% specifies 
  7593.                                   the number of objects after the address 
  7594.                                   to examine or display. The size of an 
  7595.                                   object depends on the command. If a 
  7596.                                   command requires a %@AI@%range%@AE@% but only a 
  7597.                                   start address is given in the command, 
  7598.                                   the command assumes the range has an 
  7599.                                   object count of 128. This default count 
  7600.                                   does not apply to commands that require 
  7601.                                   a range followed immediately by a %@AI@%value%@AE@% 
  7602.                                   or an address argument. 
  7603.  
  7604. %@AI@%record%@AE@%                            Specifies a %@AI@%value%@AE@% argument representing 
  7605.                                   the first disk record to be read or 
  7606.                                   written to. %@CR:C6A00080165 @% %@CR:C6A00080166 @%%@CR:C6A00080167 @%
  7607.  
  7608. %@AI@%register%@AE@%                          Specifies the name of a CPU register. It
  7609.                                   can be any one of the following: 
  7610.  
  7611. %@TH:   5   185 01 04 04 04 64 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%AX  CX  ES  SIBP  DI  F   SPBX  DS  IP  SSCS  DX  PC%@TE:   5   185 01 04 04 04 64 @%
  7612.  
  7613. The names IP and PC refer to the same register: the instruction pointer. The
  7614. name F is a special name for the flags register. Each flag within the flags
  7615. register has a unique name based on its value. These names can be used to
  7616. set or clear the flag. Table 8.2 lists the flag names:  %@NL@%
  7617.  
  7618. Table 8.2  Flag Values
  7619.  
  7620. %@TH:  12   730 02 17 16 43 @%Flag             Set             Clear%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Overflow         ov              nvDirection        dn (decrement)%@AB@%%@AE@%  up (increment)%@AB@%%@AE@%                 %@AB@%%@AE@%                Interrupt        ei (enabled)%@AB@%%@AE@%    di (disabled)%@AB@%%@AE@%Sign             ng (negative)%@AB@%%@AE@%   pl (positive)%@AB@%%@AE@%Zero             zr              nzAuxiliary Carry  ac              naParity           pe (even)%@AB@%%@AE@%       po (odd)%@AB@%%@AE@%Carry            cy              nc%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  12   730 02 17 16 43 @%
  7621.  
  7622. %@AB@%Argument%@AE@%                          %@AB@%Description%@AE@%
  7623. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7624. %@AI@%symbol%@AE@%                            Identifies the address of a variable, 
  7625.                                   function, or segment. A symbol consists 
  7626.                                   of one or more characters, but always 
  7627.                                   begins with a letter, underscore (_), 
  7628.                                   question mark (?), at symbol (@), or 
  7629.                                   dollar sign ($). Symbols are available 
  7630.                                   only when the .SYM file that defines 
  7631.                                   their names and values has been loaded. 
  7632.                                   Any combination of uppercase and 
  7633.                                   lowercase letters can be used; %@AB@%SYMDEB%@AE@% is
  7634.                                   not case-sensitive. For some commands, 
  7635.                                   the wildcard character (*) may be used 
  7636.                                   as part of a symbol to represent any 
  7637.                                   combination of characters. %@CR:C6A00080168 @%%@CR:C6A00080169 @%%@CR:C6A00080170 @%%@CR:C6A00080171 @%%@CR:C6A00080172 @%%@CR:C6A00080173 @%%@CR:C6A00080174 @%%@CR:C6A00080175 @%%@CR:C6A00080176 @%
  7638. %@CR:C6A00080177 @%%@CR:C6A00080178 @%%@CR:C6A00080179 @%%@CR:C6A00080180 @%
  7639. %@AI@%pdb%@AE@%                               Specifies a %@AI@%value%@AE@% argument representing 
  7640.                                   the segment address of a program 
  7641.                                   descriptor block. 
  7642.  
  7643. %@AI@%value%@AE@%                             Specifies an integer number in binary, 
  7644.                                   octal, decimal, or hexadecimal format. A
  7645.                                   value consists of one or more digits 
  7646.                                   optionally followed by a radix: Y for 
  7647.                                   binary, O or Q for octal, T for decimal,
  7648.                                   or H for hexadecimal. If no radix is 
  7649.                                   given, hexadecimal is assumed. %@AB@%SYMDEB%@AE@% 
  7650.                                   truncates leading digits if the number 
  7651.                                   is greater than 65,535. Leading zeros 
  7652.                                   are ignored. Hexadecimal numbers have 
  7653.                                   precedence over symbols, thus FAA is a 
  7654.                                   number. 
  7655.  
  7656.  
  7657. %@3@%%@CR:C6A00080181 @%%@AB@%8.8.2  Address Arguments%@AE@%%@EH@%%@NL@%
  7658.  
  7659. Address arguments specify the location of variables and functions. The
  7660. following list explains the syntax and meaning of the various addresses used
  7661. in %@AB@%SYMDEB%@AE@%: %@CR:C6A00080182 @% %@CR:C6A00080183 @% %@CR:C6A00080184 @%%@NL@%
  7662.  
  7663. %@AB@%Syntax%@AE@%                            %@AB@%Meaning%@AE@%
  7664. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7665. %@AI@%segment%@AE@%%@AB@%:%@AE@%%@AI@%offset%@AE@%                    Specifies an absolute address. A full 
  7666.                                   address has both a %@AI@%segment%@AE@% address and 
  7667.                                   an %@AI@%offset%@AE@%, separated by a colon (:). A 
  7668.                                   partial address is just an %@AI@%offset%@AE@%. In 
  7669.                                   both cases, the %@AI@%segment%@AE@% or %@AI@%offset%@AE@% can be
  7670.                                   any number, register name, or symbol. If
  7671.                                   no %@AI@%segment%@AE@% is given, the %@AB@%a%@AE@%, %@AB@%g%@AE@%, %@AB@%l%@AE@%, %@AB@%p%@AE@%, %@AB@%t%@AE@%, %@AB@%%@AE@%
  7672.                                   %@AB@%u%@AE@%, and %@AB@%w%@AE@% commands use the CS register 
  7673.                                   for the default segment address. All 
  7674.                                   other commands use DS. 
  7675.  
  7676. %@AI@%name%@AE@%{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%offset%@AE@%                 Specifies a symbol-relative address. The
  7677.                                   %@AI@%name%@AE@% can be any symbol. The %@AI@%offset%@AE@% 
  7678.                                   specifies the offset in bytes. The 
  7679.                                   address can be specified as a positive 
  7680.                                   (+) or negative (-) offset. 
  7681.  
  7682. %@AB@%.%@AE@%{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%number%@AE@%                    Specifies a relative line number. The %@AI@%%@AE@%
  7683.                                   %@AI@%number%@AE@% is an offset (in lines) from the 
  7684.                                   current source line to the new line. If 
  7685.                                   + is given, the new line is closer to 
  7686.                                   the end of the source file. If - is 
  7687.                                   given, the new line is closer to the 
  7688.                                   beginning. 
  7689.  
  7690. %@AB@%.%@AE@%«%@AI@%filename%@AE@%%@AB@%:%@AE@%»%@AI@%number%@AE@%                Specifies an absolute line number. If %@AI@%%@AE@%
  7691.                                   %@AI@%filename%@AE@% is given, the specified line is
  7692.                                   assumed to be in the source file 
  7693.                                   corresponding to the symbol file 
  7694.                                   identified by %@AI@%filename%@AE@%. If no filename 
  7695.                                   is given, the current instruction 
  7696.                                   address (the current values of the CS 
  7697.                                   and IP registers) determines which 
  7698.                                   source file contains the line.
  7699.  
  7700. %@AI@%symbol%@AE@%«{%@AB@%+ %@AE@%|%@AB@% -%@AE@%}%@AI@%number%@AE@%»             Specifies a symbolic line number. The %@AI@%%@AE@%
  7701.                                   %@AI@%symbol%@AE@% can be any instruction or 
  7702.                                   procedure label. If %@AI@%number%@AE@% is given, the
  7703.                                   %@AI@%number%@AE@% is an offset (in lines) from the 
  7704.                                   given label or procedure name to the new
  7705.                                   line. If + is given, the new line is 
  7706.                                   closer to the end of the source file. If
  7707.                                   - is given, the new line is closer to 
  7708.                                   the beginning.%@CR:C6A00080185 @% %@CR:C6A00080186 @% %@CR:C6A00080187 @%
  7709.  
  7710. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7711. NOTE
  7712.  
  7713. %@AI@%Line numbers can be used only with programs developed with compilers that
  7714. %@AI@%copy line-number data to the object file.%@AE@%
  7715. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7716.  
  7717.  
  7718. %@3@%%@CR:C6A00080188 @%%@AB@%8.8.3  Expressions%@AE@%%@EH@%%@NL@%
  7719.  
  7720. An expression is a combination of arguments and operators that evaluates to
  7721. an 8-bit, 16-bit, or 32-bit value. Expressions can be used as values in any
  7722. command.%@CR:C6A00080189 @%%@CR:C6A00080190 @%%@NL@%
  7723.  
  7724. An expression can combine any symbol, number, or address with any of the
  7725. unary and binary operators in Tables 8.3 and 8.4.  %@NL@%
  7726.  
  7727. Table 8.3  Unary Operators
  7728.  
  7729. %@TH:  14   745 02 10 41 25 @%Operator  Meaning                                  Precedence%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%++        Unary plus                               Highest-         Unary minusnot       1's complementseg       Segment address of operandoff       Address offset of operandby        Low-order byte from given addresswo        Low-order word from given addressdw        Doubleword from given addresspoi       Pointer from given address (same as %@AB@%dw%@AE@%)port      One byte from given portwport     Word from given port                     Lowest%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  14   745 02 10 41 25 @%
  7730.  
  7731. Table 8.4  Binary Operators
  7732.  
  7733. %@TH:  12   549 02 10 30 36 @%Operator  Meaning                       Precedence%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%*         Multiplication                Highest/         Integer divisionmod       Modulus:         Segment override++        Addition-         Subtractionand       Bitwise Boolean ANDxor       Bitwise Boolean exclusive ORor        Bitwise Boolean OR            Lowest%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  12   549 02 10 30 36 @%
  7734.  
  7735. Unary address operators assume DS as the default segment for addresses.
  7736. Expressions are evaluated in order of operator precedence. If adjacent
  7737. operators have equal precedence, the expression is evaluated from left to
  7738. right. Use parentheses to override this order.  %@NL@%
  7739.  
  7740. The following exemplifies the use of Unary expressions:  %@NL@%
  7741.  
  7742. %@AS@%  SEG 0001:0002           ; Equals 1
  7743. %@AS@%  OFF 0001:0002           ; Equals 2
  7744. %@AS@%  4+2*3                   ; Equals 10 (0Ah)
  7745. %@AS@%  4+(2*3)                 ; Equals 10 (0Ah)
  7746. %@AS@%  (4+2)*3                 ; Equals 18 (12h)%@AE@%
  7747.  
  7748.  
  7749. %@2@%%@CR:C6A00080191 @%%@AB@%8.9  SYMDEB Commands%@AE@%%@EH@%%@NL@%
  7750.  
  7751. The first part of this chapter described how to use the Symbolic Debugger, a
  7752. debugger that helps you test executable files for Windows applications that
  7753. run in real mode.  %@NL@%
  7754.  
  7755. For more information about debugging Windows applications, see Chapter 7,
  7756. "Debugging in Protected Mode: CodeView for Windows," and Chapter 9,
  7757. "Advanced Debugging in Protected Mode: 80386 Debugger."  %@NL@%
  7758.  
  7759. This section provides information on %@AB@%SYMDEB%@AE@% commands. Most notably, it
  7760. provides the syntax for each command.  %@NL@%
  7761.  
  7762. %@2@%%@CR:C6A00080192 @%%@AB@%a ─ Assemble%@AE@%%@EH@%%@NL@%
  7763. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7764.  
  7765.  
  7766. %@3@%%@AB@%Syntax%@CR:C6A00080193 @%%@AE@%%@EH@%%@NL@%
  7767.  
  7768. %@AS@%  a«address»%@AE@%
  7769.  
  7770. This command assembles instruction mnemonics and places the resulting
  7771. instruction codes into memory at %@AI@%address%@AE@%. If no %@AI@%address%@AE@% is given, the
  7772. asssembly starts at the address given by the current values of the CS and IP
  7773. registers. To assemble a new instruction, type the desired mnemonic and
  7774. press ENTER. To terminate assembly, press ENTER. There are the following
  7775. assembly rules:%@CR:C6A00080194 @%%@NL@%
  7776.  
  7777.  
  7778.   ■   Use %@AB@%retf%@AE@% for the far return mnemonic.%@NL@%
  7779.  
  7780.   ■   Use %@AB@%movsb%@AE@% or %@AB@%movsw%@AE@% for string-manipulation mnemonics.%@NL@%
  7781.  
  7782.   ■   Use the %@AB@%near%@AE@% or %@AB@%far%@AE@% prefix with labels to override default distance.
  7783.       The %@AB@%ne%@AE@% abbreviation stands for %@AB@%near%@AE@%.%@NL@%
  7784.  
  7785.   ■   Use the %@AB@%word ptr%@AE@% or %@AB@%byte ptr%@AE@% prefix with destination operands to
  7786.       specify size. The %@AB@%wo%@AE@% abbreviation stands for %@AB@%word ptr%@AE@%; %@AB@%by%@AE@% for %@AB@%byte
  7787. %@AB@%      ptr%@AE@%.%@NL@%
  7788.  
  7789.   ■   Use square brackets around constant operands to specify absolute
  7790.       memory addresses. Constants without brackets are treated as constants.%@NL@%
  7791.  
  7792.   ■   Use the %@AB@%db%@AE@% mnemonics to assemble byte values or ASCII strings directly
  7793.       into memory.%@NL@%
  7794.  
  7795.   ■   Use 8087, 80287, or 80387 instructions only if your system has these
  7796.       math coprocessors.%@NL@%
  7797.  
  7798.  
  7799. The 80286 protected-mode mnemonics cannot be assembled.  %@NL@%
  7800.  
  7801. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7802. NOTE
  7803.  
  7804. %@AI@%Assembling over code can destroy checksum and cause a fatal exit.%@AE@%
  7805. ────────────────────────────────────────────────────────────────────────────%@NL@%
  7806.  
  7807.  
  7808. %@2@%%@CR:C6A00080195 @%%@AB@%ba ─ Breakpoint Address%@AE@%%@EH@%%@NL@%
  7809. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7810.  
  7811.  
  7812. %@3@%%@AB@%Syntax%@CR:C6A00080196 @%%@AE@%%@EH@%%@NL@%
  7813.  
  7814. %@AS@%  ba option size address «value» «command-string»%@AE@%
  7815.  
  7816. This command, available only on 80386 machines, sets an address breakpoint
  7817. at a given address. If your program accesses memory at this address, %@AB@%SYMDEB%@AE@%
  7818. will stop execution and display the current values of all registers and
  7819. flags.  %@NL@%
  7820.  
  7821. There are three types of breakpoints you can set with the %@AI@%option%@AE@% parameter.
  7822. If %@AB@%I%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a breakpoint when the CPU fetches an
  7823. instruction from the given %@AI@%address%@AE@%. If %@AB@%R%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a
  7824. breakpoint when the CPU reads or writes a byte, word, or doubleword to the
  7825. given %@AI@%address%@AE@%. If %@AB@%U%@AE@% is specified, %@AB@%SYMDEB%@AE@% takes a breakpoint when the CPU
  7826. writes a byte, word, or doubleword to the given address.  %@NL@%
  7827.  
  7828. The %@AI@%size%@AE@% parameter specifies the size of the data that %@AB@%SYMDEB%@AE@% expects to
  7829. find read or written at the given %@AI@%address%@AE@%. If %@AB@%B%@AE@% is specified (8-bit byte),
  7830. the command will break only at one address (for example, 0:10). If %@AB@%W%@AE@% is
  7831. specified (16-bit word), the command will break at one of two addresses
  7832. within that range (for example, 0:10 or 0:11 will cause a break within that
  7833. word). If %@AB@%D%@AE@% is specified (32-bit doubleword), the command will break at one
  7834. of four addresses within that range (for example, 0:08, 0:09, 0:10, or 0:11
  7835. will cause a break within that doubleword).  %@NL@%
  7836.  
  7837. The %@AI@%address%@AE@% parameter can specify any valid address. The address value is
  7838. rounded down if necessary to the nearest byte, word, or doubleword boundary
  7839. (for example, if a doubleword address of 0:14 was requested, the command
  7840. would access the address of the nearest doubleword boundary below the
  7841. address, in this case 0:12).  %@NL@%
  7842.  
  7843. The optional %@AI@%value%@AE@% parameter specifies the number of times the breakpoint is
  7844. to be ignored before being taken. It can be any 16-bit value.  %@NL@%
  7845.  
  7846. The %@AI@%command-string%@AE@% parameter specifies an optional list of commands to be
  7847. executed each time the breakpoint is taken. Each %@AB@%SYMDEB%@AE@% command in the list
  7848. can include parameters and is separated from the next command by a
  7849. semicolon.  %@NL@%
  7850.  
  7851. The %@AB@%bc%@AE@%, %@AB@%bd%@AE@%, %@AB@%be%@AE@%, and %@AB@%bl%@AE@% commands can all be used on these breakpoints.  %@NL@%
  7852.  
  7853.  
  7854. %@2@%%@CR:C6A00080197 @%%@AB@%bc ─ Breakpoint Clear%@AE@%%@EH@%%@NL@%
  7855. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7856.  
  7857.  
  7858. %@3@%%@AB@%Syntax%@CR:C6A00080198 @%%@CR:C6A00080199 @%%@AE@%%@EH@%%@NL@%
  7859.  
  7860. %@AS@%  bc id-list%@AE@%
  7861.  
  7862. This command permanently removes one or more previously set breakpoints. If
  7863. %@AI@%id-list%@AE@% is given, the command removes the breakpoints named in the list. The
  7864. %@AI@%id-list%@AE@% can be any combination of integer values from 0 to 9. If the
  7865. wildcard character (*) is given, the command removes all breakpoints.  %@NL@%
  7866.  
  7867.  
  7868. %@2@%%@CR:C6A00080200 @%%@AB@%bd ─ Breakpoint Disable%@AE@%%@EH@%%@NL@%
  7869. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7870.  
  7871.  
  7872. %@3@%%@AB@%Syntax%@CR:C6A00080201 @%%@AE@%%@EH@%%@NL@%
  7873.  
  7874. %@AS@%  bd id-list%@AE@%
  7875.  
  7876. This command disables, but does not delete, one or more breakpoints. If
  7877. %@AI@%id-list%@AE@% is given, the command disables the breakpoints named in the list.
  7878. The %@AI@%id-list%@AE@% can be any combination of integer values from 0 to 9. If the
  7879. wildcard character (*) is given, the command disables all breakpoints.%@CR:C6A00080202 @%%@NL@%
  7880.  
  7881.  
  7882. %@2@%%@CR:C6A00080203 @%%@AB@%be ─ Breakpoint Enable%@AE@%%@EH@%%@NL@%
  7883. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7884.  
  7885.  
  7886. %@3@%%@AB@%Syntax%@CR:C6A00080204 @%%@CR:C6A00080205 @%%@AE@%%@EH@%%@NL@%
  7887.  
  7888. %@AS@%  be id-list%@AE@%
  7889.  
  7890. This command restores one or more breakpoints that were temporarily disabled
  7891. by a %@AB@%bd%@AE@% command. If %@AI@%id-list%@AE@% is given, the command enables the breakpoints
  7892. named in the list. The %@AI@%id-list%@AE@% can be any combination of integer values from
  7893. 0 to 9. If the wildcard character (*) is given, the command enables all
  7894. breakpoints.  %@NL@%
  7895.  
  7896.  
  7897. %@2@%%@CR:C6A00080206 @%%@AB@%bl ─ Breakpoint List%@AE@%%@EH@%%@NL@%
  7898. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7899.  
  7900.  
  7901. %@3@%%@AB@%Syntax%@CR:C6A00080207 @%%@AE@%%@EH@%%@NL@%
  7902.  
  7903. %@AS@%  bl%@AE@%
  7904.  
  7905. This command lists current information about all breakpoints. The command
  7906. displays the breakpoint number, the enabled status, the address of the
  7907. breakpoint, the number of passes remaining, and the initial number of passes
  7908. (in parentheses). The enabled status can be enabled (e), disabled (d), or
  7909. virtual (v). A virtual breakpoint is a breakpoint set at a symbol whose .EXE
  7910. file has not yet been loaded.%@CR:C6A00080208 @%%@NL@%
  7911.  
  7912.  
  7913. %@2@%%@CR:C6A00080209 @%%@AB@%bp ─ Breakpoint Set%@AE@%%@EH@%%@NL@%
  7914. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7915.  
  7916.  
  7917. %@3@%%@AB@%Syntax%@CR:C6A00080210 @%%@CR:C6A00080211 @%%@CR:C6A00080212 @%%@AE@%%@EH@%%@NL@%
  7918.  
  7919. %@AS@%  bp«id» address «value» «command-string»%@AE@%
  7920.  
  7921. This command creates a "sticky" breakpoint at the given %@AI@%address%@AE@%. Sticky
  7922. breakpoints stop execution and display the current values of all registers
  7923. and flags. Sticky breakpoints remain in the program until removed using the
  7924. %@AB@%bc%@AE@% command, or temporarily disabled using the %@AB@%bd%@AE@% command. The Symbolic
  7925. Debugger allows up to 10 sticky breakpoints (0 through 9). The optional %@AI@%id%@AE@%
  7926. parameter specifies which breakpoint is to be created. If no %@AI@%id%@AE@% is given,
  7927. the first available breakpoint number is used. The %@AI@%address%@AE@% parameter can be
  7928. any valid instruction address (it must be the first byte of an instruction).
  7929. The optional %@AI@%value%@AE@% parameter specifies the number of times the breakpoint is
  7930. to be ignored before being taken. It can be any 16-bit value. The optional
  7931. %@AI@%command-string%@AE@% parameter specifies a list of commands to be executed each
  7932. time the breakpoint is taken. Each %@AB@%SYMDEB%@AE@% command in the list can include
  7933. parameters and is separated from the next command by a semicolon (;).%@CR:C6A00080213 @%%@NL@%
  7934.  
  7935.  
  7936. %@2@%%@CR:C6A00080214 @%%@AB@%c ─ Compare%@AE@%%@EH@%%@NL@%
  7937. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7938.  
  7939.  
  7940. %@3@%%@AB@%Syntax%@CR:C6A00080215 @%%@CR:C6A00080216 @%%@AE@%%@EH@%%@NL@%
  7941.  
  7942. %@AS@%  c range address%@AE@%
  7943.  
  7944. This command compares the bytes in the memory locations specified by %@AI@%range%@AE@%
  7945. with the corresponding bytes in the memory locations beginning at %@AI@%address%@AE@%.
  7946. If all corresponding bytes match, the command displays its prompt and waits
  7947. for the next command. If one or more pairs of corresponding bytes do not
  7948. match, the command displays each pair of mismatched bytes.  %@NL@%
  7949.  
  7950.  
  7951. %@2@%%@CR:C6A00080217 @%%@AB@%d ─ Dump%@AE@%%@EH@%%@NL@%
  7952. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7953.  
  7954. %@CR:C6A00080218 @%%@CR:C6A00080219 @%Syntax  %@NL@%
  7955.  
  7956. %@AS@%  d «range»%@AE@%
  7957.  
  7958. This command displays the contents of memory in the given %@AI@%range%@AE@%. The command
  7959. displays data in the same format as the most recent dump command. (Dump
  7960. 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
  7961. is given and no previous dump command has been used, the command displays
  7962. bytes starting from DS:IP.  %@NL@%
  7963.  
  7964.  
  7965. %@2@%%@CR:C6A00080220 @%%@AB@%da ─ Dump ASCII%@AE@%%@EH@%%@NL@%
  7966. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7967.  
  7968.  
  7969. %@3@%%@AB@%Syntax%@CR:C6A00080221 @% %@CR:C6A00080222 @%%@CR:C6A00080223 @%%@AE@%%@EH@%%@NL@%
  7970.  
  7971. %@AS@%  da «range»%@AE@%
  7972.  
  7973. This command displays the ASCII characters in the given %@AI@%range%@AE@%. Each line
  7974. displays up to 48 characters. The display continues until the first null
  7975. byte or until all characters in the range have been shown. Nonprintable
  7976. characters, such as carriage returns and line feeds, are displayed as
  7977. periods (.).  %@NL@%
  7978.  
  7979.  
  7980. %@2@%%@CR:C6A00080224 @%%@AB@%db ─ Dump Bytes%@AE@%%@EH@%%@NL@%
  7981. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7982.  
  7983.  
  7984. %@3@%%@AB@%Syntax%@CR:C6A00080225 @% %@CR:C6A00080226 @%%@CR:C6A00080227 @%%@AE@%%@EH@%%@NL@%
  7985.  
  7986. %@AS@%  db «range»%@AE@%
  7987.  
  7988. This command displays the hexadecimal and ASCII values of the bytes in the
  7989. given %@AI@%range%@AE@%. Each display line shows the address of the first byte in the
  7990. line, followed by up to 16 hexadecimal byte values. The byte values are
  7991. immediately followed by the corresponding ASCII values. The eighth and ninth
  7992. hexadecimal values are separated by a hyphen (-). Nonprintable ASCII values
  7993. are displayed as periods (.).%@CR:C6A00080228 @%%@CR:C6A00080229 @%%@NL@%
  7994.  
  7995.  
  7996. %@2@%%@CR:C6A00080230 @%%@AB@%dd ─ Dump Doublewords%@AE@%%@EH@%%@NL@%
  7997. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  7998.  
  7999.  
  8000. %@3@%%@AB@%Syntax%@CR:C6A00080231 @%%@CR:C6A00080232 @%%@CR:C6A00080233 @%%@AE@%%@EH@%%@NL@%
  8001.  
  8002. %@AS@%  dd «range»%@AE@%
  8003.  
  8004. This command displays the hexadecimal values of the doublewords (4-byte
  8005. values) in the given %@AI@%range%@AE@%. Each display line shows the address of the first
  8006. doubleword in the line and up to four hexadecimal doubleword values.  %@NL@%
  8007.  
  8008.  
  8009. %@2@%%@CR:C6A00080234 @%%@AB@%df ─ Display Global Free List%@AE@%%@EH@%%@NL@%
  8010. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8011.  
  8012.  
  8013. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8014.  
  8015. %@AS@%  df%@AE@%
  8016.  
  8017. This command displays a list of the free global memory objects in the global
  8018. heap. The list has the following form:%@CR:C6A00080235 @%%@CR:C6A00080236 @%%@NL@%
  8019.  
  8020. %@AS@%  segment-address: size owner%@AE@%
  8021.  
  8022. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  8023. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  8024. (multiples of 16 bytes) of the object.  %@NL@%
  8025.  
  8026. The %@AI@%owner%@AE@% field always specifies that the module is free.  %@NL@%
  8027.  
  8028.  
  8029. %@2@%%@CR:C6A00080237 @%%@AB@%dg ─ Display Global Heap%@AE@%%@EH@%%@NL@%
  8030. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8031.  
  8032.  
  8033. %@3@%%@AB@%Syntax%@CR:C6A00080238 @%%@AE@%%@EH@%%@NL@%
  8034.  
  8035. %@AS@%  dg%@AE@%
  8036.  
  8037. This command displays a list of the global memory objects in the global
  8038. heap. The list has the following form:%@CR:C6A00080239 @%%@NL@%
  8039.  
  8040. %@AS@%  segment-address: size segment-type owner «handle flags chain»%@AE@%
  8041.  
  8042. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  8043. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  8044. (multiples of 16 bytes) of the object. The %@AI@%segment-type%@AE@% field specifies the
  8045. type of object. The type can be any one of the following:  %@NL@%
  8046.  
  8047. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  8048. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8049. %@AB@%CODE%@AE@%                              Segment contains program code.
  8050.  
  8051. %@AB@%DATA%@AE@%                              Segment contains program data and 
  8052.                                   possible stack and local heap data.
  8053.  
  8054. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  8055.                                   objects ready for allocation by an 
  8056.                                   application.
  8057.  
  8058. %@AB@%PRIV%@AE@%                              Segment contains private data.
  8059.  
  8060. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  8061.                                   the global heap.
  8062.  
  8063. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  8064. allocated the memory object. The name "pdb" is used for memory objects that
  8065. represent program descriptor blocks. These blocks contain execution
  8066. information about applications.%@CR:C6A00080240 @%%@NL@%
  8067.  
  8068. The %@AI@%handle%@AE@% field specifies the handle of the global memory object. If %@AB@%SYMDEB%@AE@%
  8069. displays no handle, the segment is fixed.  %@NL@%
  8070.  
  8071. The %@AI@%flags%@AE@% field specifies the following:  %@NL@%
  8072.  
  8073. %@AB@%Flag%@AE@%                              %@AB@%Meaning%@AE@%
  8074. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8075. D                                 The segment is moveable and discardable.
  8076.  
  8077. L                                 The segment is locked. If the segment is
  8078.                                   locked, the lock count appears to the 
  8079.                                   right of the flag.
  8080.  
  8081. If %@AB@%SYMDEB%@AE@% displays a handle, but no flag, the segment is moveable but
  8082. nondiscardable.  %@NL@%
  8083.  
  8084. The chain field specifies the previous and next segment addresses in the LRU
  8085. list. %@AB@%SYMDEB%@AE@% displays the addresses only if the segment is moveable and
  8086. discardable (the D flag).  %@NL@%
  8087.  
  8088.  
  8089. %@2@%%@CR:C6A00080241 @%%@AB@%dh ─ Display Local Heap%@AE@%%@EH@%%@NL@%
  8090. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8091.  
  8092.  
  8093. %@3@%%@AB@%Syntax%@CR:C6A00080242 @%%@AE@%%@EH@%%@NL@%
  8094.  
  8095. %@AS@%  dh%@AE@%
  8096.  
  8097. This command displays a list of the local memory objects in the local heap
  8098. (if any) belonging to the current data segment. The command uses the current
  8099. value of the DS register to locate the data segment and check for a local
  8100. heap. The list of memory objects has the following form:%@CR:C6A00080243 @%%@NL@%
  8101.  
  8102. %@AS@%  offset: size { BUSY | FREE }%@AE@%
  8103.  
  8104. The %@AI@%offset%@AE@% field specifies the address offset from the beginning of the data
  8105. segment to the local memory object. The %@AI@%size%@AE@% field specifies the size of the
  8106. memory object in bytes. If %@AB@%BUSY%@AE@% is given, the object has been allocated and
  8107. is currently in use. If %@AB@%FREE%@AE@% is given, the object is in the pool of free
  8108. objects ready to be allocated by the application. A special memory object,
  8109. %@AB@%SENTINAL%@AE@%, may also be displayed.  %@NL@%
  8110.  
  8111.  
  8112. %@2@%%@CR:C6A00080244 @%%@AB@%dl ─ Dump Long Reals%@AE@%%@EH@%%@NL@%
  8113. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8114.  
  8115.  
  8116. %@3@%%@AB@%Syntax%@CR:C6A00080245 @%%@AE@%%@EH@%%@NL@%
  8117.  
  8118. %@AS@%  dl «range»%@AE@%
  8119.  
  8120. This command displays the hexadecimal and decimal values of the long
  8121. (8-byte) floating-point numbers within the given %@AI@%range%@AE@%. Each display line
  8122. shows the address of the floating-point number, the hexadecimal values of
  8123. the bytes in the number, and the decimal value of the number.%@CR:C6A00080246 @%%@CR:C6A00080247 @%%@NL@%
  8124.  
  8125.  
  8126. %@2@%%@CR:C6A00080248 @%%@AB@%dm ─ Display Global Module List%@AE@%%@EH@%%@NL@%
  8127. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8128.  
  8129.  
  8130. %@3@%%@AB@%Syntax%@CR:C6A00080249 @%%@AE@%%@EH@%%@NL@%
  8131.  
  8132. %@AS@%  dm%@AE@%
  8133.  
  8134. This command displays a list of the global modules in the global heap. The
  8135. list has the following form:%@CR:C6A00080250 @%%@NL@%
  8136.  
  8137. %@AS@%  module-handle module-type module-name file-name%@AE@%
  8138.  
  8139. The %@AI@%module-handle%@AE@% field specifies the handle of the module. The %@AI@%module-type%@AE@%
  8140. field specifies either a dynamic-link library (DLL) or the name of the
  8141. application you are debugging. The %@AI@%module-name%@AE@% field specifies the name of
  8142. the module. The %@AI@%file-name%@AE@% field specifies the name of the file from which
  8143. you loaded the application.  %@NL@%
  8144.  
  8145.  
  8146. %@2@%%@CR:C6A00080251 @%%@AB@%dq ─ Dump Task Queue%@AE@%%@EH@%%@NL@%
  8147. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8148.  
  8149.  
  8150. %@3@%%@AB@%Syntax%@CR:C6A00080252 @%%@CR:C6A00080253 @%%@AE@%%@EH@%%@NL@%
  8151.  
  8152. %@AS@%  dq%@AE@%
  8153.  
  8154. This command displays a list containing information about the various task
  8155. queues supported by the system. The list has the following form:  %@NL@%
  8156.  
  8157. %@AS@%  task-descriptor-block  stack-segment:stack-pointer number-of-events
  8158. %@AS@%priority internal-messaging-information module%@AE@%
  8159.  
  8160. The %@AI@%task-descriptor-block%@AE@% field specifies the selector or segment address.
  8161. The task descriptor block is identical to the "pdb."%@CR:C6A00080254 @%%@CR:C6A00080255 @%The
  8162. %@AI@%stack-segment:stack-pointer%@AE@% field specifies the stack segment and pointer.
  8163. The %@AI@%number-of-events%@AE@% field specifies the number of events waiting for the
  8164. segment. The %@AI@%priority%@AE@% field specifies the priority of the segment. The
  8165. %@AI@%internal-messaging-information%@AE@% field specifies information about internal
  8166. messages. The %@AI@%module%@AE@% field specifies the module name.  %@NL@%
  8167.  
  8168.  
  8169. %@2@%%@CR:C6A00080256 @%%@AB@%ds ─ Dump Short Reals%@AE@%%@EH@%%@NL@%
  8170. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8171.  
  8172.  
  8173. %@3@%%@AB@%Syntax%@CR:C6A00080257 @%%@AE@%%@EH@%%@NL@%
  8174.  
  8175. %@AS@%  ds «range»%@AE@%
  8176.  
  8177. This command displays the hexadecimal and decimal values of the short
  8178. (4-byte) floating-point numbers in the given %@AI@%range%@AE@%. Each display line shows
  8179. the address of the floating-point number, the hexadecimal values of the
  8180. bytes in the number, and the decimal value of the number.%@CR:C6A00080258 @%%@CR:C6A00080259 @%%@NL@%
  8181.  
  8182.  
  8183. %@2@%%@CR:C6A00080260 @%%@AB@%dt ─ Dump Ten-Byte Reals%@AE@%%@EH@%%@NL@%
  8184. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8185.  
  8186.  
  8187. %@3@%%@AB@%Syntax%@CR:C6A00080261 @%%@CR:C6A00080262 @%%@AE@%%@EH@%%@NL@%
  8188.  
  8189. %@AS@%  dt «range»%@AE@%
  8190.  
  8191. This command displays the hexadecimal and decimal values of the 10-byte
  8192. floating-point numbers in the given %@AI@%range%@AE@%. Each display line shows the
  8193. address of the floating-point number, the hexadecimal values of the bytes in
  8194. the number, and the decimal value of the number.  %@NL@%
  8195.  
  8196.  
  8197. %@2@%%@CR:C6A00080263 @%%@AB@%du ─ Display Global LRU List%@AE@%%@EH@%%@NL@%
  8198. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8199.  
  8200.  
  8201. %@3@%%@AB@%Syntax%@CR:C6A00080264 @%%@CR:C6A00080265 @%%@AE@%%@EH@%%@NL@%
  8202.  
  8203. %@AS@%  du%@AE@%
  8204.  
  8205. This command displays a list of the least-recently-used (LRU) global memory
  8206. objects in the global heap. The list has the following form:  %@NL@%
  8207.  
  8208. %@AS@%  segment-address: size segment-type owner «handle flags chain»%@AE@%
  8209.  
  8210. The %@AI@%segment-address%@AE@% field specifies the segment address of the first byte of
  8211. the memory object. The %@AI@%size%@AE@% field specifies the size in paragraphs
  8212. (multiples of 16 bytes) of the object. The %@AI@%segment-type%@AE@% field specifies the
  8213. type of object. The type can be any one of the following:  %@NL@%
  8214.  
  8215. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  8216. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8217. %@AB@%CODE%@AE@%                              Segment contains program code.
  8218.  
  8219. %@AB@%DATA%@AE@%                              Segment contains program data and 
  8220.                                   possible stack and local heap data.
  8221.  
  8222. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  8223.                                   objects ready for allocation by an 
  8224.                                   application.
  8225.  
  8226. %@AB@%PRIV%@AE@%                              Segment contains private data.
  8227.  
  8228. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  8229.                                   the global heap.
  8230.  
  8231. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  8232. allocated the memory object. The name "pdb" is used for memory objects that
  8233. represent program descriptor blocks. These blocks contain execution
  8234. information about applications.%@CR:C6A00080266 @%%@NL@%
  8235.  
  8236. The %@AI@%handle%@AE@% field specifies the handle of the global memory object.  %@NL@%
  8237.  
  8238. The %@AI@%flags%@AE@% field specifies D, which means the segment is moveable and
  8239. discardable.  %@NL@%
  8240.  
  8241. The %@AI@%chain%@AE@% field specifies the previous and next segment addresses in the LRU
  8242. list.  %@NL@%
  8243.  
  8244.  
  8245. %@2@%%@CR:C6A00080267 @%%@AB@%dw ─ Dump Words%@AE@%%@EH@%%@NL@%
  8246. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8247.  
  8248.  
  8249. %@3@%%@AB@%Syntax%@CR:C6A00080268 @%%@AE@%%@EH@%%@NL@%
  8250.  
  8251. %@AS@%  dw «range»%@AE@%
  8252.  
  8253. This command displays the hexadecimal values of the words (2-byte values) in
  8254. the given %@AI@%range%@AE@%. Each display line shows the address of the first word in
  8255. the line and up to eight hexadecimal word values.%@CR:C6A00080269 @%%@NL@%
  8256.  
  8257.  
  8258. %@2@%%@CR:C6A00080270 @%%@AB@%e ─ Enter%@AE@%%@EH@%%@NL@%
  8259. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8260.  
  8261.  
  8262. %@3@%%@AB@%Syntax%@CR:C6A00080271 @%%@AE@%%@EH@%%@NL@%
  8263.  
  8264. %@AS@%  e address «list»%@AE@%
  8265.  
  8266. This command enters one or more values into memory. The size of the value
  8267. entered depends on the most recently used Enter command. (Enter commands are
  8268. %@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
  8269. given, the command displays the value at %@AI@%address%@AE@% and prompts for a new
  8270. value. If %@AI@%list%@AE@% is given, the command replaces the value at %@AI@%address%@AE@% and at
  8271. each subsequent address until all values in the list have been used.  %@NL@%
  8272.  
  8273.  
  8274. %@2@%%@CR:C6A00080272 @%%@AB@%ea ─ Enter Address%@AE@%%@EH@%%@NL@%
  8275. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8276.  
  8277.  
  8278. %@3@%%@AB@%Syntax%@CR:C6A00080273 @%%@CR:C6A00080274 @%%@CR:C6A00080275 @%%@AE@%%@EH@%%@NL@%
  8279.  
  8280. %@AS@%  ea address «list»%@AE@%
  8281.  
  8282. This command enters an ASCII string into memory. If no %@AI@%list%@AE@% is given, the
  8283. command displays the byte at %@AI@%address%@AE@% and prompts for a replacement. If %@AI@%list%@AE@%
  8284. is given, the command replaces the bytes at %@AI@%address%@AE@%, then displays the next
  8285. byte and prompts for a replacement.  %@NL@%
  8286.  
  8287.  
  8288. %@2@%%@CR:C6A00080276 @%%@AB@%eb ─ Enter Bytes%@AE@%%@EH@%%@NL@%
  8289. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8290.  
  8291.  
  8292. %@3@%%@AB@%Syntax%@CR:C6A00080277 @%%@AE@%%@EH@%%@NL@%
  8293.  
  8294. %@AS@%  eb address «list»%@AE@%
  8295.  
  8296. This command enters one or more byte values into memory. If %@AI@%list%@AE@% is given,
  8297. the command replaces the byte at %@AI@%address%@AE@% and bytes at each subsequent
  8298. address until all values in the list have been used. If no %@AI@%list%@AE@% is given,
  8299. the command displays the byte at %@AI@%address%@AE@% and prompts for a new value. To
  8300. skip to the next byte, enter a new value or press the SPACEBAR. To move back
  8301. to the previous byte, type a hyphen (-). To exit from the command, press
  8302. ENTER.  %@NL@%
  8303.  
  8304.  
  8305. %@2@%%@CR:C6A00080278 @%%@AB@%ed ─ Enter Doublewords%@AE@%%@EH@%%@NL@%
  8306. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8307.  
  8308.  
  8309. %@3@%%@AB@%Syntax%@CR:C6A00080279 @%%@AE@%%@EH@%%@NL@%
  8310.  
  8311. %@AS@%  ed address «value»%@AE@%
  8312.  
  8313. This command enters a doubleword value into memory. If no %@AI@%value%@AE@% is given,
  8314. the command displays the doubleword at %@AI@%address%@AE@% and prompts for a
  8315. replacement. If %@AI@%value%@AE@% is given, the  command replaces the doubleword at
  8316. %@AI@%address%@AE@%, then displays the next doubleword and prompts for a replacement.
  8317. Doublewords must be typed as two words separated by a colon.%@CR:C6A00080280 @%%@CR:C6A00080281 @%%@CR:C6A00080282 @%%@NL@%
  8318.  
  8319.  
  8320. %@2@%%@CR:C6A00080283 @%%@AB@%el ─ Enter Long Reals%@AE@%%@EH@%%@NL@%
  8321. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8322.  
  8323.  
  8324. %@3@%%@AB@%Syntax%@CR:C6A00080284 @%%@AE@%%@EH@%%@NL@%
  8325.  
  8326. %@AS@%  el address «value»%@AE@%
  8327.  
  8328. This command enters a long-real value into memory. If no %@AI@%value%@AE@% is given, the
  8329. command displays the long-real value at %@AI@%address%@AE@% and prompts for a
  8330. replacement. If %@AI@%value%@AE@% is given, the command replaces the long-real value at
  8331. %@AI@%address%@AE@%, then displays the next long-real value and prompts for a
  8332. replacement.%@CR:C6A00080285 @%%@NL@%
  8333.  
  8334.  
  8335. %@2@%%@CR:C6A00080286 @%%@AB@%es ─ Enter Short Reals%@AE@%%@EH@%%@NL@%
  8336. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8337.  
  8338.  
  8339. %@3@%%@AB@%Syntax%@CR:C6A00080287 @%%@AE@%%@EH@%%@NL@%
  8340.  
  8341. %@AS@%  es address «value»%@AE@%
  8342.  
  8343. This command enters a short-real value into memory. If no %@AI@%value%@AE@% is given,
  8344. the command displays the short-real value at %@AI@%address%@AE@% and prompts for a
  8345. replacement. If %@AI@%value%@AE@% is given, the command replaces the short-real value at
  8346. %@AI@%address%@AE@%, then displays the next short-real value and prompts for a
  8347. replacement.%@CR:C6A00080288 @%%@NL@%
  8348.  
  8349.  
  8350. %@2@%%@CR:C6A00080289 @%%@AB@%et ─ Enter Ten-Byte Reals%@AE@%%@EH@%%@NL@%
  8351. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8352.  
  8353.  
  8354. %@3@%%@AB@%Syntax%@CR:C6A00080290 @%%@AE@%%@EH@%%@NL@%
  8355.  
  8356. %@AS@%  et address «value»%@AE@%
  8357.  
  8358. This command enters a 10-byte real value into memory. If no %@AI@%value%@AE@% is given,
  8359. the command displays the 10-byte real value at %@AI@%address%@AE@% and prompts for a
  8360. replacement. If %@AI@%value%@AE@% is given, the command replaces the 10-byte real value
  8361. at %@AI@%address%@AE@%, then displays the next 10-byte real value and prompts for a
  8362. replacement.  %@NL@%
  8363.  
  8364.  
  8365. %@2@%%@CR:C6A00080291 @%%@AB@%ew ─ Enter Words%@AE@%%@EH@%%@NL@%
  8366. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8367.  
  8368.  
  8369. %@3@%%@AB@%Syntax%@CR:C6A00080292 @%%@AE@%%@EH@%%@NL@%
  8370.  
  8371. %@AS@%  ew address «value»%@AE@%
  8372.  
  8373. This command enters a word value into memory. If no %@AI@%value%@AE@% is given, the
  8374. command displays the word at %@AI@%address%@AE@% and prompts for a replacement. If %@AI@%value%@AE@%
  8375. is given, the command replaces the word at %@AI@%address%@AE@%, then displays the next
  8376. word and prompts for a replacement.  %@NL@%
  8377.  
  8378.  
  8379. %@2@%%@CR:C6A00080293 @%%@AB@%f ─ Fill%@AE@%%@EH@%%@NL@%
  8380. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8381.  
  8382.  
  8383. %@3@%%@AB@%Syntax%@CR:C6A00080294 @%%@AE@%%@EH@%%@NL@%
  8384.  
  8385. %@AS@%  f range list%@AE@%
  8386.  
  8387. This command fills the addresses in the given %@AI@%range%@AE@% with the values in %@AI@%list%@AE@%.
  8388. If %@AI@%range%@AE@% specifies more bytes than the number of values in the list, the
  8389. list is repeated until all bytes in the range are filled. If %@AI@%list%@AE@% has more
  8390. values than the number of bytes in the range, the command ignores any extra
  8391. values.  %@NL@%
  8392.  
  8393.  
  8394. %@2@%%@CR:C6A00080295 @%%@AB@%g ─ Go%@AE@%%@EH@%%@NL@%
  8395. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8396.  
  8397.  
  8398. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8399.  
  8400. %@AS@%  g «= startaddress» «breakaddress»...%@AE@%
  8401.  
  8402. This command passes execution control to the program at the given
  8403. %@AI@%startaddress%@AE@%. Execution continues to the end of the program or until %@AI@%break
  8404. %@AI@%address%@AE@% is encountered. The program also stops at any breakpoints set using
  8405. the %@AB@%bp%@AE@% command. If no %@AI@%startaddress%@AE@% is given, the command passes execution to
  8406. the address specified by the current values of the CS and IP registers. If
  8407. %@AI@%breakaddress%@AE@% is given, it must specify an instruction address (that is, the
  8408. address must contain the first byte of an instruction). Up to 10 break
  8409. addresses, in any order, can be given at one time.%@CR:C6A00080296 @%%@NL@%
  8410.  
  8411.  
  8412. %@2@%%@CR:C6A00080297 @%%@AB@%h ─ Hex%@AE@%%@EH@%%@NL@%
  8413. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8414.  
  8415.  
  8416. %@3@%%@AB@%Syntax%@CR:C6A00080298 @%%@AE@%%@EH@%%@NL@%
  8417.  
  8418. %@AS@%  h value1 value2%@AE@%
  8419.  
  8420. This command displays the sum and difference of two hexadecimal numbers,
  8421. %@AI@%value1%@AE@% and %@AI@%value2%@AE@%.  %@NL@%
  8422.  
  8423.  
  8424. %@2@%%@CR:C6A00080299 @%%@AB@%i ─ Input%@AE@%%@EH@%%@NL@%
  8425. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8426.  
  8427.  
  8428. %@3@%%@AB@%Syntax%@CR:C6A00080300 @%%@CR:C6A00080301 @%%@AE@%%@EH@%%@NL@%
  8429.  
  8430. %@AS@%  i value%@AE@%
  8431.  
  8432. This command reads and displays one byte from the input port specified by
  8433. %@AI@%value%@AE@%. The %@AI@%value%@AE@% parameter can specify any 16-bit port address.  %@NL@%
  8434.  
  8435.  
  8436. %@2@%%@CR:C6A00080302 @%%@AB@%k ─ Backtrace Stack%@AE@%%@EH@%%@NL@%
  8437. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8438.  
  8439.  
  8440. %@3@%%@AB@%Syntax%@CR:C6A00080303 @%%@AE@%%@EH@%%@NL@%
  8441.  
  8442. %@AS@%  k «value»%@AE@%
  8443.  
  8444. This command displays the current stack frame. Each line shows the name of a
  8445. procedure, its arguments, and the address of the statement that called it.
  8446. The command displays two 2-byte arguments by default. If %@AI@%value%@AE@% is given, the
  8447. command displays that many 2-byte arguments. Using the %@AB@%k%@AE@% command at the
  8448. beginning of a function (before the function prolog has been executed) will
  8449. give incorrect results. The command uses the BP register to compute the
  8450. current backtrace, and this register is not correctly set for a function
  8451. until its prolog has been executed.%@CR:C6A00080304 @%%@NL@%
  8452.  
  8453.  
  8454. %@2@%%@CR:C6A00080305 @%%@AB@%kt ─ Backtrace Task Stack%@AE@%%@EH@%%@NL@%
  8455. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8456.  
  8457.  
  8458. %@3@%%@AB@%Syntax%@CR:C6A00080306 @%%@CR:C6A00080307 @%%@AE@%%@EH@%%@NL@%
  8459.  
  8460. %@AS@%  kt pdb «value»%@AE@%
  8461.  
  8462. This command displays the stack frame of the program specified by %@AI@%pdb%@AE@%. Each
  8463. line shows the name of a procedure, its arguments, and the address of the
  8464. statement that called it. The command displays two 2-byte arguments by
  8465. default. If %@AI@%value%@AE@% is given, the command displays that many 2-byte arguments.
  8466. The %@AI@%pdb%@AE@% parameter must specify the segment address of the program descriptor
  8467. block for the task to be traced.  %@NL@%
  8468.  
  8469. To obtain the %@AI@%pdb%@AE@% value, use the %@AB@%dq %@AE@%(Dump Task Queue) command.%@CR:C6A00080308 @%%@NL@%
  8470.  
  8471.  
  8472. %@2@%%@CR:C6A00080309 @%%@AB@%kv ─ Verbose Backtrace Stack%@AE@%%@EH@%%@NL@%
  8473. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8474.  
  8475.  
  8476. %@3@%%@AB@%Syntax%@CR:C6A00080310 @%%@AE@%%@EH@%%@NL@%
  8477.  
  8478. %@AS@%  kv «value»%@AE@%
  8479.  
  8480. This command displays information that the %@AB@%k%@AE@% (Backtrace Stack) command
  8481. provides, plus information about stack location and frame pointer values for
  8482. each frame.  %@NL@%
  8483.  
  8484.  
  8485. %@2@%%@CR:C6A00080311 @%%@AB@%l ─ Load%@AE@%%@EH@%%@NL@%
  8486. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8487.  
  8488.  
  8489. %@3@%%@AB@%Syntax%@CR:C6A00080312 @%%@CR:C6A00080313 @%%@AE@%%@EH@%%@NL@%
  8490.  
  8491. %@AS@%  l «address «drive record count» »%@AE@%
  8492.  
  8493. This command copies the contents of a named file or the contents of a given
  8494. number of logical disk records into memory. The contents are copied to
  8495. %@AI@%address%@AE@% or to a default address, and the BX:CX register pair is set to the
  8496. number of bytes loaded.  %@NL@%
  8497.  
  8498. To load a file, set the filename using the %@AB@%n%@AE@% command (otherwise, %@AB@%SYMDEB%@AE@% uses
  8499. whatever name is currently at location DS:5C). If %@AI@%address%@AE@% is not given,
  8500. %@AB@%SYMDEB%@AE@% copies bytes to CS:100. If the named file has an .EXE extension, the
  8501. %@AB@%l%@AE@% command adjusts the load address to the address given in the .EXE file
  8502. header. The command strips any header information from an .EXE file before
  8503. loading. If the named file has an .HEX extension, the %@AB@%l%@AE@% command adds that
  8504. file's start address to %@AI@%address%@AE@% before loading the file.  %@NL@%
  8505.  
  8506. To load logical records from a disk, set %@AI@%drive%@AE@% to 0 (drive A), 1 (drive B),
  8507. or 2 (drive C). Set %@AI@%record%@AE@% to the first logical record to be read (any one-
  8508. to four-digit hexadecimal number). Set %@AI@%count%@AE@% to the number of records to
  8509. read (any one- to four-digit hexadecimal number).%@CR:C6A00080314 @%%@CR:C6A00080315 @%%@CR:C6A00080316 @%%@CR:C6A00080317 @%%@NL@%
  8510.  
  8511.  
  8512. %@2@%%@CR:C6A00080318 @%%@AB@%m ─ Move%@AE@%%@EH@%%@NL@%
  8513. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8514.  
  8515.  
  8516. %@3@%%@AB@%Syntax%@CR:C6A00080319 @%%@CR:C6A00080320 @%%@AE@%%@EH@%%@NL@%
  8517.  
  8518. %@AS@%  m range address%@AE@%
  8519.  
  8520. This command moves the block of memory specified by %@AI@%range%@AE@% to the location
  8521. starting at %@AI@%address%@AE@%. All moves are guaranteed to be performed without data
  8522. loss.  %@NL@%
  8523.  
  8524.  
  8525. %@2@%%@CR:C6A00080321 @%%@AB@%m%@AI@%id%@AE@%%@AB@%%@AE@%─ Macro%@AE@%%@EH@%%@NL@%
  8526. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8527.  
  8528.  
  8529. %@3@%%@AB@%Syntax%@CR:C6A00080322 @%%@CR:C6A00080323 @%%@CR:C6A00080324 @% %@CR:C6A00080325 @%%@AE@%%@EH@%%@NL@%
  8530.  
  8531. %@AS@%  mid«= command-string»%@AE@%
  8532.  
  8533. This command defines or executes a %@AB@%SYMDEB%@AE@% command macro. The %@AI@%id%@AE@% parameter
  8534. identifies the macro to be defined or executed. There are 10 macros,
  8535. numbered 0 through 9. If %@AI@%command-string%@AE@% is specified, the command assigns
  8536. the %@AB@%SYMDEB%@AE@% commands given in the string to the macro. If no string is given,
  8537. the command executes the commands currently assigned to the macro. Macros
  8538. are initially empty unless the %@AB@%/@%@AE@% option is used when the Symbolic Debugger
  8539. is started. This option reads a set of macro definitions from a specified
  8540. file.  %@NL@%
  8541.  
  8542.  
  8543. %@2@%%@CR:C6A00080326 @%%@AB@%n ─ Name%@AE@%%@EH@%%@NL@%
  8544. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8545.  
  8546.  
  8547. %@3@%%@AB@%Syntax%@CR:C6A00080327 @%%@CR:C6A00080328 @%%@CR:C6A00080329 @%%@CR:C6A00080330 @%%@AE@%%@EH@%%@NL@%
  8548.  
  8549. %@AS@%  n «filename» «arguments»%@AE@%
  8550.  
  8551. This command sets the filename for subsequent %@AB@%l%@AE@% and %@AB@%w%@AE@% commands, or sets
  8552. program arguments for subsequent execution of a loaded program. If %@AI@%filename%@AE@%
  8553. is given, all subsequent %@AB@%l%@AE@% and %@AB@%w%@AE@% commands will use this name when accessing
  8554. disk files. If %@AI@%arguments%@AE@% is given, the command copies all arguments,
  8555. including spaces, to the memory location starting at DS:81 and sets the byte
  8556. at DS:80 to a count of the total number of characters copied. If the first
  8557. two arguments are also filenames, the command creates file control blocks at
  8558. addresses DS:5C and DS:6C and copies the names (in proper format) to these
  8559. blocks.  %@NL@%
  8560.  
  8561.  
  8562. %@2@%%@CR:C6A00080331 @%%@AB@%o ─ Output%@AE@%%@EH@%%@NL@%
  8563. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8564.  
  8565.  
  8566. %@3@%%@AB@%Syntax%@CR:C6A00080332 @%%@AE@%%@EH@%%@NL@%
  8567.  
  8568. %@AS@%  o value byte%@AE@%
  8569.  
  8570. This command sends the given %@AI@%byte%@AE@% to the output port specified by %@AI@%value%@AE@%. The
  8571. %@AI@%value%@AE@% parameter can specify any 16-bit port address.  %@NL@%
  8572.  
  8573.  
  8574. %@2@%%@CR:C6A00080333 @%%@AB@%p ─ Program Step%@AE@%%@EH@%%@NL@%
  8575. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8576.  
  8577.  
  8578. %@3@%%@AB@%Syntax%@CR:C6A00080334 @%%@AE@%%@EH@%%@NL@%
  8579.  
  8580. %@AS@%  p «=startaddress» «value»%@AE@%
  8581.  
  8582. This command executes an instruction, then displays the current values of
  8583. all registers and flags. If %@AI@%startaddress%@AE@% is given, the command starts
  8584. execution at the given address. Otherwise, it starts execution at the
  8585. instruction pointed to by the current CS and IP registers. If %@AI@%value%@AE@% is
  8586. given, the command executes %@AI@%value%@AE@% number of instructions before stopping.
  8587. The command automatically executes and returns from any call instructions or
  8588. software interrupts it encounters, leaving execution control at the next
  8589. instruction after the call or interrupt.%@CR:C6A00080335 @%%@CR:C6A00080336 @%%@NL@%
  8590.  
  8591.  
  8592. %@2@%%@CR:C6A00080337 @%%@AB@%q ─ Quit%@AE@%%@EH@%%@NL@%
  8593. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8594.  
  8595.  
  8596. %@3@%%@AB@%Syntax%@CR:C6A00080338 @%%@CR:C6A00080339 @% %@CR:C6A00080340 @%%@AE@%%@EH@%%@NL@%
  8597.  
  8598. %@AS@%  q%@AE@%
  8599.  
  8600. This command terminates %@AB@%SYMDEB%@AE@% execution and returns control to DOS.  %@NL@%
  8601.  
  8602.  
  8603. %@2@%%@CR:C6A00080341 @%%@AB@%r ─ Register%@AE@%%@EH@%%@NL@%
  8604. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8605.  
  8606.  
  8607. %@3@%%@AB@%Syntax%@CR:C6A00080342 @%%@AE@%%@EH@%%@NL@%
  8608.  
  8609. %@AS@%  r «register« «= »value» »%@AE@%
  8610.  
  8611. This command displays the contents of CPU registers and allows the contents
  8612. to be changed to new values.%@CR:C6A00080343 @%%@CR:C6A00080344 @%%@NL@%
  8613.  
  8614. If no %@AI@%register%@AE@% is specified, the command displays all registers, all flags,
  8615. and the instruction at the address pointed to by the current CS and IP
  8616. register values. If %@AI@%register%@AE@% is specified, the command displays the current
  8617. value of the register and prompts for a new value. If both %@AI@%register%@AE@% and
  8618. %@AI@%value%@AE@% are specified, the command changes the register to the specified
  8619. value.  %@NL@%
  8620.  
  8621.  
  8622. %@2@%%@CR:C6A00080345 @%%@AB@%s ─ Search%@AE@%%@EH@%%@NL@%
  8623. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8624.  
  8625.  
  8626. %@3@%%@AB@%Syntax%@CR:C6A00080346 @%%@AE@%%@EH@%%@NL@%
  8627.  
  8628. %@AS@%  s range list%@AE@%
  8629.  
  8630. This command searches the given %@AI@%range%@AE@% of memory locations for the byte
  8631. values given in %@AI@%list%@AE@%. The command displays the address of each byte found.  %@NL@%
  8632.  
  8633.  
  8634. %@2@%%@CR:C6A00080347 @%%@AB@%Set Source Mode%@AE@%%@EH@%%@NL@%
  8635. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8636.  
  8637.  
  8638. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8639.  
  8640. %@AS@%  s-
  8641. %@AS@%  s&
  8642. %@AS@%  s+%@AE@%
  8643.  
  8644. These commands set the display mode for commands that display instruction
  8645. code.%@CR:C6A00080348 @%%@CR:C6A00080349 @%%@NL@%
  8646.  
  8647.  
  8648.   ■   If %@AB@%s-%@AE@% is given, %@AB@%SYMDEB%@AE@% disassembles and displays the instruction code
  8649.       in memory.%@NL@%
  8650.  
  8651.   ■   If %@AB@%s&%@AE@% is given, %@AB@%SYMDEB%@AE@% displays both the actual program source line
  8652.       and the disassembled code.%@NL@%
  8653.  
  8654.   ■   If %@AB@%s+%@AE@% is given, %@AB@%SYMDEB%@AE@% displays the actual program source line
  8655.       corresponding to the instruction to be displayed.%@CR:C6A00080350 @%%@CR:C6A00080351 @%%@CR:C6A00080352 @%%@NL@%
  8656.  
  8657.  
  8658. To access a source file for the first time, %@AB@%SYMDEB%@AE@% might display the
  8659. following prompt:  %@NL@%
  8660.  
  8661. %@AS@%  Source file name for mapname(cr for none)?%@AE@%
  8662.  
  8663. In such cases, type the name, including extension, of the source file
  8664. corresponding to the symbol file %@AI@%mapname%@AE@%.  %@NL@%
  8665.  
  8666.  
  8667. %@2@%%@CR:C6A00080353 @%%@AB@%t ─ Trace%@AE@%%@EH@%%@NL@%
  8668. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8669.  
  8670.  
  8671. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8672.  
  8673. %@AS@%  t «= startaddress» «value»%@AE@%
  8674.  
  8675. This command executes an instruction, then displays the current values of
  8676. all registers and flags. If %@AI@%startaddress%@AE@% is given, the command starts
  8677. execution at the given address. Otherwise, it starts execution at the
  8678. instruction pointed to by the current CS and IP registers. If %@AI@%value%@AE@% is
  8679. given, the command continues to execute %@AI@%value%@AE@% number of instructions before
  8680. stopping. In source-only %@AB@%(s+)%@AE@% mode, %@AB@%t%@AE@% operates directly on source lines. The
  8681. %@AB@%t%@AE@% command can be used to trace instructions in ROM.%@CR:C6A00080354 @%%@CR:C6A00080355 @%%@CR:C6A00080356 @%%@CR:C6A00080357 @%%@CR:C6A00080358 @%%@NL@%
  8682.  
  8683.  
  8684. %@2@%%@CR:C6A00080359 @%%@AB@%u ─ Unassemble%@AE@%%@EH@%%@NL@%
  8685. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8686.  
  8687.  
  8688. %@3@%%@AB@%Syntax%@CR:C6A00080360 @%%@AE@%%@EH@%%@NL@%
  8689.  
  8690. %@AS@%  u «range»%@AE@%
  8691.  
  8692. This command displays the instructions and/or statements of the program
  8693. being debugged. The %@AB@%s%@AE@% command sets the display format. If %@AI@%range%@AE@% is given,
  8694. the command displays instructions generated from code within the given
  8695. range. Otherwise, the command displays the instructions generated from the
  8696. first eight lines of code at the current address. The 80286 protected-mode
  8697. mnemonics cannot be displayed.%@CR:C6A00080361 @%%@NL@%
  8698.  
  8699.  
  8700. %@2@%%@CR:C6A00080362 @%%@AB@%v ─ View%@AE@%%@EH@%%@NL@%
  8701. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8702.  
  8703.  
  8704. %@3@%%@AB@%Syntax%@CR:C6A00080363 @%%@AE@%%@EH@%%@NL@%
  8705.  
  8706. %@AS@%  v range%@AE@%
  8707.  
  8708. This command displays source lines beginning at the specified range. The
  8709. symbol file must contain line-number information.  %@NL@%
  8710.  
  8711.  
  8712. %@2@%%@CR:C6A00080364 @%%@AB@%w ─ Write%@AE@%%@EH@%%@NL@%
  8713. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8714.  
  8715.  
  8716. %@3@%%@AB@%Syntax%@CR:C6A00080365 @%%@CR:C6A00080366 @%%@AE@%%@EH@%%@NL@%
  8717.  
  8718. %@AS@%  w «address «drive record count» »%@AE@%
  8719.  
  8720. This command writes the contents of a given memory location to a named file,
  8721. or to a given logical record on disk. To write to a file, set the filename
  8722. with an %@AB@%n%@AE@% command, and set the BX:CX register pair to the number of bytes to
  8723. be written. If no %@AI@%address%@AE@% is given, the command copies bytes starting from
  8724. the address CS:100, where CS is the current value of the CS register.  %@NL@%
  8725.  
  8726. To write to a logical record on disk, set %@AI@%drive%@AE@% to any number in the range
  8727. zero (drive A) to 2 (drive C), set %@AI@%record%@AE@% to the first logical record to
  8728. receive the data (a one- to four-digit hexadecimal number), and set %@AI@%count%@AE@% to
  8729. the number of records to write to the disk (a one- to four-digit hexadecimal
  8730. number). Do not write data to an absolute disk sector unless you are sure
  8731. the sector is free; otherwise, you may destroy data.  %@NL@%
  8732.  
  8733.  
  8734. %@2@%%@CR:C6A00080367 @%%@AB@%x ─ Examine Symbol Map%@AE@%%@EH@%%@NL@%
  8735. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8736.  
  8737.  
  8738. %@3@%%@AB@%Syntax%@CR:C6A00080368 @%%@AE@%%@EH@%%@NL@%
  8739.  
  8740. %@AS@%  x «* | ? symbol»%@AE@%
  8741.  
  8742. This command displays the name and load-segment addresses of the current
  8743. symbol map, segments in that map, and symbols within those segments.  %@NL@%
  8744.  
  8745. If no parameter is given, the command displays the current symbol map name
  8746. and the segments within that map. If the asterisk (*) is specified, the
  8747. command displays the names and load-segment addresses for all currently
  8748. loaded symbol maps. If %@AB@%?%@AE@% is specified, the command displays all symbols
  8749. within the given symbol map that match the %@AI@%symbol%@AE@% specification. A %@AI@%symbol%@AE@%
  8750. specification has the following form:%@CR:C6A00080369 @%%@CR:C6A00080370 @%%@CR:C6A00080371 @%%@CR:C6A00080372 @%%@NL@%
  8751.  
  8752. %@AS@%  «mapname!» «segmentname:]] «symbolname»%@AE@%
  8753.  
  8754. If %@AI@%mapname%@AE@%%@AB@%!%@AE@% is given, the command displays information for that symbol map.
  8755. The %@AI@%mapname %@AE@%parameter must specify the filename (without extension) of the
  8756. corresponding symbol file.  %@NL@%
  8757.  
  8758. If %@AI@%segmentname%@AE@%%@AB@%:%@AE@% is given, the command displays the name and load-segment
  8759. address for that segment. The %@AI@%segmentname%@AE@% parameter must specify the name of
  8760. a segment named within the specified or currently open symbol map.  %@NL@%
  8761.  
  8762. If %@AI@%symbolname%@AE@% is given, the command displays the segment address and segment
  8763. offset for that symbol. The %@AI@%symbolname%@AE@% parameter must specify the name of a
  8764. symbol in the given segment.  %@NL@%
  8765.  
  8766. To display information about more than one segment or symbol, enter a
  8767. partial segmentname or %@AI@%symbolname%@AE@% ending with an asterisk (*). The asterisk
  8768. acts as a wildcard character.%@CR:C6A00080373 @%%@CR:C6A00080374 @%%@CR:C6A00080375 @%%@NL@%
  8769.  
  8770.  
  8771. %@2@%%@CR:C6A00080376 @%%@AB@%xo ─ Open Symbol Map%@AE@%%@EH@%%@NL@%
  8772. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8773.  
  8774.  
  8775. %@3@%%@AB@%Syntax%@CR:C6A00080377 @%%@AE@%%@EH@%%@NL@%
  8776.  
  8777. %@AS@%  xo «symbol!»%@AE@%
  8778.  
  8779. This command sets the active symbol map and/or segment. If %@AI@%symbol%@AE@%%@AB@%!%@AE@% is given,
  8780. the command sets the active symbol map to the given map. The %@AI@%symbol%@AE@%
  8781. parameter must specify the filename (without extension) of one of the symbol
  8782. files specified in the %@AB@%SYMDEB%@AE@% command line.  A map file can be opened only
  8783. if it was loaded by providing its name in the %@AB@%SYMDEB%@AE@% command line.  %@NL@%
  8784.  
  8785.  
  8786. %@2@%%@CR:C6A00080378 @%%@AB@%z ─ Set Symbol Value%@AE@%%@EH@%%@NL@%
  8787. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8788.  
  8789.  
  8790. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8791.  
  8792. %@AS@%  z symbol value  %@AE@%
  8793.  
  8794. This command sets the address of %@AI@%symbol%@AE@% to %@AI@%value%@AE@%.  %@NL@%
  8795.  
  8796.  
  8797. %@2@%%@CR:C6A00080379 @%%@AB@%? ─ Display Help%@AE@%%@EH@%%@NL@%
  8798. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8799.  
  8800.  
  8801. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8802.  
  8803. %@AS@%  ?%@AE@%
  8804.  
  8805. This command displays a list of all %@AB@%SYMDEB%@AE@% commands and operators.%@CR:C6A00080380 @%%@NL@%
  8806.  
  8807.  
  8808. %@2@%%@CR:C6A00080381 @%%@AB@%? ─ Display Expression%@AE@%%@EH@%%@NL@%
  8809. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8810.  
  8811.  
  8812. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8813.  
  8814. %@AS@%  ? expression%@AE@%
  8815.  
  8816. This command displays the value of %@AI@%expression%@AE@%. The display includes a full
  8817. address, a 16-bit hexadecimal value, a full 32-bit hexadecimal value, a
  8818. decimal value (enclosed in parentheses), and a string value (enclosed in
  8819. double quotation marks). The %@AI@%expression%@AE@% parameter can specify any
  8820. combination of numbers, symbols, addresses, and operators.%@CR:C6A00080382 @%%@CR:C6A00080383 @%%@NL@%
  8821.  
  8822.  
  8823. %@2@%%@CR:C6A00080384 @%%@AB@%. ─ Source-Line Display%@AE@%%@EH@%%@NL@%
  8824. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8825.  
  8826.  
  8827. %@3@%%@AB@%Syntax%@CR:C6A00080385 @%%@AE@%%@EH@%%@NL@%
  8828.  
  8829. %@AS@%  .%@AE@%
  8830.  
  8831. This command displays the current source line.  %@NL@%
  8832.  
  8833.  
  8834. %@2@%%@CR:C6A00080386 @%%@AB@%Redirect Input%@AE@%%@EH@%%@NL@%
  8835. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8836.  
  8837.  
  8838. %@3@%%@AB@%Syntax%@CR:C6A00080387 @%%@CR:C6A00080388 @%%@CR:C6A00080389 @%%@AE@%%@EH@%%@NL@%
  8839.  
  8840. %@AS@%  <filename
  8841. %@AS@%  { filename%@AE@%
  8842.  
  8843. The %@AB@%%@AE@% command causes %@AB@%SYMDEB%@AE@% to read all subsequent command input from the
  8844. specified file. The %@AB@%{%@AE@% command reads all input for the debugged program from
  8845. the specified file.  %@NL@%
  8846.  
  8847.  
  8848. %@2@%%@CR:C6A00080390 @%%@AB@%Redirect Output%@AE@%%@EH@%%@NL@%
  8849. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8850.  
  8851.  
  8852. %@3@%%@AB@%Syntax%@CR:C6A00080391 @%%@AE@%%@EH@%%@NL@%
  8853.  
  8854. %@AS@%  >filename
  8855. %@AS@%  }filename%@AE@%
  8856.  
  8857. The %@AB@%>%@AE@% command causes %@AB@%SYMDEB%@AE@% to write all subsequent command output to the
  8858. specified file. The %@AB@%}%@AE@% command writes all output from the debugged program to
  8859. the specified file.  %@NL@%
  8860.  
  8861.  
  8862. %@2@%%@CR:C6A00080392 @%%@AB@%Redirect Input and Output%@AE@%%@EH@%%@NL@%
  8863. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8864.  
  8865.  
  8866. %@3@%%@AB@%Syntax%@CR:C6A00080393 @%%@CR:C6A00080394 @%%@AE@%%@EH@%%@NL@%
  8867.  
  8868. %@AS@%  = =filename
  8869. %@AS@%  ~ filename%@AE@%
  8870.  
  8871. The %@AB@%= = %@AE@%command causes %@AB@%SYMDEB%@AE@% to both read from and write to the device
  8872. specified in the filename. The %@AB@%~%@AE@% command causes the debugged program to both
  8873. read from and write to the given device.  %@NL@%
  8874.  
  8875.  
  8876. %@2@%%@CR:C6A00080395 @%%@AB@%! ─ Shell Escape%@AE@%%@EH@%%@NL@%
  8877. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8878.  
  8879.  
  8880. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  8881.  
  8882. %@AS@%  ! «dos-command»%@AE@%
  8883.  
  8884. This command passes control to COMMAND.COM, the DOS command processor,
  8885. letting the user carry out DOS commands. The DOS EXIT command returns
  8886. control to %@AB@%SYMDEB%@AE@%. If %@AI@%dos-command%@AE@% is given, %@AB@%SYMDEB%@AE@% passes the command to
  8887. COMMAND.COM for execution, then receives control back as soon as the command
  8888. is completed.%@CR:C6A00080396 @%%@CR:C6A00080397 @%%@CR:C6A00080398 @%%@CR:C6A00080399 @%%@CR:C6A00080400 @%%@NL@%
  8889.  
  8890.  
  8891. %@2@%%@CR:C6A00080401 @%%@AB@%* ─ Comment%@AE@%%@EH@%%@NL@%
  8892. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8893.  
  8894.  
  8895. %@3@%%@AB@%Syntax%@CR:C6A00080402 @%%@AE@%%@EH@%%@NL@%
  8896.  
  8897. %@AS@%  *comment%@AE@%
  8898.  
  8899. This command echoes %@AI@%comment%@AE@% on the screen (or other output device).  %@NL@%
  8900.  
  8901.  
  8902.  
  8903.  
  8904.  
  8905.  
  8906. %@CR:C6A00090001 @%%@1@%%@AB@%Chapter 9  Advanced Debugging in Protected Mode: 80386 Debugger%@AE@%%@EH@%%@NL@%
  8907. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  8908.  
  8909. Microsoft Windows 80386 Debugger (%@AB@%WDEB386%@AE@%) is used to test and debug Windows
  8910. applications and dynamic-link libraries (DLLs) running in standard or 386
  8911. enhanced mode, but not in real mode. It runs only on systems with an Intel
  8912. 80386 CPU. The debugger provides commands that allow the operator to inspect
  8913. and manipulate test code and environment status, install breakpoints, and
  8914. perform other debugging operations.  %@NL@%
  8915.  
  8916. %@AB@%WDEB386%@AE@% offers debugging features not available in CodeView for Windows
  8917. (%@AB@%CVW%@AE@%), but lacks the the convenient character-oriented window interface of
  8918. %@AB@%CVW%@AE@%.  %@NL@%
  8919.  
  8920. To use the debugger, a serial terminal must be connected to the system
  8921. running the debugger and test program. The terminal connection requirements
  8922. are described in Section 9.2, "Starting the Debugger."  %@NL@%
  8923.  
  8924. This chapter describes the following:  %@NL@%
  8925.  
  8926.  
  8927.   ■   Preparing symbol files%@NL@%
  8928.  
  8929.   ■   Starting the 80386 Debugger%@NL@%
  8930.  
  8931.   ■   How the 80386 Debugger traps a failed application%@NL@%
  8932.  
  8933.   ■   Debugger command format%@NL@%
  8934.  
  8935.   ■   Common %@AB@%WDEB386%@AE@% commands%@NL@%
  8936.  
  8937.   ■   %@AB@%WDEB386%@AE@% commands used with Windows in 386 enhanced mode%@NL@%
  8938.  
  8939.  
  8940.  
  8941. %@2@%%@CR:C6A00090002 @%%@AB@%9.1  Preparing Symbol Files for the 80386 Debugger%@AE@%%@EH@%%@NL@%
  8942.  
  8943. Application symbol files should be prepared for the debugger in the same way
  8944. as the files are prepared for the Symbolic Debugger (%@AB@%SYMDEB%@AE@%).  %@NL@%
  8945.  
  8946.  
  8947.   1.  Compile your C source files with the %@AB@%-Zd%@AE@% option.%@NL@%
  8948.  
  8949. %@STUB@%      This will prepare the object files for use by the 80386 Debugger.%@NL@%
  8950.  
  8951.   2.  Run %@AB@%LINK%@AE@% to link these object files.%@NL@%
  8952.  
  8953. %@STUB@%      %@AB@%WDEB386%@AE@% does not use line number information, so you need not use the
  8954.       %@AB@%/linenumbers%@AE@% option.%@NL@%
  8955.  
  8956.   3.  Run the %@AB@%MAPSYM%@AE@% program to create an application symbol file for the
  8957.       debugger.%@NL@%
  8958.  
  8959.  
  8960.  
  8961. %@2@%%@CR:C6A00090003 @%%@AB@%9.2  Starting the Debugger%@AE@%%@EH@%%@NL@%
  8962.  
  8963. The command line options are:  %@NL@%
  8964.  
  8965. %@AS@%  WDEB386 «/C: {1 | 2 | 3 | 4}» «/V«P»» «/S: symfilespec»... winfilespec
  8966. %@AS@%«parameters»%@AE@%
  8967.  
  8968. For example, the following typical commands are valid:  %@NL@%
  8969.  
  8970. %@AS@%  WDEB386 /V /S:\windows\system\krnl286.sym /S:myapp.sym \windows\win.com /s
  8971. %@AS@%myapp
  8972. %@AS@%  
  8973. %@AS@%  WDEB386 /C:1 /S:krnl386.sym /s:user.sym /S:\myapp\myapp.sym
  8974. %@AS@%\windows\win.com /3 myapp%@AE@%
  8975.  
  8976. Use the %@AB@%/C:%@AE@% option to specify a COM port for debugger output. If no COM port
  8977. option is specified, then the debugger checks first for COM2, and if not
  8978. found, then checks for COM1. If neither COM1 nor COM2 exists, the debugger
  8979. will look for any other COM port in the ROM data area (40:0). A three-wire
  8980. null modem cable is all that is needed for terminal connection (no DTR/CTS
  8981. handshaking is used).  %@NL@%
  8982.  
  8983. The %@AB@%/V%@AE@% and %@AB@%/VP%@AE@% options enable Verbose mode, which displays messages
  8984. indicating which segments are loading. %@AB@%/V%@AE@% displays the messages for both
  8985. Windows in 386 enhanced mode and for Windows applications; %@AB@%/VP%@AE@% displays the
  8986. messages for applications only.  %@NL@%
  8987.  
  8988. Use the %@AB@%/S:%@AE@% option to specify a symbol file to be loaded. These switches are
  8989. optional and can be repeated. If the symbol files are not in your current
  8990. directory, you must supply a full pathname for the symbol files. %@AB@%WDEB386%@AE@%
  8991. does not use the PATH environment variable to locate any of the files
  8992. supplied on the command line.  %@NL@%
  8993.  
  8994. When memory is low, you can use more symbol files by running the 80386
  8995. Debugger in the Windows directory and specifying the full pathname of
  8996. WIN386.EXE (such as \WINDOWS\SYSTEM\WIN386.EXE) instead of WIN.COM.  %@NL@%
  8997.  
  8998. A program specification is required, and any characters after the program
  8999. specification are passed to the program as parameters.  %@NL@%
  9000.  
  9001. ────────────────────────────────────────────────────────────────────────────%@NL@%
  9002. NOTE
  9003.  
  9004. %@AI@%The 80386 Debugger does not display your source lines. %@AE@%
  9005. ────────────────────────────────────────────────────────────────────────────%@NL@%
  9006.  
  9007.  
  9008. %@2@%%@CR:C6A00090004 @%%@AB@%9.3  When an Application Fails%@AE@%%@EH@%%@NL@%
  9009.  
  9010. If a Windows application running in standard or 386 enhanced mode attempts
  9011. to read or write memory using a bad selector, beyond a selector limit, or
  9012. with a selector set to 0, then a general protection (GP) fault occurs.  %@NL@%
  9013.  
  9014. Windows in 386 enhanced mode traps this fault and causes the debugger to
  9015. display something like the following:  %@NL@%
  9016.  
  9017. %@AS@%  GENERAL PROTECTION VIOLATION
  9018. %@AS@%  AX=xxxxxxxx BX=xxxxxxxx CX=xxxxxxxx DX=xxxxxxxx SI=xxxxxxxx DI=xxxxxxxx
  9019. %@AS@%  IP=00000FA0  SP=xxxxxxxx  BP=xxxxxxxx  CR2=xxxxxxxx  CR3=xxxx  IOPL=3  F=─
  9020. %@AS@%─
  9021. %@AS@%  CS=00AD SS=xxxx DS=xxxx ES=xxxx FS=xxxx GS=xxxx ─ NV UP EI PL ZR NA PE NC 
  9022. %@AS@%  00AD:00000FA0  MOV BX, WORD PTR ES:[BX]
  9023. %@AS@%
  9024. %@AS@%You can determine the cause of the fault by looking at the value and the
  9025. %@AS@%limit of the selector by dumping the LDT entry with the command:  %@NL@%
  9026. %@AS@%
  9027. %@AS@%%@AS@%  DL selector%@AE@%
  9028.  
  9029. The ability to continue execution depends on the cause of the fault. If the
  9030. fault was caused by reading or writing beyond the selector limit, then
  9031. sometimes it is possible to skip the instruction by incrementing the IP,
  9032. using:  %@NL@%
  9033.  
  9034. %@AS@%  R IP
  9035. %@AS@%  IP=xxxx
  9036. %@AS@%  :%@AE@%
  9037.  
  9038. You might have to disassemble the instruction with code bytes shown to
  9039. determine how many bytes it contains. To do this, use the following
  9040. commands:  %@NL@%
  9041.  
  9042. %@AS@%  Y CODEBYTES
  9043. %@AS@%  R%@AE@%
  9044.  
  9045. If the fault is caused by a critical logic error, such as trying to use a
  9046. selector for a temporary variable, then there probably is no way to continue
  9047. execution of the application. Rebooting the machine may be the only option.
  9048. %@NL@%
  9049.  
  9050.  
  9051. %@2@%%@CR:C6A00090005 @%%@AB@%9.4  Debugger Command Format%@AE@%%@EH@%%@NL@%
  9052.  
  9053. Each debugger command consists of one or two letters, usually followed by
  9054. one or more parameters. These commands and parameters are not
  9055. case-sensitive.  %@NL@%
  9056.  
  9057. If a syntax error occurs in a debugger command, the debugger redisplays the
  9058. command line and indicates the error with a caret (^) and the word "Error,"
  9059. as in the following example:  %@NL@%
  9060.  
  9061. %@AS@%  A100
  9062. %@AS@%   ^ Error%@AE@%
  9063.  
  9064.  
  9065. %@3@%%@CR:C6A00090006 @%%@AB@%9.4.1  Command Keys%@AE@%%@EH@%%@NL@%
  9066.  
  9067. The following is a list of command keys:  %@NL@%
  9068.  
  9069. %@TH:   5   292 02 12 64 @%Key         Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%CONTROL+C   Halts debugger output and returns to the debugger prompt.CONTROL+S   Freezes a 80386 Debugger display.CONTROL+Q   Restarts the display.%@TE:   5   292 02 12 64 @%
  9070.  
  9071. CONTROL+S and CONTROL+Q are ignored if the target system is executing code.
  9072. %@NL@%
  9073.  
  9074.  
  9075. %@3@%%@CR:C6A00090007 @%%@AB@%9.4.2  Command Parameters%@AE@%%@EH@%%@NL@%
  9076.  
  9077. You can separate 80386 Debugger command parameters with delimiters (spaces
  9078. or commas), but the only required delimiter is between two consecutive
  9079. hexadecimal values. The following commands are equivalent:  %@NL@%
  9080.  
  9081. %@AS@%  dCS:100 110
  9082. %@AS@%  d CS:100 110
  9083. %@AS@%  d,CS:100,110%@AE@%
  9084.  
  9085. ────────────────────────────────────────────────────────────────────────────%@NL@%
  9086. NOTE 
  9087.  
  9088. %@AI@%Selector is the term used to indicate the value in a segment register while
  9089. %@AI@%in protected mode. Segment is the equivalent in real mode. Although the
  9090. %@AI@%following discussion uses selector, the discussion applies to segments as
  9091. %@AI@%well.%@AE@%
  9092. ────────────────────────────────────────────────────────────────────────────%@NL@%
  9093.  
  9094. The following describes the parameters you can use with the 80386 Debugger
  9095. commands:  %@NL@%
  9096.  
  9097. %@TH: 105  6149 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%addr%@AE@%                              Represents an address parameter in one                                   of two forms. The first form contains                                   either an alphabetic selector register                                   or a four-digit selector address, and an                                  offset value. The second form is a                                   physical address using the % operator.                                   You can omit the selector name or                                   selector address, in which case the                                   default selector is DS. This default                                   selector is used for all commands except                                  %@AB@%g%@AE@%, %@AB@%p%@AE@%,%@AB@% t%@AE@%, and %@AB@%u%@AE@%. The default selector for                                  these commands is CS. All numeric values                                  are hexadecimal. Example addresses                                   include:                                   %@AS@%CS:0100%@AE@%                                  %@AS@%04BA:0100%@AE@%                                  A colon is required between the selector                                  name (whether numeric or alphabetic) and                                  the offset value. The selector portion                                   is treated as a selector or segment as                                   appropriate for the current processor                                   mode (protected or real) unless                                   specifically overridden by the # or &                                   operator.%@AI@%byte%@AE@%                              Specifies a 2-digit hexadecimal value.%@AI@%cmds%@AE@%                              Specifies an optional set of debugger                                   commands to be executed with the %@AB@%bp%@AE@% (Set                                  Breakpoints) or %@AB@%j%@AE@% (Conditional Execute)                                   commands. %@AI@%dword%@AE@%                             Represents an 8-digit (4-byte)                                   hexadecimal value. A %@AB@%DWORD%@AE@% is most                                   commonly used as a physical address.%@AI@%expr%@AE@%                              Represents a combination of parameters                                   and operators that evaluates to an 8, 16,                                  or 32-bit value. An %@AI@%expr%@AE@% parameter can                                   be used as a value in any command. An %@AI@%%@AE@%                                  %@AI@%expr%@AE@% parameter can combine any symbol,                                   number, or address with any of the                                   binary and unary operators. %@AI@%group-name%@AE@%                        Specifies the name of a group that                                   contains the map symbols you want to                                   display. %@AI@%list%@AE@%                              Specifies a series of byte values or a                                   string. The %@AI@%list%@AE@% parameter must be the                                   last parameter on the command line.                                   Following is an example of the %@AB@%f%@AE@% (Fill)                                   command using a %@AI@%list%@AE@% parameter:                                   %@AS@%fCS:100 42 45 52 54 41%@AE@%%@AI@%map-name%@AE@%                          Specifies the name of a symbol map file.%@AI@%range%@AE@%                             Contains two addresses (%@AI@%addr addr%@AE@%) or                                   one address, an %@AB@%L%@AE@%, and a value (%@AI@%addr %@AE@%%@AB@%L%@AE@%%@AI@% %@AE@%                                  %@AI@%word%@AE@%, where %@AI@%word%@AE@% is the number of items                                   on which the command should operate; %@AB@%L %@AE@%                                  80 is the default). Sample %@AI@%ranges%@AE@%                                   include:                                   %@AS@%CS:100 110%@AE@%                                  %@AS@%CS:100 L 10%@AE@%                                  %@AS@%CS:100%@AE@%                                  The limit for %@AI@%range%@AE@% is 10000                                   (hexadecimal). To specify a word of                                   10000 using only four digits, use 0000                                   or 0. %@AI@%reg%@AE@%                               Specifies the name of a microprocessor                                   register.%@AI@%string%@AE@%                            Represents any number of characters                                   enclosed in single (") or double ("")                                   quotation marks. If the quotation marks                                   must appear within a %@AI@%string%@AE@%, you must                                   use two sets of quotation marks. For                                   example, the following strings are                                   legal:                                   %@AS@%'This ''string'' is OK.' %@AE@%                                  %@AS@%"This ""string"" is OK."%@AE@%                                  However, the following strings are                                   illegal:                                  %@AS@%"This "string" is not OK."%@AE@%                                  %@AS@%"This 'string' is not OK."%@AE@%                                  The ASCII values of the characters in                                   the string are used as a list of byte                                   values. %@AI@%word%@AE@%                              Specifies a 4-digit (2-byte) hexadecimal                                  value.%@TE: 105  6149 02 34 42 @%
  9098.  
  9099.  
  9100. %@3@%%@CR:C6A00090008 @%%@AB@%9.4.3  Binary and Unary Operators%@AE@%%@EH@%%@NL@%
  9101.  
  9102. The following list contains, in descending order of precedence, the binary
  9103. operators that can be used in 80386 Debugger commands.  %@NL@%
  9104.  
  9105. %@TH:  20   847 02 16 60 @%Operator        Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%( )             Parentheses:               Address binder *               Multiplication /               Integer division MOD             Modulus (remainder) ++              Addition -               Subtraction >               Greater-than relational operator<               Less-than relational operator >=              Greater-than/equal-to relational operator <=              Less-than/equal-to relational operator ==              Equal-to relational operator !=              Not-equal-to relational operator AND             Bitwise Boolean AND XOR             Bitwise Boolean exclusive OR OR              Bitwise Boolean OR &&              Logical AND |- |-||         Logical OR%@TE:  20   847 02 16 60 @%
  9106.  
  9107. The following list contains, in descending order of precedence, the unary
  9108. operators that can be used in 80386 Debugger commands.  %@NL@%
  9109.  
  9110. %@TH:  34  1256 02 34 42 @%Operator                          Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%&(seg)                            Interpret address using segment value#(sel)                            Interpret address using selector value %%(phy)                           Interpret address as a physical value %(lin)                            Interpret address as a linear value -                                 Two's complement !                                 Logical NOT operator NOT                               One's complement SEG                               Segment address of operand OFF                               Address offset of operand BY                                Low-order byte from given address WO                                Low-order word from given address DW                                Doubleword from given address POI                               Pointer (4 bytes) from given                                   address─this operator only works with                                   16:16 addressesPORT                              1 byte from given port WPORT                             Word from given port%@TE:  34  1256 02 34 42 @%
  9111.  
  9112.  
  9113. %@2@%%@CR:C6A00090009 @%%@AB@%9.5  Common Command Directory%@AE@%%@EH@%%@NL@%
  9114.  
  9115. This section documents the commands available in all environments using the
  9116. 80386 Debugger. These commands are usually one or two alphabetical
  9117. characters, though some are characters preceded by a period (called "dot"
  9118. commands).  %@NL@%
  9119.  
  9120. This section consists of a listing of commands and brief descriptions
  9121. followed by detailed descriptions of the commands, including syntax,
  9122. purpose, input parameters and examples.  %@NL@%
  9123.  
  9124. %@TH:  57  2725 02 16 60 @%Command         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%?%@AE@%               Display expression%@AB@%?%@AE@%               Display help%@AB@%.?%@AE@%              Display external commands%@AB@%.b%@AE@%              Set COM port baud rate%@AB@%.df%@AE@%             Display global free list%@AB@%.dg%@AE@%             Display global heap%@AB@%.dh%@AE@%             Display local heap%@AB@%.dm%@AE@%             Display global module list%@AB@%.dq%@AE@%             Dump task queue%@AB@%.du%@AE@%             Display global LRU list%@AB@%.reboot%@AE@%         Reboot target system%@AB@%bc%@AE@%              Clear breakpoints%@AB@%bd%@AE@%              Disable breakpoints%@AB@%be%@AE@%              Enable breakpoints%@AB@%bl%@AE@%              List breakpoints%@AB@%bp%@AE@%              Set breakpoints%@AB@%c%@AE@%               Compare memory %@AB@%d%@AE@%               Display memory%@AB@%db%@AE@%              Display bytes%@AB@%dd%@AE@%              Display doublewords%@AB@%dg%@AE@%              Display GDT%@AB@%di%@AE@%              Display IDT%@AB@%dl%@AE@%              Display LDT%@AB@%dt%@AE@%              Display TSS%@AB@%dw%@AE@%              Display words%@AB@%e%@AE@%               Enter byte%@AB@%f%@AE@%               Fill memory%@AB@%g%@AE@%               Go%@AB@%h%@AE@%               Hexadecimal arithmetic%@AB@%i%@AE@%               Input byte%@AB@%j%@AE@%               Conditional execute%@AB@%k%@AE@%               Backtrace stack%@AB@%ka%@AE@%              Set backtrace arguments%@AB@%kt%@AE@%              Backtrace task stack%@AB@%kv%@AE@%              Verbose backtrace stack%@AB@%la%@AE@%              List absolute symbols%@AB@%lg%@AE@%              List groups%@AB@%lm%@AE@%              List map%@AB@%ln%@AE@%              List near%@AB@%ls%@AE@%              List symbols%@AB@%m%@AE@%               Move memory%@AB@%o%@AE@%               Output to port%@AB@%p%@AE@%               Program trace%@AB@%r%@AE@%               Display registers%@AB@%s%@AE@%               Search bytes%@AB@%t%@AE@%               Trace instructions%@AB@%u%@AE@%               Unassemble bytes%@AB@%v%@AE@%               Set interrupt vector trapping%@AB@%vl%@AE@%              Display interrupt trapping information%@AB@%w%@AE@%               Change map%@AB@%y%@AE@%               Debugger configuration options%@AB@%z%@AE@%               Zap embedded INT 1 and INT 3 instructions%@AB@%zd%@AE@%              Execute default command string%@AB@%zl%@AE@%              Display default command string%@AB@%zs%@AE@%              Change default command string%@TE:  57  2725 02 16 60 @%
  9125.  
  9126.  
  9127.  
  9128.  
  9129.  
  9130. %@2@%%@CR:C6A00090010 @%%@AB@%? ─ Display Expression%@AE@%%@EH@%%@NL@%
  9131. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9132.  
  9133.  
  9134. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9135.  
  9136. %@AS@%  ? expr | "string"%@AE@%
  9137.  
  9138. The %@AB@%?%@AE@% command displays the value of a specified expression or string. An
  9139. expression is first evaluated and then displayed in hexadecimal, decimal,
  9140. octal, and binary format. The debugger also displays an ASCII character
  9141. representation of the evaluated expression, a physical address
  9142. interpretation, and whether the expression is TRUE or FALSE.  %@NL@%
  9143.  
  9144. Strings enclosed in quotation marks are echoed to the screen.  %@NL@%
  9145.  
  9146. The expression evaluator provides support for three types of addresses: real
  9147. mode (%selector:offset), protected mode (#selector:offset), and physical
  9148. address (%@AB@%DWORD)%@AE@%. The %@AB@%&%@AE@%, %@AB@%#%@AE@%, and %@AB@%%%@AE@% characters override the current address
  9149. type, allowing selectors to be used in real mode, segments to be used in
  9150. protected mode, and so on. The %@AB@%%%@AE@% character converts other addresses to
  9151. physical addresses.  %@NL@%
  9152.  
  9153. %@TH:  53  2269 02 11 32 33 @%Parameter  Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%expr%@AE@%       Specifies any combination of            numbers, addresses, and            operators. If %@AI@%expr%@AE@% is not            specified, this command will            print help messages. The            following key words can be            used with the expression:           Key Word                        Description           %@AI@%reg%@AE@%                             Returns the value of %@AI@%reg%@AE@%, where                                           %@AI@%reg%@AE@% is one of the following                                            registers: AX, BX, CX, DX, SI,                                            DI, BP, DS, ES, SS, CS, SP, or                                            IP           FLG                             Returns the value of the flags           GDTB                            Returns the value of the GDT                                            base as a physical address           GDTL                            Returns the value of the GDT                                            limit           IDTB                            Returns the value of the IDT                                            base as a physical address           IDTL                            Returns the value of the IDT                                            limit           TR                              Returns the value of the TR                                            register           LDTR                            Returns the value of the LDTR                                            register           MSW                             Returns the value of the MSW                                            register           The @ character can be used            with any of the register names           to ensure that the expression            evaluator interprets the name            as a register instead of a            symbol (for example, @AX is            the same as AX).%@AI@%string%@AE@%     Specifies a sequence of            characters enclosed in single            or double quotation marks.%@TE:  53  2269 02 11 32 33 @%
  9154.  
  9155.  
  9156. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9157.  
  9158. %@AS@%  ?%(#001F:0220) %@AE@%
  9159.  
  9160. This example looks up selector 1F's physical address in the current LDT and
  9161. adds 220 to it.  %@NL@%
  9162.  
  9163. %@AS@%  ? ds:si+bx%@AE@%
  9164.  
  9165. This example displays the value of the expression DS:SI + BX. The debugger
  9166. returns a display similar to the following:  %@NL@%
  9167.  
  9168. %@AS@%  2038:4278 540557944T 40160411700Q 0100001001111000Y 'X' %0245F8 TRUE%@AE@%
  9169.  
  9170. %@AS@%  ? 3*4%@AE@%
  9171.  
  9172. This example displays the value of the arithmetic expression 3*4. The
  9173. debugger returns the following display:  %@NL@%
  9174.  
  9175. %@AS@%  0CH 12T 14Q 00001100Y '.' %00000C TRUE%@AE@%
  9176.  
  9177. %@AS@%  bp1 100 "r;d 200;? 'BP 1 REACHED'"%@AE@%
  9178.  
  9179. This example is used in a %@AB@%bp%@AE@% (Set Breakpoint) command to announce a
  9180. breakpoint number.  %@NL@%
  9181.  
  9182.  
  9183. %@2@%%@CR:C6A00090011 @%%@AB@%? ─ Display Help Menu%@AE@%%@EH@%%@NL@%
  9184. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9185.  
  9186.  
  9187. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9188.  
  9189. %@AS@%  ?%@AE@%
  9190.  
  9191. The %@AB@%?%@AE@% command displays a list of commands and syntax recognized by the
  9192. debugger.  %@NL@%
  9193.  
  9194.  
  9195. %@2@%%@CR:C6A00090012 @%%@AB@%.? ─ Display External Commands%@AE@%%@EH@%%@NL@%
  9196. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9197.  
  9198.  
  9199. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9200.  
  9201. %@AS@%  .?%@AE@%
  9202.  
  9203. The %@AB@%.?%@AE@% command displays a list of external commands. These commands are part
  9204. of the debugger, but are specific to the environment in which the debugger
  9205. is running.  %@NL@%
  9206.  
  9207.  
  9208. %@2@%%@CR:C6A00090013 @%%@AB@%.b ─ Set COM Port Baud Rate%@AE@%%@EH@%%@NL@%
  9209. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9210.  
  9211.  
  9212. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9213.  
  9214. %@AS@%  .b baud-rate «port-addr»%@AE@%
  9215.  
  9216. The %@AB@%.b%@AE@% command sets the baud rate for the debugging port (COM2).  %@NL@%
  9217.  
  9218. %@TH:  17  1090 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%baud-rate%@AE@%                         Specifies one of the following values:                                   150, 300, 600, 1200, 2400, 4800, 9600,                                   or 19200. Since the default radix for                                   the debugger is 16, you must include a                                   "t" after the number to indicate decimal                                  values. %@AI@%port-addr%@AE@%                         Can be 1 for COM1, 2 for COM2; anything                                   else is taken as a base port address.                                   During initialization, if there is no                                   COM2, the debugger checks for COM1 and                                   then any other COM port address in the                                   ROM data area, and uses it as the                                   console. %@TE:  17  1090 02 34 42 @%
  9219.  
  9220.  
  9221. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9222.  
  9223. %@AS@%  #.b 1200t%@AE@%
  9224.  
  9225. This example sets the baud rate to 1200.  %@NL@%
  9226.  
  9227.  
  9228. %@2@%%@CR:C6A00090014 @%%@AB@%.df ─ Display Global Free List%@AE@%%@EH@%%@NL@%
  9229. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9230.  
  9231.  
  9232. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9233.  
  9234. %@AS@%  .df%@AE@%
  9235.  
  9236. The %@AB@%.df%@AE@% command displays a list of the free global memory objects in the
  9237. global heap. The list has the following form:%@CR:C6A00090015 @%%@CR:C6A00090016 @%%@NL@%
  9238.  
  9239. %@AS@%  address: size owner «chain»%@AE@%
  9240.  
  9241. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  9242. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  9243. %@NL@%
  9244.  
  9245. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  9246. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  9247. the size of the object in bytes.  %@NL@%
  9248.  
  9249. The %@AI@%owner%@AE@% field always specifies that the module is free.  %@NL@%
  9250.  
  9251. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.
  9252. %@AB@%WDEB386%@AE@% displays the addresses only if the segment is moveable and
  9253. discardable.  %@NL@%
  9254.  
  9255.  
  9256. %@2@%%@CR:C6A00090017 @%%@AB@%.dg ─ Display Global Heap%@AE@%%@EH@%%@NL@%
  9257. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9258.  
  9259.  
  9260. %@3@%%@AB@%Syntax%@CR:C6A00090018 @%%@AE@%%@EH@%%@NL@%
  9261.  
  9262. %@AS@%  .dg «object»%@AE@%
  9263.  
  9264. The %@AB@%.dg%@AE@% command displays a list of the global memory objects in the global
  9265. heap.  %@NL@%
  9266.  
  9267. %@TH:   7   463 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%object%@AE@%                            Specifies the first object to be listed.                                  The %@AI@%object%@AE@% parameter can be a handle,                                   selector, or (in 386 enhanced mode) a                                   heap address.%@TE:   7   463 02 34 42 @%
  9268.  
  9269. The list has the following form:%@CR:C6A00090019 @%%@NL@%
  9270.  
  9271. %@AS@%  address: size segment-type owner «handle flags chain»%@AE@%
  9272.  
  9273. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  9274. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  9275. %@NL@%
  9276.  
  9277. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  9278. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  9279. the size of the object in bytes.  %@NL@%
  9280.  
  9281. The %@AI@%segment-type%@AE@% field specifies the type of object. The type can be any one
  9282. of the following:  %@NL@%
  9283.  
  9284. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  9285. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9286. %@AB@%CODE%@AE@%                              Segment contains program code.
  9287.  
  9288. %@AB@%DATA%@AE@%                              Segment contains program data and 
  9289.                                   possible stack and local heap data.
  9290.  
  9291. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  9292.                                   objects ready for allocation by an 
  9293.                                   application.
  9294.  
  9295. %@AB@%PRIV%@AE@%                              Segment contains private data.
  9296.  
  9297. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  9298.                                   the global heap.
  9299.  
  9300. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  9301. allocated the memory object. The name "pdb" is used for memory objects that
  9302. represent program descriptor blocks. These blocks contain execution
  9303. information about applications.%@CR:C6A00090020 @%%@NL@%
  9304.  
  9305. The %@AI@%handle%@AE@% field specifies the handle of the global memory object. If
  9306. %@AB@%WDEB386%@AE@% displays no handle, the segment is fixed.  %@NL@%
  9307.  
  9308. The %@AI@%flags%@AE@% field specifies the following:  %@NL@%
  9309.  
  9310. %@AB@%Flag%@AE@%                              %@AB@%Meaning%@AE@%
  9311. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9312. D                                 The segment is moveable and discardable.
  9313.  
  9314. L                                 The segment is locked. If the segment is
  9315.                                   locked, the lock count appears to the 
  9316.                                   right of the flag.
  9317.  
  9318. If %@AB@%WDEB386%@AE@% displays a handle, but no flag, the segment is moveable but
  9319. nondiscardable.  %@NL@%
  9320.  
  9321. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.
  9322. %@AB@%WDEB386%@AE@% displays the addresses only if the segment is moveable and
  9323. discardable (the D flag).  %@NL@%
  9324.  
  9325.  
  9326. %@2@%%@CR:C6A00090021 @%%@AB@%.dh ─ Display Local Heap%@AE@%%@EH@%%@NL@%
  9327. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9328.  
  9329.  
  9330. %@3@%%@AB@%Syntax%@CR:C6A00090022 @%%@AE@%%@EH@%%@NL@%
  9331.  
  9332. %@AS@%  .dh%@AE@%
  9333.  
  9334. The %@AB@%.dh%@AE@% command displays a list of the local memory objects in the local
  9335. heap (if any) belonging to the current data segment. The command uses the
  9336. current value of the DS register to locate the data segment and check for a
  9337. local heap. The list of memory objects has the following form:%@CR:C6A00090023 @%%@NL@%
  9338.  
  9339. %@AS@%  offset: size { BUSY | FREE }%@AE@%
  9340.  
  9341. The %@AI@%offset%@AE@% field specifies the address offset from the beginning of the data
  9342. segment to the local memory object.  %@NL@%
  9343.  
  9344. The %@AI@%size%@AE@% field specifies the size of the object in bytes.  %@NL@%
  9345.  
  9346. If %@AB@%BUSY%@AE@% is given, the object has been allocated and is currently in use. If
  9347. %@AB@%FREE%@AE@% is given, the object is in the pool of free objects ready to be
  9348. allocated by the application. A special memory object, %@AB@%SENTINAL%@AE@%, may also be
  9349. displayed.  %@NL@%
  9350.  
  9351.  
  9352. %@2@%%@CR:C6A00090024 @%%@AB@%.dm ─ Display Global Module List%@AE@%%@EH@%%@NL@%
  9353. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9354.  
  9355.  
  9356. %@3@%%@AB@%Syntax%@CR:C6A00090025 @%%@AE@%%@EH@%%@NL@%
  9357.  
  9358. %@AS@%  .dm%@AE@%
  9359.  
  9360. The %@AB@%.dm%@AE@% command displays a list of the global modules in the global heap.
  9361. The list has the following form:%@CR:C6A00090026 @%%@NL@%
  9362.  
  9363. %@AS@%  module-handle module-type module-name file-name%@AE@%
  9364.  
  9365. The %@AI@%module-handle%@AE@% field specifies the handle of the module. The %@AI@%module-type%@AE@%
  9366. field specifies either a dynamic-link library (DLL) or the name of the
  9367. application you are debugging. The %@AI@%module-name%@AE@% field specifies the name of
  9368. the module. The %@AI@%file-name%@AE@% field specifies the name of the file from which
  9369. you loaded the application.  %@NL@%
  9370.  
  9371.  
  9372. %@2@%%@CR:C6A00090027 @%%@AB@%.dq ─ Dump Task Queue%@AE@%%@EH@%%@NL@%
  9373. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9374.  
  9375.  
  9376. %@3@%%@AB@%Syntax%@CR:C6A00090028 @%%@CR:C6A00090029 @%%@AE@%%@EH@%%@NL@%
  9377.  
  9378. %@AS@%  .dq%@AE@%
  9379.  
  9380. The %@AB@%.dq%@AE@% command displays a list containing information about the various
  9381. task queues supported by the system. The list has the following form:  %@NL@%
  9382.  
  9383. %@AS@%  task-descriptor-block  stack-segment:stack-pointer number-of-events
  9384. %@AS@%priority internal-messaging-information module%@AE@%
  9385.  
  9386. The %@AI@%task-descriptor-block%@AE@% field specifies the selector or segment address.
  9387. The task descriptor block is identical to the "pdb."%@CR:C6A00090030 @%%@CR:C6A00090031 @%The
  9388. %@AI@%stack-segment:stack-pointer%@AE@% field specifies the stack segment and pointer.
  9389. The %@AI@%number-of-events%@AE@% field specifies the number of events waiting for the
  9390. segment. The %@AI@%priority%@AE@% field specifies the priority of the segment. The
  9391. %@AI@%internal-messaging-information%@AE@% field specifies information about internal
  9392. messages. The %@AI@%module%@AE@% field specifies the module name.  %@NL@%
  9393.  
  9394.  
  9395. %@2@%%@CR:C6A00090032 @%%@AB@%.du ─ Display Global LRU List%@AE@%%@EH@%%@NL@%
  9396. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9397.  
  9398.  
  9399. %@3@%%@AB@%Syntax%@CR:C6A00090033 @%%@CR:C6A00090034 @%%@AE@%%@EH@%%@NL@%
  9400.  
  9401. %@AS@%  .du%@AE@%
  9402.  
  9403. The %@AB@%.du%@AE@% command displays a list of the least-recently-used (LRU) global
  9404. memory objects in the global heap. The list has the following form:  %@NL@%
  9405.  
  9406. %@AS@%  address: size segment-type owner «handle flags chain»%@AE@%
  9407.  
  9408. The %@AI@%address%@AE@% field specifies the selector of the memory in standard mode. In
  9409. 386 enhanced mode, the %@AI@%address%@AE@% field specifies physical and heap addresses.
  9410. %@NL@%
  9411.  
  9412. The %@AI@%size%@AE@% field specifies the size in paragraphs (multiples of 16 bytes) of
  9413. the object in standard mode. In 386 enhanced mode, the %@AI@%size%@AE@% field specifies
  9414. the size of the object in bytes.  %@NL@%
  9415.  
  9416. The %@AI@%segment-type%@AE@% field specifies the type of object. The type can be any one
  9417. of the following:  %@NL@%
  9418.  
  9419. %@AB@%Segment Type%@AE@%                      %@AB@%Meaning%@AE@%
  9420. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9421. %@AB@%CODE%@AE@%                              Segment contains program code.
  9422.  
  9423. %@AB@%DATA%@AE@%                              Segment contains program data and 
  9424.                                   possible stack and local heap data.
  9425.  
  9426. %@AB@%FREE%@AE@%                              Segment belongs to pool of free memory 
  9427.                                   objects ready for allocation by an 
  9428.                                   application.
  9429.  
  9430. %@AB@%PRIV%@AE@%                              Segment contains private data.
  9431.  
  9432. %@AB@%SENTINAL%@AE@%                          Segment marks the beginning or end of 
  9433.                                   the global heap.
  9434.  
  9435. The %@AI@%owner%@AE@% field specifies the module name of the application or library that
  9436. allocated the memory object. The name "pdb" is used for memory objects that
  9437. represent program descriptor blocks. These blocks contain execution
  9438. information about applications.%@CR:C6A00090035 @%%@NL@%
  9439.  
  9440. The %@AI@%handle%@AE@% field specifies the handle of the global memory object.  %@NL@%
  9441.  
  9442. The %@AI@%flags%@AE@% field specifies D, which means the segment is moveable and
  9443. discardable.  %@NL@%
  9444.  
  9445. The %@AI@%chain%@AE@% field specifies the previous and next addresses in the LRU list.  %@NL@%
  9446.  
  9447.  
  9448. %@2@%%@CR:C6A00090036 @%%@AB@%.reboot ─ Reboot Target System%@AE@%%@EH@%%@NL@%
  9449. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9450.  
  9451.  
  9452. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9453.  
  9454. %@AS@%  .reboot%@AE@%
  9455.  
  9456. The %@AB@%.reboot%@AE@% command causes the target system to reboot.  %@NL@%
  9457.  
  9458.  
  9459. %@2@%%@CR:C6A00090037 @%%@AB@%bc ─ Clear Breakpoints%@AE@%%@EH@%%@NL@%
  9460. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9461.  
  9462.  
  9463. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9464.  
  9465. %@AS@%  bc {list | *}%@AE@%
  9466.  
  9467. The %@AB@%bc%@AE@% command removes one or more defined breakpoints.  %@NL@%
  9468.  
  9469. %@TH:   9   534 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%list%@AE@%                              Specifies any combination of integer                                   values in the range 0-9. If you specify %@AI@%%@AE@%                                  %@AI@%list%@AE@%, the debugger removes the specified                                  breakpoints.*                                 Clears all breakpoints.%@TE:   9   534 02 34 42 @%
  9470.  
  9471.  
  9472. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9473.  
  9474. %@AS@%  bc 0 4 8%@AE@%
  9475.  
  9476. Removes breakpoints 0, 4, and 8.  %@NL@%
  9477.  
  9478. %@AS@%  bc *%@AE@%
  9479.  
  9480. Removes all breakpoints.  %@NL@%
  9481.  
  9482.  
  9483. %@2@%%@CR:C6A00090038 @%%@AB@%bd ─ Disable Breakpoints%@AE@%%@EH@%%@NL@%
  9484. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9485.  
  9486.  
  9487. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9488.  
  9489. %@AS@%  bd {list | *}%@AE@%
  9490.  
  9491. The %@AB@%bd%@AE@% command temporarily disables one or more breakpoints. To restore
  9492. breakpoints disabled by the %@AB@%bd%@AE@% command, use the %@AB@%be%@AE@% (Enable Breakpoints)
  9493. command.  %@NL@%
  9494.  
  9495. %@TH:   9   538 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%list%@AE@%                              Specifies any combination of integer                                   values in the range 0-9. If you specify %@AI@%%@AE@%                                  %@AI@%list%@AE@%, the debugger disables the                                   specified breakpoints.*                                 Disables all breakpoints.%@TE:   9   538 02 34 42 @%
  9496.  
  9497.  
  9498. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9499.  
  9500. %@AS@%  bd 0 4 8%@AE@%
  9501.  
  9502. Disables breakpoints 0, 4, and 8.  %@NL@%
  9503.  
  9504. %@AS@%  bd *%@AE@%
  9505.  
  9506. Disables all breakpoints.  %@NL@%
  9507.  
  9508.  
  9509. %@2@%%@CR:C6A00090039 @%%@AB@%be ─ Enable Breakpoints%@AE@%%@EH@%%@NL@%
  9510. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9511.  
  9512.  
  9513. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9514.  
  9515. %@AS@%  be {list | *}%@AE@%
  9516.  
  9517. The %@AB@%be%@AE@% command restores (enables) one or more breakpoints that have been
  9518. temporarily disabled by a %@AB@%bd%@AE@% (Disable Breakpoints) command.  %@NL@%
  9519.  
  9520. %@TH:   9   536 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%list%@AE@%                              Specifies any combination of integer                                   values in the range 0-9. If you specify %@AI@%%@AE@%                                  %@AI@%list%@AE@%, the debugger enables the specified                                  breakpoints. *                                 Enables all breakpoints.%@TE:   9   536 02 34 42 @%
  9521.  
  9522.  
  9523. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9524.  
  9525. %@AS@%  be 0 4 8%@AE@%
  9526.  
  9527. Enables breakpoints 0, 4, and 8.  %@NL@%
  9528.  
  9529. %@AS@%  be *%@AE@%
  9530.  
  9531. Enables all breakpoints.  %@NL@%
  9532.  
  9533.  
  9534. %@2@%%@CR:C6A00090040 @%%@AB@%bl ─ List Breakpoints%@AE@%%@EH@%%@NL@%
  9535. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9536.  
  9537.  
  9538. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9539.  
  9540. %@AS@%  bl%@AE@%
  9541.  
  9542. The %@AB@%bl%@AE@% command lists current information about all breakpoints created by
  9543. the%@AB@% bp %@AE@%(Set Breakpoints) command.  %@NL@%
  9544.  
  9545.  
  9546. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9547.  
  9548. If no breakpoints are currently defined, the debugger displays nothing.
  9549. Otherwise, the breakpoint number, enabled status, breakpoint address, number
  9550. of passes remaining, initial number of passes (in parentheses), and any
  9551. optional debugger commands to be executed when the breakpoint is reached are
  9552. displayed on the screen, as in the following example:  %@NL@%
  9553.  
  9554. %@AS@%  0 e 04BA:0100
  9555. %@AS@%  4 d 04BA:0503 4 (10)
  9556. %@AS@%  8 e 0D2D:0001 3 (3) "R;DB DS:SI"
  9557. %@AS@%  9 e xxxx:0012%@AE@%
  9558.  
  9559. In this example, breakpoints 0 and 8 are enabled (e), while 4 is disabled
  9560. (d). Breakpoint 4 had an initial pass count of 10 and has 4 remaining passes
  9561. to be taken before the breakpoint. Breakpoint 8 had an initial pass count of
  9562. 3 and must make all 3 passes before it halts execution and forces the
  9563. debugger to execute the optional debugger commands enclosed in quotation
  9564. marks. Breakpoint 0 shows no initial pass count, which means it was set to
  9565. 1.  %@NL@%
  9566.  
  9567. Breakpoint 9 shows a virtual breakpoint (a breakpoint set in a segment that
  9568. has not been loaded into memory).  %@NL@%
  9569.  
  9570.  
  9571. %@2@%%@CR:C6A00090041 @%%@AB@%bp ─ Set Breakpoints%@AE@%%@EH@%%@NL@%
  9572. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9573.  
  9574.  
  9575. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9576.  
  9577. %@AS@%  bp«n» addr «passcnt» «"cmds"»%@AE@%
  9578.  
  9579. The %@AB@%bp%@AE@% command creates a software breakpoint at an address. During program
  9580. execution, software breakpoints stop program execution and force the
  9581. debugger to execute the default or optional command string. Unlike
  9582. breakpoints created by the %@AB@%g%@AE@% (Go) command, software breakpoints remain in
  9583. memory until you remove them with the %@AB@%bc %@AE@%(Clear Breakpoints) command or
  9584. temporarily disable them with the%@AB@% bd%@AE@% (Disable Breakpoints) command.  %@NL@%
  9585.  
  9586. The debugger allows up to 10 software breakpoints (0-9). If you specify more
  9587. than 10 breakpoints, the debugger returns a "Too Many Breakpoints" message.
  9588. The %@AI@%addr%@AE@% parameter is required for all new breakpoints.  %@NL@%
  9589.  
  9590. %@TH:  23  1428 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%n%@AE@%                                 Specifies which breakpoint is being                                   created. No space is allowed between the                                  %@AB@%bp%@AE@% and %@AI@%n%@AE@%. If %@AI@%n%@AE@% is omitted, the first                                   available breakpoint number is used. %@AI@%addr%@AE@%                              Specifies any valid instruction address                                   (the first byte of an instruction                                   opcode).%@AI@%passcnt%@AE@%                           Specifies the number of times the                                   breakpoint is to be ignored before being                                  executed. It can be any 16-bit value.%@AI@%cmds%@AE@%                              Specifies an optional list of debugger                                   commands to be executed in place of the                                   default command when the breakpoint is                                   reached. You must enclose optional                                   commands in quotation marks, and                                   separate optional commands with                                   semicolons (;).%@TE:  23  1428 02 34 42 @%
  9591.  
  9592.  
  9593. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9594.  
  9595. %@AS@%  bp 123%@AE@%
  9596.  
  9597. The first example creates a breakpoint at address CS:123.  %@NL@%
  9598.  
  9599. %@AS@%  bp8 400:23 "db DS:SI"%@AE@%
  9600.  
  9601. This example creates breakpoint 8 at address 400:23 and executes a %@AB@%db%@AE@%
  9602. (Display Bytes) command.  %@NL@%
  9603.  
  9604. %@AS@%  bp 100 10 "r;c100 L 100 300"%@AE@%
  9605.  
  9606. This example creates a breakpoint at address 100 in the current CS selector
  9607. and displays the registers before comparing a block of memory. The
  9608. breakpoint is ignored 16 (10H) times before being executed.  %@NL@%
  9609.  
  9610.  
  9611. %@2@%%@CR:C6A00090042 @%%@AB@%c ─ Compare Memory%@AE@%%@EH@%%@NL@%
  9612. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9613.  
  9614.  
  9615. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9616.  
  9617. %@AS@%  c range addr%@AE@%
  9618.  
  9619. The %@AB@%c%@AE@% command compares one memory location against another memory location.
  9620. %@NL@%
  9621.  
  9622. If the two memory areas are identical, the debugger displays nothing and
  9623. returns the debugger prompt. Differences, when they exist, are displayed as
  9624. follows:  %@NL@%
  9625.  
  9626. %@AS@%  addr1 byte1 byte2 addr2%@AE@%
  9627.  
  9628. %@TH:   9   536 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the block of memory that is to                                  be compared with a block of memory                                   starting at %@AI@%addr%@AE@%. %@AI@%addr%@AE@%                              Specifies the starting address of the                                   second block of memory.%@TE:   9   536 02 34 42 @%
  9629.  
  9630.  
  9631. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9632.  
  9633. The following two commands have the same effect. Each compares the block of
  9634. memory from 100H to 1FFH with the block of memory from 300H to 3FFH:  %@NL@%
  9635.  
  9636. %@AS@%  c100 1FF 300%@AE@%
  9637.  
  9638. This first example specifies a %@AI@%range%@AE@% with a starting address of 100H and an
  9639. ending address of 1FFH. This block of memory is compared with a block of
  9640. memory of the same size starting at 300H.  %@NL@%
  9641.  
  9642. %@AS@%  c100 L 100 300%@AE@%
  9643.  
  9644. The second example compares the same block of memory, but specifies the
  9645. %@AI@%range%@AE@% by using the%@AB@% L%@AE@% (length) option.  %@NL@%
  9646.  
  9647.  
  9648. %@2@%%@CR:C6A00090043 @%%@AB@%d ─ Display Memory%@AE@%%@EH@%%@NL@%
  9649. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9650.  
  9651.  
  9652. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9653.  
  9654. %@AS@%  d «range»%@AE@%
  9655.  
  9656. The%@AB@% d%@AE@% command displays the contents of memory at a given address or in a
  9657. range of addresses. The%@AB@% d%@AE@% command displays one or more lines, depending on
  9658. the %@AI@%range%@AE@% given. Each line displays the address of the first item displayed.
  9659. The command always displays at least one value. The memory display is in the
  9660. format defined by a previously executed %@AB@%db%@AE@% (Display Bytes), %@AB@%dd%@AE@% (Display
  9661. Doublewords), or %@AB@%dw%@AE@% (Display Words) command. Each subsequent %@AB@%d%@AE@% (typed
  9662. without parameters) displays the bytes immediately following those last
  9663. displayed.  %@NL@%
  9664.  
  9665. %@TH:   9   656 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to                                   display. If you omit %@AI@%range%@AE@%, the %@AB@%d%@AE@%                                   command displays the next byte of memory                                  after the last one displayed. The %@AB@%d%@AE@%                                   command must be separated by at least                                   one space from any %@AI@%range%@AE@% value. %@TE:   9   656 02 34 42 @%
  9666.  
  9667.  
  9668. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9669.  
  9670. %@AS@%  d CS:100 L 20%@AE@%
  9671.  
  9672. This example displays 20H bytes at CS:100.  %@NL@%
  9673.  
  9674. %@AS@%  d CS:100 115%@AE@%
  9675.  
  9676. This example displays all the bytes in the range 100H to 115H in the CS
  9677. selector.  %@NL@%
  9678.  
  9679.  
  9680. %@2@%%@CR:C6A00090044 @%%@AB@%db ─ Display Bytes%@AE@%%@EH@%%@NL@%
  9681. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9682.  
  9683.  
  9684. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9685.  
  9686. %@AS@%  db «range»%@AE@%
  9687.  
  9688. The %@AB@%db%@AE@% command displays the values of the bytes at a given address or in a
  9689. given range.  %@NL@%
  9690.  
  9691. The display is in two portions: a hexadecimal display (each byte is shown in
  9692. hexadecimal value) and an ASCII display (the bytes are shown in ASCII
  9693. characters). Nonprinting characters are denoted by a period (.) in the ASCII
  9694. portion of the display. Each display line shows 16 bytes, with a hyphen
  9695. between the eighth and ninth bytes. Each displayed line begins on a 16-byte
  9696. boundary.  %@NL@%
  9697.  
  9698. %@TH:   8   556 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to                                   display. If you omit %@AI@%range%@AE@%, 128 bytes                                   are displayed beginning at the first                                   address after the address displayed by                                   the previous %@AB@%db%@AE@% command. %@TE:   8   556 02 34 42 @%
  9699.  
  9700.  
  9701. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9702.  
  9703. %@AS@%  db CS:100 0A%@AE@%
  9704.  
  9705. This example displays the lines in the following format:  %@NL@%
  9706.  
  9707. %@AS@%  04BA:0100 54 4F 4D 20 53  . . . 45 52 TOM SAWYER%@AE@%
  9708.  
  9709. Each line of the display begins with an address, incremented by 10H from the
  9710. address on the previous line.  %@NL@%
  9711.  
  9712.  
  9713. %@2@%%@CR:C6A00090045 @%%@AB@%dd ─ Display Doublewords%@AE@%%@EH@%%@NL@%
  9714. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9715.  
  9716.  
  9717. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9718.  
  9719. %@AS@%  dd «range»%@AE@%
  9720.  
  9721. The %@AB@%dd%@AE@% command displays the hexadecimal values of the doublewords at the
  9722. address specified or in the specified range of addresses.  %@NL@%
  9723.  
  9724. The %@AB@%dd%@AE@% command displays one or more lines, depending on the %@AI@%range%@AE@% given.
  9725. Each line displays the address of the first doubleword in the line, followed
  9726. by up to four hexadecimal doubleword values. The hexadecimal values are
  9727. separated by spaces. The%@AB@% dd%@AE@% command displays values until the end of the
  9728. %@AI@%range%@AE@% or until the first 32 doublewords have been displayed.  %@NL@%
  9729.  
  9730. Typing %@AB@%dd%@AE@% displays 32 doublewords at the current dump address. For example,
  9731. if the last byte in the previous%@AB@% dd%@AE@% command was 04BA:0110, the display
  9732. starts at 04BA:0111.  %@NL@%
  9733.  
  9734. %@TH:   8   567 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to                                   display. If you omit %@AI@%range%@AE@%, 32 %@AB@%DWORD%@AE@%s                                   are displayed beginning at the first                                   address after the address displayed by                                   the previous %@AB@%dd%@AE@% command.%@TE:   8   567 02 34 42 @%
  9735.  
  9736.  
  9737. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9738.  
  9739. %@AS@%  dd CS:100 110%@AE@%
  9740.  
  9741. This example displays the doubleword values from CS:100 to CS:110. The
  9742. resulting display is similar to the following:  %@NL@%
  9743.  
  9744. %@AS@%  04BA:0100 7473:2041 676E:6972 5405:0104 0A0D:7865
  9745. %@AS@%  04BA:0110 0000:002E%@AE@%
  9746.  
  9747. No more than four values per line are displayed.  %@NL@%
  9748.  
  9749.  
  9750. %@2@%%@CR:C6A00090046 @%%@AB@%dg ─ Display GDT%@AE@%%@EH@%%@NL@%
  9751. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9752.  
  9753.  
  9754. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9755.  
  9756. %@AS@%  dg«a» «range»%@AE@%
  9757.  
  9758. The %@AB@%dg%@AE@% command displays the specified range of entries in the GDT (Global
  9759. Descriptor Table).  %@NL@%
  9760.  
  9761. %@TH:  13   855 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of entries in the                                   GDT. If you omit %@AI@%range%@AE@%, the debugger                                   displays the entire contents of the GDT.%@AB@%a%@AE@%                                 Causes all entries in the table to be                                   displayed, not just the valid entries.                                   The default is to display just the valid                                  GDT entries. If the command is passed an                                  LDT selector, it displays LDT and the                                   appropriate LDT entry. %@TE:  13   855 02 34 42 @%
  9762.  
  9763.  
  9764. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9765.  
  9766. %@AS@%  dg 0 40%@AE@%
  9767.  
  9768. This example displays only the valid entries from 0H to 40H in the GDT. The
  9769. resulting display is similar to the following:  %@NL@%
  9770.  
  9771. %@AS@%  0008  Data Seg  Base=01D700 Limit=3677 DPL=0 Present ReadWrite Accessed
  9772. %@AS@%  0010  TSS Desc  Base=007688 Limit=002B DPL=0 Present Busy
  9773. %@AS@%  0018  Data Seg  Base=020D7A Limit=03FF DPL=0 Present ReadWrite 
  9774. %@AS@%  0020  Data Seg  Base=000000 Limit=03FF DPL=0 Present ReadWrite 
  9775. %@AS@%  0028  LDT Desc  Base=000000 Limit=0000 DPL=0 Present 
  9776. %@AS@%  0030  Data Seg  Base=000000 Limit=0000 DPL=0 Present ReadWrite
  9777. %@AS@%  0040  Data Seg  Base=000400 Limit=03BF DPL=3 Present ReadWrite %@AE@%
  9778.  
  9779.  
  9780. %@2@%%@CR:C6A00090047 @%%@AB@%di ─ Display IDT%@AE@%%@EH@%%@NL@%
  9781. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9782.  
  9783.  
  9784. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9785.  
  9786. %@AS@%  di«a» «range»%@AE@%
  9787.  
  9788. The %@AB@%di%@AE@% command displays the specified range of entries in the IDT (Interrupt
  9789. Descriptor Table).  %@NL@%
  9790.  
  9791. %@TH:  11   683 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%a%@AE@%                                 Causes all entries in the table to be                                   displayed, not just the valid ones. The                                   default is to display just the valid IDT                                  entries.%@AI@%range%@AE@%                             Specifies the range of entries to be                                   displayed. If you omit %@AI@%range%@AE@%, the                                   debugger displays all IDT entries.%@TE:  11   683 02 34 42 @%
  9792.  
  9793.  
  9794. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9795.  
  9796. %@AS@%  di 0 10%@AE@%
  9797.  
  9798. This command produces a display of valid entries similar to the following:  %@NL@%
  9799.  
  9800. %@AS@%  0000  Int Gate  Sel=1418    Offst=03D8 DPL=3 Present
  9801. %@AS@%  0001  Int Gate  Sel=2D38    Offst=0049 DPL=3 Present 
  9802. %@AS@%  0002  Int Gate  Sel=1418    Offst=03E4 DPL=3 Present 
  9803. %@AS@%  0003  Int Gate  Sel=2D38    Offst=006F DPL=3 Present 
  9804. %@AS@%  0004  Int Gate  Sel=1418    Offst=0417 DPL=3 Present 
  9805. %@AS@%  0005  Int Gate  Sel=1418    Offst=041D DPL=3 Present 
  9806. %@AS@%  0006  Int Gate  Sel=1418    Offst=0423 DPL=3 Present 
  9807. %@AS@%  0007  Int Gate  Sel=2D38    Offst=00A3 DPL=3 Present 
  9808. %@AS@%  0008  Int Gate  Sel=1418    Offst=042F DPL=3 Present 
  9809. %@AS@%  0009  Int Gate  Sel=2D38    Offst=00CA DPL=3 Present 
  9810. %@AS@%  000A  Int Gate  Sel=2D38    Offst=00D3 DPL=3 Present 
  9811. %@AS@%  000B  Int Gate  Sel=2D38    Offst=0156 DPL=3 Present 
  9812. %@AS@%  000C  Int Gate  Sel=2D38    Offst=01A4 DPL=3 Present 
  9813. %@AS@%  000D  Int Gate  Sel=2D38    Offst=01C6 DPL=3 Present %@AE@%
  9814.  
  9815.  
  9816. %@2@%%@CR:C6A00090048 @%%@AB@%dl ─ Display LDT%@AE@%%@EH@%%@NL@%
  9817. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9818.  
  9819.  
  9820. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9821.  
  9822. %@AS@%  dl«a | p | s | h» «range»%@AE@%
  9823.  
  9824. The %@AB@%dl%@AE@% command displays the specified range of entries in the LDT (Local
  9825. Descriptor Table).  %@NL@%
  9826.  
  9827. %@TH:  26  1507 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%a%@AE@%                                 Causes all entries in the table to be                                   displayed, not just the valid ones. The                                   default is to display just the valid LDT                                  entries. If the command is passed a GDT                                   selector, it displays GDT and the                                   appropriate GDT entry. %@AB@%p%@AE@%                                 Causes private segment selectors to be                                   displayed. %@AB@%s%@AE@%                                 Causes shared segment selectors to be                                   displayed.%@AB@%h%@AE@%                                 Causes huge segment selectors to be                                   displayed. To display the huge segment                                   selectors, give the shadow selector                                   followed by the maximum number of                                   selectors reserved for that segment plus                                  1.%@AI@%range%@AE@%                             Specifies the range of entries to be                                   displayed. If you omit %@AI@%range%@AE@%, the entire                                  table is displayed.%@TE:  26  1507 02 34 42 @%
  9828.  
  9829.  
  9830. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9831.  
  9832. %@AS@%  dla 4 57%@AE@%
  9833.  
  9834. This example displays all of the LDT entries. The command produces a display
  9835. similar to the following:  %@NL@%
  9836.  
  9837. %@AS@%  0014  Call Gate Sel=1418    Offst=0417 DPL=0 NotPres WordCount=1D
  9838. %@AS@%  001C  Code Seg  Base=051418 Limit=0423 DPL=0 NotPres ExecOnly  
  9839. %@AS@%  0027  Reserved  Base=87F000 Limit=FEA5 DPL=3 Present 
  9840. %@AS@%  0034  Code Seg  Base=05F000 Limit=1805 DPL=0 NotPres ExecOnly
  9841. %@AS@%  003C  Code Seg  Base=05F000 Limit=EF57 DPL=0 NotPres ExecOnly
  9842. %@AS@%  0047  Code Seg  Base=4DC000 Limit=0050 DPL=3 Present ExecOnly
  9843. %@AS@%  004D  Reserved  Base=71F000 Limit=F841 DPL=1 NotPres
  9844. %@AS@%  0057  Code Seg  Base=59F000 Limit=E739 DPL=3 Present ExecOnly %@AE@%
  9845.  
  9846.  
  9847. %@2@%%@CR:C6A00090049 @%%@AB@%dt ─ Display TSS%@AE@%%@EH@%%@NL@%
  9848. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9849.  
  9850.  
  9851. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9852.  
  9853. %@AS@%  dt «addr»%@AE@%
  9854.  
  9855. The %@AB@%dt%@AE@% command displays the current TSS (Task State Segment) or the selected
  9856. TSS if you specify the optional address.  %@NL@%
  9857.  
  9858. %@TH:   7   471 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%addr%@AE@%                              Specifies the address of the TSS to                                   display. If no %@AI@%addr%@AE@% is given, %@AB@%dt%@AE@%                                   displays the current TSS pointed to by                                   the TR register. %@TE:   7   471 02 34 42 @%
  9859.  
  9860.  
  9861. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9862.  
  9863. %@AS@%  dt%@AE@%
  9864.  
  9865. This example displays the current TSS. The resulting display is similar to
  9866. the following:  %@NL@%
  9867.  
  9868. %@AS@%  AX=0000   BX=0000   CX=0000   DX=0000   SP=0000   BP=0000   SI=0000
  9869. %@AS@%DI=0000
  9870. %@AS@%  IP=0000   CS=0000   DS=0000   ES=0000   SS=0000   NV UP DI PL NZ NA PO NC
  9871. %@AS@%  SS0=0038  SP0=08DE  SS1=0000  SP1=0000  SS2=0000  SP2=0000
  9872. %@AS@%  IOPL=0    LDTR=0028 LINK=0000%@AE@%
  9873.  
  9874.  
  9875. %@2@%%@CR:C6A00090050 @%%@AB@%dw ─ Display Words%@AE@%%@EH@%%@NL@%
  9876. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9877.  
  9878.  
  9879. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9880.  
  9881. %@AS@%  dw «range»%@AE@%
  9882.  
  9883. The %@AB@%dw%@AE@% command displays the hexadecimal values of the words at a given
  9884. address or in a given range of addresses.  %@NL@%
  9885.  
  9886. The command displays one or more lines, depending on the %@AI@%range%@AE@% given. Each
  9887. line displays the address of the first word in the line, followed by up to
  9888. eight hexadecimal word values. The hexadecimal values are separated by
  9889. spaces. The command displays values until the end of the %@AI@%range%@AE@% or until the
  9890. first 64 words have been displayed.  %@NL@%
  9891.  
  9892. Typing %@AB@%dw%@AE@% displays 64 words at the current dump address. If the last word in
  9893. the previous %@AB@%dw%@AE@% command was displayed at address 04BA:0110, the next display
  9894. will start at 04BA:0112.  %@NL@%
  9895.  
  9896. %@TH:   8   552 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to                                   display. If you omit %@AI@%range%@AE@%, 64 words are                                  displayed beginning at the first address                                  after the address displayed by the                                   previous %@AB@%dw%@AE@% command.%@TE:   8   552 02 34 42 @%
  9897.  
  9898.  
  9899. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9900.  
  9901. %@AS@%  dw CS:100 110%@AE@%
  9902.  
  9903. This example displays the word values from CS:100 to CS:110, resulting in a
  9904. display similar to the following:  %@NL@%
  9905.  
  9906. %@AS@%  04BA:0100 2041 7473 6972 676E 0104 5404 7865 0A0D
  9907. %@AS@%  04BA:0110 002E%@AE@%
  9908.  
  9909.  
  9910. %@2@%%@CR:C6A00090051 @%%@AB@%e ─ Enter Byte%@AE@%%@EH@%%@NL@%
  9911. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9912.  
  9913.  
  9914. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9915.  
  9916. %@AS@%  e addr «list»%@AE@%
  9917.  
  9918. The %@AB@%e%@AE@% command enters byte values into memory at a specified address. You can
  9919. specify the new values on the command line, or let the debugger prompt you
  9920. for values. If the debugger uses a prompt, it displays the address and its
  9921. contents and then waits for you to perform one of the following actions:  %@NL@%
  9922.  
  9923.  
  9924.   ■   Replace a byte value with a value you type. Type the value after the
  9925.       current value. If the byte you type is an illegal hexadecimal value or
  9926.       contains more than two digits, the system does not echo the illegal or
  9927.       extra character. %@NL@%
  9928.  
  9929.   ■   Press the SPACEBAR to advance to the next byte. To change the value,
  9930.       type the new value after the current value. If, when you press the
  9931.       SPACEBAR, you move beyond an 8-byte boundary, the 80386 Debugger
  9932.       starts a new display line with the address displayed at the beginning.
  9933.       %@NL@%
  9934.  
  9935.   ■   Type a hyphen (-) to return to the preceding byte. If you decide to
  9936.       change a byte before the current position, typing the hyphen returns
  9937.       the current position to the previous byte. When you type the hyphen, a
  9938.       new line is started with its address and byte value displayed. %@NL@%
  9939.  
  9940.   ■   Press ENTER to terminate the %@AB@%e%@AE@% command. You can press ENTER at any
  9941.       byte position. 
  9942. %@TH:  11   678 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%addr%@AE@%                              Specifies the address of the first byte                                   to be entered.%@AI@%list%@AE@%                              Specifies the byte values used for                                   replacement. These values are inserted                                   automatically. If an error occurs when                                   you are using the list form of the                                   command, no byte values are changed.%@TE:  11   678 02 34 42 @%
  9943.  
  9944. %@NL@%
  9945.  
  9946.  
  9947.  
  9948. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  9949.  
  9950. %@AS@%  eCS:100
  9951. %@AS@%  04BA:0100 EB.%@AE@%
  9952.  
  9953. This example prompts you to change the value EB at CS:100. To step through
  9954. the subsequent bytes without changing values, press the SPACEBAR.  %@NL@%
  9955.  
  9956. %@AS@%  04BA:0100 EB.41  10. 00. BC.%@AE@%
  9957.  
  9958. In this example, the SPACEBAR is pressed three times.  %@NL@%
  9959.  
  9960. To return to a value at a previous address, type a hyphen.  %@NL@%
  9961.  
  9962. %@AS@%  04BA:0100  EB.41    10. 00. BC.-
  9963. %@AS@%  04BA:0102  00.-
  9964. %@AS@%  04BA:0101  10.%@AE@%
  9965.  
  9966. This example returns to the address CS:101.  %@NL@%
  9967.  
  9968.  
  9969. %@2@%%@CR:C6A00090052 @%%@AB@%f ─ Fill Memory%@AE@%%@EH@%%@NL@%
  9970. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9971.  
  9972.  
  9973. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9974.  
  9975. %@AS@%  f range list%@AE@%
  9976.  
  9977. The %@AB@%f%@AE@% command fills the addresses in a specified range with the values in
  9978. the specified list.  %@NL@%
  9979.  
  9980. %@TH:  17  1214 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to be                                   filled. If %@AI@%range%@AE@% contains more bytes                                   than the number of values in %@AI@%list%@AE@%, the                                   debugger uses %@AI@%list%@AE@% repeatedly until all                                   bytes in %@AI@%range%@AE@% are filled. If any of the                                  memory in %@AI@%range%@AE@% is not valid (bad or                                   nonexistent), an error will occur in all                                  succeeding locations. %@AI@%list%@AE@%                              Specifies the list of values to fill the                                  given %@AI@%range%@AE@%. If %@AI@%list%@AE@% contains more                                   values than the number of bytes in %@AI@%range%@AE@%,                                  the debugger ignores the extra values in                                  %@AI@%list%@AE@%. %@TE:  17  1214 02 34 42 @%
  9981.  
  9982.  
  9983. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  9984.  
  9985. %@AS@%  f04BA:100 L 100 42 45 52 54 41%@AE@%
  9986.  
  9987. This example fills memory locations 04BA:100 through 04BA:1FF with the bytes
  9988. specified, repeating the five values until it has filled all 100H bytes.  %@NL@%
  9989.  
  9990.  
  9991. %@2@%%@CR:C6A00090053 @%%@AB@%g ─ Go%@AE@%%@EH@%%@NL@%
  9992. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  9993.  
  9994.  
  9995. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  9996.  
  9997. %@AS@%  g «=addr «addr...»»%@AE@%
  9998.  
  9999. The %@AB@%g%@AE@% command executes the program currently in memory. If you type the %@AB@%g%@AE@%
  10000. command by itself, the current program executes as if it had run outside the
  10001. debugger. If you specify %@AB@%=%@AE@%%@AI@%addr%@AE@%, execution begins at the specified address.  %@NL@%
  10002.  
  10003. Specifying an optional breakpoint address causes execution to halt at the
  10004. first address encountered, regardless of the position of the address in the
  10005. list of addresses that halts execution or program branching. When program
  10006. execution reaches a breakpoint, the default command string is executed.  %@NL@%
  10007.  
  10008. The stack (SS:SP) must be valid and have six bytes available for this
  10009. command. The %@AB@%g%@AE@% command uses an %@AB@%IRET%@AE@% instruction to cause a jump to the
  10010. program under test. The stack is set, and the user flags, CS register, and
  10011. IP register are pushed on the user stack. (If the user stack is not valid or
  10012. is too small, the operating environment may crash.) An interrupt code (0CCH)
  10013. is placed at the specified breakpoint addresses.  %@NL@%
  10014.  
  10015. When the debugger encounters an instruction with the breakpoint code, it
  10016. restores all breakpoint addresses listed with the %@AB@%g%@AE@% command to their
  10017. original instructions. If you do not halt execution at one of the
  10018. breakpoints, the interrupt codes are not replaced with the original
  10019. instructions.  %@NL@%
  10020.  
  10021. %@TH:  15   990 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%=%@AE@%%@AI@%addr%@AE@%                             Specifies the address where execution is                                  to begin. The equal sign (=) is needed                                   to distinguish the starting address from                                  the breakpoint address. %@AI@%addr%@AE@%                              Specifies one or more breakpoint                                   addresses where execution is to halt.                                   You can specify up to 10 breakpoints,                                   but only at addresses containing the                                   first byte of an opcode. If you attempt                                   to set more than 10 breakpoints, an                                   error message will be displayed. %@TE:  15   990 02 34 42 @%
  10022.  
  10023.  
  10024. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10025.  
  10026. %@AS@%  gCS:7550%@AE@%
  10027.  
  10028. This example executes the program currently in memory until address 7550 in
  10029. the CS selector is executed. The debugger then executes the default command
  10030. string, removes the INT 3 trap from this address, and restores the original
  10031. instruction. When you resume execution, the original instruction will be
  10032. executed.  %@NL@%
  10033.  
  10034.  
  10035. %@2@%%@CR:C6A00090054 @%%@AB@%h ─ Hexadecimal Arithmetic%@AE@%%@EH@%%@NL@%
  10036. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10037.  
  10038.  
  10039. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10040.  
  10041. %@AS@%  h word word%@AE@%
  10042.  
  10043. The %@AB@%h%@AE@% command performs hexadecimal arithmetic on the two specified
  10044. parameters.  %@NL@%
  10045.  
  10046. The debugger adds, subtracts, multiplies, and divides the second parameter
  10047. and the first parameter, then displays the results on one line. The debugger
  10048. does 32-bit multiplication and displays the result as doublewords. The
  10049. debugger displays the result of division as a 16-bit quotient and a 16-bit
  10050. remainder.  %@NL@%
  10051.  
  10052. %@TH:   3   223 02 19 57 @%Parameter          Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%word%@AE@%               Specifies two 16-bit word parameters.%@TE:   3   223 02 19 57 @%
  10053.  
  10054.  
  10055. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10056.  
  10057. %@AS@%  h 300 100%@AE@%
  10058.  
  10059. This example performs the calculations and displays the following:  %@NL@%
  10060.  
  10061. %@AS@%  +0400  -0200 *0000 0003 /0003 0000%@AE@%
  10062.  
  10063.  
  10064. %@2@%%@CR:C6A00090055 @%%@AB@%i ─ Input Byte%@AE@%%@EH@%%@NL@%
  10065. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10066.  
  10067.  
  10068. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10069.  
  10070. %@AS@%  i word%@AE@%
  10071.  
  10072. The %@AB@%i%@AE@% command inputs and displays one byte from a specified port.  %@NL@%
  10073.  
  10074. %@TH:   3   222 02 20 56 @%Parameter           Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%word%@AE@%                Specifies the 16-bit port address.%@TE:   3   222 02 20 56 @%
  10075.  
  10076.  
  10077. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10078.  
  10079. %@AS@%  i2F8%@AE@%
  10080.  
  10081. This example displays the byte at port address 2F8H.  %@NL@%
  10082.  
  10083.  
  10084. %@2@%%@CR:C6A00090056 @%%@AB@%j ─ Conditional Execute%@AE@%%@EH@%%@NL@%
  10085. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10086.  
  10087.  
  10088. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10089.  
  10090. %@AS@%  j expr «"cmds"»%@AE@%
  10091.  
  10092. The %@AB@%j%@AE@% command executes the specified commands when the specified expression
  10093. is TRUE. If %@AI@%expr%@AE@% is FALSE, the debugger continues to the next command line
  10094. (excluding the commands in %@AI@%cmds%@AE@%).  %@NL@%
  10095.  
  10096. The %@AB@%j%@AE@% command is useful in breakpoint commands to conditionally break
  10097. execution when an expression becomes true.  %@NL@%
  10098.  
  10099. %@TH:  12   776 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%expr%@AE@%                              Evaluates to a Boolean TRUE or FALSE.%@AI@%cmds%@AE@%                              Specifies a list of debugger commands to                                  be executed when %@AI@%expr%@AE@% is TRUE. The list                                   must be enclosed in single or double                                   quotation marks. You must separate                                   optional commands with semicolons (;).                                   You can use a single or NULL command                                   without quotation marks.%@TE:  12   776 02 34 42 @%
  10100.  
  10101.  
  10102. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10103.  
  10104. %@AS@%  bp 167:1454 "J AX == 0;G"%@AE@%
  10105.  
  10106. This example causes execution to break if AX does not equal zero when the
  10107. breakpoint is reached.  %@NL@%
  10108.  
  10109. %@AS@%  bp 167:1462 "J BY (DS:SI+3) == 40 'R;G';DG DS"%@AE@%
  10110.  
  10111. This example displays the registers and continues execution when the byte
  10112. pointed to by DS:SI +3 is equal to 40H; otherwise, it displays the
  10113. descriptor table.  %@NL@%
  10114.  
  10115. %@AS@%  bp 156:1455 "J (MSW AND 1) == 1 'G'"%@AE@%
  10116.  
  10117. This example breaks execution when the breakpoint is reached in real mode.  %@NL@%
  10118.  
  10119. %@AS@%  bp 156:1455 "J (MSW AND 1) 'G'" %@AE@%
  10120.  
  10121. This example is a shortcut that produces the same results as the preceding
  10122. command.  %@NL@%
  10123.  
  10124.  
  10125. %@2@%%@CR:C6A00090057 @%%@AB@%k ─ Backtrace Stack%@AE@%%@EH@%%@NL@%
  10126. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10127.  
  10128.  
  10129. %@3@%%@AB@%Syntax%@CR:C6A00090058 @%%@AE@%%@EH@%%@NL@%
  10130.  
  10131. %@AS@%  k «ss:bp» «cs:ip»%@AE@%
  10132.  
  10133. This command displays the current stack frame. Each line shows the name of a
  10134. procedure, its arguments, and the address of the statement that called it.
  10135. The command displays four 2-byte arguments by default. The %@AB@%ka%@AE@% command
  10136. changes the number of arguments displayed by this command.  %@NL@%
  10137.  
  10138. Using the %@AB@%k%@AE@% command at the beginning of a function (before the function
  10139. prolog has been executed) will give incorrect results. The command uses the
  10140. BP register to compute the current backtrace, and this register is not
  10141. correctly set for a function until its prolog has been executed.%@CR:C6A00090059 @%%@NL@%
  10142.  
  10143. %@TH:   4   289 02 17 59 @%Parameter        Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%ss:bp%@AE@%            Specifies an optional stack-frame address.%@AI@%cs:ip%@AE@%            Specifies an optional code address.%@TE:   4   289 02 17 59 @%
  10144.  
  10145.  
  10146. %@2@%%@CR:C6A00090060 @%%@AB@%ka ─ Set Backtrace Arguments%@AE@%%@EH@%%@NL@%
  10147. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10148.  
  10149.  
  10150. %@3@%%@AB@%Syntax%@CR:C6A00090061 @%%@AE@%%@EH@%%@NL@%
  10151.  
  10152. %@AS@%  ka value%@AE@%
  10153.  
  10154. The %@AB@%ka%@AE@% command sets the number of parameters displayed for all subsequent
  10155. stack trace commands. The initial default is four.  %@NL@%
  10156.  
  10157. %@TH:   6   399 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%value%@AE@%                             Specifies the number of parameters to be                                  displayed. The %@AI@%value%@AE@% parameter must be                                   in the range 0 to 31.%@TE:   6   399 02 34 42 @%
  10158.  
  10159.  
  10160. %@2@%%@CR:C6A00090062 @%%@AB@%kt ─ Backtrace Task Stack%@AE@%%@EH@%%@NL@%
  10161. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10162.  
  10163.  
  10164. %@3@%%@AB@%Syntax%@CR:C6A00090063 @%%@CR:C6A00090064 @%%@AE@%%@EH@%%@NL@%
  10165.  
  10166. %@AS@%  kt «tdb»%@AE@%
  10167.  
  10168. This command displays the stack frame of the current task or the task
  10169. specified by %@AI@%tdb%@AE@%. Each line shows the name of a procedure, its arguments,
  10170. and the address of the statement that called it. The command displays four
  10171. 2-byte arguments by default. The %@AB@%ka%@AE@% command changes the number of arguments
  10172. displayed by this command.  %@NL@%
  10173.  
  10174. This command can be combined with the %@AB@%kv%@AE@% command; the syntax for the
  10175. combined command is %@AB@%kvt%@AE@% «%@AI@%tdb%@AE@%».  %@NL@%
  10176.  
  10177. %@TH:  10   743 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%tdb%@AE@%                               Specifies the segment address of the                                   program descriptor block for the task to                                  be traced. To obtain the %@AI@%tdb%@AE@% value, use                                   the .%@AB@%dq%@AE@% (Dump Task Queue) command. If %@AI@%%@AE@%                                  %@AI@%tdb%@AE@% is not supplied, the %@AB@%kt%@AE@% command                                   displays the stack frame of the current                                   task. %@CR:C6A00090065 @%%@TE:  10   743 02 34 42 @%
  10178.  
  10179.  
  10180. %@2@%%@CR:C6A00090066 @%%@AB@%kv ─ Verbose Backtrace Stack%@AE@%%@EH@%%@NL@%
  10181. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10182.  
  10183.  
  10184. %@3@%%@AB@%Syntax%@CR:C6A00090067 @%%@AE@%%@EH@%%@NL@%
  10185.  
  10186. %@AS@%  kv %@AE@%
  10187.  
  10188. The %@AB@%kv%@AE@% command displays information that the %@AB@%k %@AE@%(Backtrace Stack) command
  10189. provides, plus information about stack location and frame pointer values for
  10190. each frame.  %@NL@%
  10191.  
  10192.  
  10193. %@2@%%@CR:C6A00090068 @%%@AB@%la ─ List Absolute Symbols%@AE@%%@EH@%%@NL@%
  10194. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10195.  
  10196.  
  10197. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10198.  
  10199. %@AS@%  la%@AE@%
  10200.  
  10201. The %@AB@%la%@AE@% command lists the absolute symbols in the currently active map.  %@NL@%
  10202.  
  10203.  
  10204. %@2@%%@CR:C6A00090069 @%%@AB@%lg ─ List Groups%@AE@%%@EH@%%@NL@%
  10205. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10206.  
  10207.  
  10208. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10209.  
  10210. %@AS@%  lg%@AE@%
  10211.  
  10212. The %@AB@%lg%@AE@% command lists the selector (or segment) and the name of each group in
  10213. the active map.  %@NL@%
  10214.  
  10215.  
  10216. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10217.  
  10218. %@AS@%  lg%@AE@%
  10219.  
  10220. This example produces a display similar to the following:  %@NL@%
  10221.  
  10222. %@AS@%  #0090:0000 DOSCODE
  10223. %@AS@%  #0828:0000 DOSGROUP
  10224. %@AS@%  #1290:0000 DBGCODE
  10225. %@AS@%  #16C0:0000 DBGDATA
  10226. %@AS@%  #1A38:0000 TASKCODE
  10227. %@AS@%  #1AD8:0000 DOSRING3CODE
  10228. %@AS@%  #1AE0:0000 DOSINITCODE
  10229. %@AS@%  #2018:0000 DOSINITRMCODE
  10230. %@AS@%  #20A8:0000 DOSINITDATA
  10231. %@AS@%  #23F8:0000 DOSMTE 
  10232. %@AS@%  #2420:0000 DOSHIGHDATA
  10233. %@AS@%  #28D0:0000 DOSHIGHCODE
  10234. %@AS@%  #3628:0000 DOSHIGH2CODE
  10235. %@AS@%  #0090:0000 DOSCODE%@AE@%
  10236.  
  10237.  
  10238. %@2@%%@CR:C6A00090070 @%%@AB@%lm ─ List Map%@AE@%%@EH@%%@NL@%
  10239. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10240.  
  10241.  
  10242. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10243.  
  10244. %@AS@%  lm%@AE@%
  10245.  
  10246. The %@AB@%lm%@AE@% command lists the symbol files currently loaded and indicates which
  10247. one is active.  %@NL@%
  10248.  
  10249. The last symbol file loaded is made active by default. Use the %@AB@%w%@AE@% (Change
  10250. Map) command to change the active file.  %@NL@%
  10251.  
  10252.  
  10253. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10254.  
  10255. %@AS@%  lm%@AE@%
  10256.  
  10257. This example returns a display similar to the following:  %@NL@%
  10258.  
  10259. %@AS@%  COMSAM2D is active.
  10260. %@AS@%  DISK01D.%@AE@%
  10261.  
  10262.  
  10263. %@2@%%@CR:C6A00090071 @%%@AB@%ln ─ List Near%@AE@%%@EH@%%@NL@%
  10264. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10265.  
  10266.  
  10267. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10268.  
  10269. %@AS@%  ln «addr»%@AE@%
  10270.  
  10271. The %@AB@%ln%@AE@% command lists the symbol nearest to the specified address. The
  10272. command lists the nearest symbol before and after the specified %@AI@%addr%@AE@%
  10273. parameter.  %@NL@%
  10274.  
  10275. %@TH:   6   374 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%addr%@AE@%                              Specifies any valid instruction address.                                  The default is the current disassembly                                   address.%@TE:   6   374 02 34 42 @%
  10276.  
  10277.  
  10278. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10279.  
  10280. %@AS@%  ln%@AE@%
  10281.  
  10282. This example displays the nearest symbols before and after the current
  10283. disassembly address. The output looks like this:  %@NL@%
  10284.  
  10285. %@AS@%  6787 VerifyRamSemAddr + 10
  10286. %@AS@%  67AA PutRamSemID - 13%@AE@%
  10287.  
  10288.  
  10289. %@2@%%@CR:C6A00090072 @%%@AB@%ls ─ List Symbols%@AE@%%@EH@%%@NL@%
  10290. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10291.  
  10292.  
  10293. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10294.  
  10295. %@AS@%  ls {group-name | name-chars | *}%@AE@%
  10296.  
  10297. The %@AB@%ls%@AE@% command lists the symbols in the specified group, or names that match
  10298. the search specification in all groups. Only the * wildcard is accepted and
  10299. only as the last character (all other characters will be ignored).  %@NL@%
  10300.  
  10301. %@TH:   8   463 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%group-name%@AE@%                        Names the group that contains the                                   symbols you want to list. %@AI@%name-chars%@AE@%                        Displays a list of symbols that begin                                   with the specified characters.%@TE:   8   463 02 34 42 @%
  10302.  
  10303.  
  10304. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10305.  
  10306. %@AS@%  ls DOSRING3CODE
  10307. %@AS@%  ls vkd*
  10308. %@AS@%  ls vmm_base%@AE@%
  10309.  
  10310. The first example displays all of the symbols in the DOSRING3CODE group. The
  10311. debugger displays the symbols in a format similar to the following:  %@NL@%
  10312.  
  10313. %@AS@%  0000 Sigdispatch
  10314. %@AS@%  001A LibInitDisp%@AE@%
  10315.  
  10316. The second example displays all of the symbols that start with the first
  10317. three characters "vkd." This will show the group names as they are searched,
  10318. similar to the following:  %@NL@%
  10319.  
  10320. %@AS@%  GROUP: [0028] CODE
  10321. %@AS@%   60003A74 VKD_Control_Debug
  10322. %@AS@%  GROUP: [0030] DATA
  10323. %@AS@%   6001DFFC VKD_CB_Offset
  10324. %@AS@%  GROUP: [0030} IDATA%@AE@%
  10325.  
  10326. The third example displays the address and group for the symbol "VMM_base."
  10327. %@NL@%
  10328.  
  10329.  
  10330. %@2@%%@CR:C6A00090073 @%%@AB@%m ─ Move Memory%@AE@%%@EH@%%@NL@%
  10331. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10332.  
  10333.  
  10334. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10335.  
  10336. %@AS@%  m range addr%@AE@%
  10337.  
  10338. The %@AB@%m%@AE@% command moves a block of memory from one memory location to another.  %@NL@%
  10339.  
  10340. Overlapping moves─those where part of the block overlaps some of the current
  10341. addresses─are always performed without loss of data. Addresses that could be
  10342. overwritten are moved first. For moves from higher to lower addresses, the
  10343. sequence of events is first to move the data at the block's lowest address
  10344. and then to work toward the highest. For moves from lower to higher
  10345. addresses, the sequence is first to move the data at the block's highest
  10346. address and then to work toward the lowest.  %@NL@%
  10347.  
  10348. Note that if the addresses in the block being moved will not have new data
  10349. written to them, the data in the block %@AI@%before the move%@AE@% will remain. The %@AB@%m%@AE@%
  10350. command copies the data from one area into another, in the sequence
  10351. described, and writes over the new addresses─hence, the importance of the
  10352. moving sequence.  %@NL@%
  10353.  
  10354. To review the results of a memory move, use the %@AB@%d%@AE@% (Display Memory) command,
  10355. specifying the same address you used with the %@AB@%m%@AE@% command.  %@NL@%
  10356.  
  10357. %@TH:   8   443 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the block of memory to be                                   moved.%@AI@%addr%@AE@%                              Specifies the starting address where the                                  memory is to be relocated.%@TE:   8   443 02 34 42 @%
  10358.  
  10359.  
  10360. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10361.  
  10362. %@AS@%  mCS:100 110 CS:500%@AE@%
  10363.  
  10364. This example first moves address CS:110 to CS:510 and then moves CS:10F to
  10365. CS:50F, and so on, until CS:100 is moved to CS:500.  %@NL@%
  10366.  
  10367.  
  10368. %@2@%%@CR:C6A00090074 @%%@AB@%o ─ Output to Port%@AE@%%@EH@%%@NL@%
  10369. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10370.  
  10371.  
  10372. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10373.  
  10374. %@AS@%  o word byte%@AE@%
  10375.  
  10376. The %@AB@%o%@AE@% command writes a byte to a 16-bit port address.  %@NL@%
  10377.  
  10378. %@TH:   4   306 02 13 63 @%Parameter    Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%word%@AE@%         Specifies the 16-bit port address you are writing to. %@AI@%byte%@AE@%         Specifies the 8-bit value to be written to the port.%@TE:   4   306 02 13 63 @%
  10379.  
  10380.  
  10381. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10382.  
  10383. %@AS@%  o 2F8 4F%@AE@%
  10384.  
  10385. This example writes the byte value 4F to output port 2F8.  %@NL@%
  10386.  
  10387.  
  10388. %@2@%%@CR:C6A00090075 @%%@AB@%p ─ Program Trace%@AE@%%@EH@%%@NL@%
  10389. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10390.  
  10391.  
  10392. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10393.  
  10394. %@AS@%  p«N» «=addr »«count»%@AE@%
  10395.  
  10396. The %@AB@%p%@AE@% command executes the instruction at a specified address and displays
  10397. the current values of all the registers and flags (whatever the %@AB@%z%@AE@% command
  10398. has been set to). It then executes the default command string, if any.  %@NL@%
  10399.  
  10400. The %@AB@%p%@AE@% command is identical to the %@AB@%t%@AE@% (Trace Instructions) command, except
  10401. that it automatically executes and returns from any calls or software
  10402. interrupts it encounters. The %@AB@%t%@AE@% command always stops after executing into
  10403. the call or interrupt, leaving execution control inside the called routine.
  10404. %@NL@%
  10405.  
  10406. %@TH:  24  1630 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%N%@AE@%                                 Suppresses the register display so just                                   the assembly line is displayed. The                                   suppression will result only if the                                   default command, %@AB@%z%@AE@%, is set to a normal                                   setting, %@AB@%r%@AE@%.%@AI@%addr%@AE@%                              Specifies the starting address to begin                                   execution. If you omit the optional %@AI@%addr%@AE@%,                                  execution begins at the instruction                                   pointed to by the CS and IP registers.                                   Use the equal sign (=) only if you                                   specify an %@AI@%addr%@AE@%. %@AI@%count%@AE@%                             Specifies the number of instructions to                                   execute before halting and executing the                                  default command string. If you specify %@AI@%%@AE@%                                  %@AI@%count%@AE@%, the command continues to execute %@AI@%%@AE@%                                  %@AI@%count%@AE@% instructions before stopping. The                                   command executes the default command                                   string for each instruction before                                   executing the next. %@TE:  24  1630 02 34 42 @%
  10407.  
  10408.  
  10409. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10410.  
  10411. %@AS@%  p%@AE@%
  10412.  
  10413. This example executes the instruction pointed to by the current CS and IP
  10414. register values before it executes the default command string.  %@NL@%
  10415.  
  10416. %@AS@%  p=120%@AE@%
  10417.  
  10418. This example executes the instruction at address CS:120 before it executes
  10419. the default command string.  %@NL@%
  10420.  
  10421.  
  10422. %@2@%%@CR:C6A00090076 @%%@AB@%r ─ Display Registers%@AE@%%@EH@%%@NL@%
  10423. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10424.  
  10425.  
  10426. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10427.  
  10428. %@AS@%  r reg =word%@AE@%
  10429.  
  10430. The %@AB@%r%@AE@% command displays the contents of one or more CPU registers and allows
  10431. the contents to be changed to new values. If you specify a %@AI@%reg%@AE@% with the %@AB@%r%@AE@%
  10432. command, the 16-bit value of that register is displayed in hexadecimal
  10433. followed by a colon (:) prompt on the next line. You can then enter a new
  10434. %@AI@%word%@AE@% value for the specified register or press ENTER if you do not want to
  10435. change the register value.  %@NL@%
  10436.  
  10437. If you use %@AB@%f%@AE@% for %@AI@%reg%@AE@%, the debugger displays the flags in a row at the
  10438. beginning of a new line and displays a hyphen (-) after the last flag.  %@NL@%
  10439.  
  10440. You can type new flag values in any order as alphabetic pairs. You do not
  10441. have to leave spaces between these values. To exit the %@AB@%r%@AE@% command, press
  10442. ENTER. Any flags for which you did not specify new values remain unchanged.
  10443. %@NL@%
  10444.  
  10445. If you type more than one value for a flag, or if you enter an invalid flag
  10446. name, the debugger returns a "Bad Flag" error message. In both cases, the
  10447. flags up to the error in the list are changed; those flags at and after the
  10448. error are not changed.  %@NL@%
  10449.  
  10450. %@TH:  53  1723 02 11 32 33 @%Parameter  Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%reg%@AE@%        Specifies the register to be            displayed. If you omit %@AI@%reg%@AE@%,            the debugger displays the            contents of all registers and            flags along with the next            executable instruction.%@AI@%word%@AE@%       Specifies the new value for            the register. For the Flags            register, set or clear a flag            by using one of the following            names:           Flag Name                       Action           OV                              Overflow set           NV                              Overflow clear           DN                              Direction decrement           UP                              Direction increment           EI                              Interrupt enabled           DI                              Interrupt disabled           NG                              Sign negative           PL                              Sign positive           ZR                              Zero set           NZ                              Zero clear           Flag Name                       Action           AC                              Auxiliary Carry set           NA                              Auxiliary Carry clear           PE                              Parity even           PO                              Parity odd           CY                              Carry set           NC                              Carry clear           NT                              Nested Task toggle on and off%@TE:  53  1723 02 11 32 33 @%
  10451.  
  10452. For the MSW register, use the following names to set a flag:  %@NL@%
  10453.  
  10454. %@TH:   6   356 02 17 59 @%Flag Name        Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%TS               Sets the task switch bit.EM               Sets the emulation processor extension bit.MP               Sets the monitor processor extension bit.PM               Sets the protected mode bit.%@TE:   6   356 02 17 59 @%
  10455.  
  10456.  
  10457. %@3@%%@AB@%Comments%@AE@%%@EH@%%@NL@%
  10458.  
  10459. Setting the protected-mode bit from within the debugger does %@AI@%not%@AE@% set the
  10460. target system to run in protected mode. The debugger simulates the setting.
  10461. To configure the target system to run in protected mode, you would have to
  10462. set the PM bit in the MSW register and reset the target system to boot in
  10463. protected mode.  %@NL@%
  10464.  
  10465.  
  10466. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10467.  
  10468. %@AS@%  r%@AE@%
  10469.  
  10470. This example produces the following display:  %@NL@%
  10471.  
  10472. %@AS@%  AX=0698  BX=2008  CX=2C18  DX=18AB  SP=1B7A  BP=00FF  SI=0020  DI=10CD
  10473. %@AS@%  IP=0450  CS=18B0  DS=1BE8  ES=0DA8  SS=0048  NV UP DI PL NZ NA PO NC
  10474. %@AS@%  GDTR=01BE80 3687  IDTR=01F508 03FF  TR=0010  LDTR=0028 IOPL=3 MSW=PM 
  10475. %@AS@%  18B0:0450 C3             RET                             %@AE@%
  10476.  
  10477. %@AS@%  rf%@AE@%
  10478.  
  10479. This example displays each flag with a two-character alphabetic code. To
  10480. change any flag, type the opposite two-letter code. The flags are either set
  10481. or cleared. This example produces a display similar to the following:  %@NL@%
  10482.  
  10483. %@AS@%  NV UP DI NG NZ AC PE NC - _%@AE@%
  10484.  
  10485. To change the value of a flag's setting, enter an opposite setting for the
  10486. flag you wish to set.  %@NL@%
  10487.  
  10488. %@AS@%  NV UP DI NG NZ AC PE NC - PLEICY%@AE@%
  10489.  
  10490. This example changes the sign flag to positive, enables interrupts, and sets
  10491. the carry flag.  %@NL@%
  10492.  
  10493. %@AS@%  rmsw%@AE@%
  10494.  
  10495. This example modifies the MSW (Machine Status Word) bits. The debugger
  10496. displays the status of the MSW register and prints a colon on the next line.
  10497. %@NL@%
  10498.  
  10499.  
  10500. %@2@%%@CR:C6A00090077 @%%@AB@%s ─ Search Bytes%@AE@%%@EH@%%@NL@%
  10501. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10502.  
  10503.  
  10504. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10505.  
  10506. %@AS@%  s range { list | "string" }%@AE@%
  10507.  
  10508. The %@AB@%s%@AE@% command searches an address range for a specified list of bytes or an
  10509. ASCII character string.  %@NL@%
  10510.  
  10511. You can include one or more bytes in %@AI@%list%@AE@%, but multiple bytes must be
  10512. separated by a space or comma. When you search for more than one byte, the
  10513. command returns only the first address of the byte string. When your %@AI@%list%@AE@%
  10514. contains only one byte, the debugger displays all addresses of the byte in
  10515. the %@AI@%range%@AE@%.  %@NL@%
  10516.  
  10517. %@TH:  12   652 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses to be                                   searched.%@AI@%list%@AE@%                              Specifies one or more byte values to                                   search for.%@AI@%string%@AE@%                            Specifies an ASCII character string to                                   be searched for. The string must be                                   enclosed in quotation marks.%@TE:  12   652 02 34 42 @%
  10518.  
  10519.  
  10520. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10521.  
  10522. %@AS@%  sCS:100 110 41%@AE@%
  10523.  
  10524. This example searches for byte 41 in the range CS:100 to CS:110. If it finds
  10525. the value, the command produces a display similar to the following:  %@NL@%
  10526.  
  10527. %@AS@%  04BA:0104
  10528. %@AS@%  04BA:010D%@AE@%
  10529.  
  10530.  
  10531. %@2@%%@CR:C6A00090078 @%%@AB@%t ─ Trace Instructions%@AE@%%@EH@%%@NL@%
  10532. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10533.  
  10534.  
  10535. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10536.  
  10537. %@AS@%  t«N» «=addr» «word»%@AE@%
  10538.  
  10539. The %@AB@%t%@AE@% command executes one or more instructions along with the default
  10540. command string, then displays the decoded instruction. If you include an
  10541. %@AI@%addr%@AE@% parameter, tracing starts at the specified address. Otherwise, the
  10542. command steps through the next machine instruction and then executes the
  10543. default command string.  %@NL@%
  10544.  
  10545. The %@AB@%t%@AE@% command uses the hardware trace mode of the Intel microprocessor.
  10546. Consequently, you can also trace instructions stored in ROM.  %@NL@%
  10547.  
  10548. %@TH:  14   835 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%N%@AE@%                                 Suppresses the register display so just                                   the assembly line is displayed. This                                   works only if the default command, %@AB@%z%@AE@%, is                                  set to %@AB@%r%@AE@% (the normal setting).%@AI@%addr%@AE@%                              Specifies the instruction address to                                   start tracing. The equal sign (=) is                                   required.%@AI@%word%@AE@%                              Specifies the number of instructions to                                   execute and trace.%@TE:  14   835 02 34 42 @%
  10549.  
  10550.  
  10551. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10552.  
  10553. %@AS@%  t%@AE@%
  10554.  
  10555. %@AS@%  AX=0E00  BX=00FF  CX=0007  DX=01FF  SP=039D  BP=0000  SI=005C  DI=0000
  10556. %@AS@%  IP=011A  CS=04BA  DS=04BA  ES=04BA  SS=04BA  NV UP DI NG NZ AC PE NC
  10557. %@AS@%  GDTR=01D700 3677  IDTR=020D7A 03FF  TR=0010  LDTR=0028 IOPL=3 MSW=PM 
  10558. %@AS@%  04BA:011A  CD21          PUSH   21%@AE@%
  10559.  
  10560. This example traces the current position (04BA:011A) and uses the default
  10561. command string (%@AB@%r%@AE@% command) to display registers.  %@NL@%
  10562.  
  10563. %@AS@%  t=011A 10%@AE@%
  10564.  
  10565. This command causes the debugger to execute 16 (10H) instructions beginning
  10566. at 011A in the current selector. The debugger executes and displays the
  10567. results of the default command string for each instruction. The display
  10568. scrolls until the last instruction is executed. Use CONTROL+S to stop the
  10569. display from scrolling, and CONTROL+Q to resume.  %@NL@%
  10570.  
  10571.  
  10572. %@2@%%@CR:C6A00090079 @%%@AB@%u ─ Unassemble Bytes%@AE@%%@EH@%%@NL@%
  10573. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10574.  
  10575.  
  10576. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10577.  
  10578. %@AS@%  u range%@AE@%
  10579.  
  10580. The %@AB@%u%@AE@% command disassembles bytes and displays the source statements, with
  10581. addresses and byte values, that correspond to them.  %@NL@%
  10582.  
  10583. The display of disassembled code looks similar to a code listing for an
  10584. assembled file. If you type the %@AB@%u%@AE@% command by itself, 20H bytes are
  10585. disassembled at the first address after the one displayed by the previous %@AB@%u%@AE@%
  10586. command.  %@NL@%
  10587.  
  10588. %@TH:   7   479 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%range%@AE@%                             Specifies the range of addresses in                                   which instructions are to be                                   disassembled. If no %@AI@%range%@AE@% is given, the                                   command disassembles the next 20H bytes.%@TE:   7   479 02 34 42 @%
  10589.  
  10590.  
  10591. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10592.  
  10593. %@AS@%  uCS:046C%@AE@%
  10594.  
  10595. This example returns a display similar to the following:  %@NL@%
  10596.  
  10597. %@AS@%  1A60:046C C3               RET
  10598. %@AS@%  1A60:046D 9A6B3E100D       CALL  0D10:3E6B
  10599. %@AS@%  1A60:0472 33C0             XOR  AX,AX
  10600. %@AS@%  1A60:0474 50               PUSH  AX
  10601. %@AS@%  1A60:0475 9D               POPF
  10602. %@AS@%  1A60:0476 9C               PUSHF 
  10603. %@AS@%  1A60:0477 58               POP  AX 
  10604. %@AS@%  1A60:0478 2500F0           AND  AX,F000
  10605. %@AS@%  1A60:047B 3D00F0           CMP  AX,F000  
  10606. %@AS@%  1A60:047E 7508             JNZ  0488       
  10607. %@AS@%  1A60:0480 689C26           PUSH  269C        
  10608. %@AS@%  1A60:0483 9AF105100D       CALL  0D10:05F1                    %@AE@%
  10609.  
  10610. If the bytes in some addresses are altered, the disassembler alters the
  10611. instruction statements. You can also use the %@AB@%u%@AE@% command for the changed
  10612. locations, for the new instructions viewed, and for the disassembled code
  10613. used to edit the source file.  %@NL@%
  10614.  
  10615.  
  10616. %@2@%%@CR:C6A00090080 @%%@AB@%v ─ Set Interrupt Vector Trapping%@AE@%%@EH@%%@NL@%
  10617. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10618.  
  10619.  
  10620. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10621.  
  10622. %@AS@%  v«1 | 3»%@AE@%
  10623.  
  10624. The %@AB@%v%@AE@% command is used to specify which privilege rings should have
  10625. interrupts 1 and 3 trapped. This is useful for allowing the 80386 Debugger
  10626. to coexist with other debuggers such as the Symbolic Debugger (%@AB@%SYMDEB%@AE@%) and
  10627. CodeView for Windows (%@AB@%CVW%@AE@%). The 80386 Debugger handles interrupts 1 and 3
  10628. which occur in any privilege rings where trapping is enabled, but reflects
  10629. the interrupts if trapping is disabled, so that the secondary debugger will
  10630. see them. To use the command, enter v1 or v3 as the command with no
  10631. parameters. %@AB@%WDEB386%@AE@% then displays the current rings for which trapping is
  10632. enabled. For example:  %@NL@%
  10633.  
  10634. %@AS@%  #v1
  10635. %@AS@%  Rings trapped for int 1 - 0 1 2 3 V
  10636. %@AS@%  ? +%@AE@%
  10637.  
  10638. The question mark (?) is displayed to prompt you for changes. The plus sign
  10639. (+) indicates that you are in enabling mode, so you can just press 0, 1, 2,
  10640. 3, or V to enable trapping in the required ring. If you need to disable
  10641. trapping in any rings, then press HYPHEN ( - ); this will change the plus
  10642. sign to a minus sign, indicating that you are now disabling trapping.
  10643. Pressing PLUS SIGN ( + ) will get you back into enabling mode. Any number of
  10644. changes can be made at one time. The current mode is displayed after each
  10645. change. For example:  %@NL@%
  10646.  
  10647. %@AS@%  #v1
  10648. %@AS@%  Rings trapped for int 1 - 0 2 V
  10649. %@AS@%  ? +1 +3 -2 -%@AE@%
  10650.  
  10651. This command sequence was created by pressing 1, 3, HYPHEN, 2, and ENTER or
  10652. the SPACEBAR. It enabled trapping INT 1 instructions in rings 1 and 3 and
  10653. disabled trapping in ring 2.  %@NL@%
  10654.  
  10655.  
  10656. %@2@%%@CR:C6A00090081 @%%@AB@%vl ─ Display Interrupt Trapping Information%@AE@%%@EH@%%@NL@%
  10657. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10658.  
  10659.  
  10660. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10661.  
  10662. %@AS@%  vl%@AE@%
  10663.  
  10664. This command shows which privilege rings have trapping enabled for
  10665. interrupts 1 and 3. The %@AB@%v%@AE@% command can be used to enable or disable trapping
  10666. in specific privilege rings.  %@NL@%
  10667.  
  10668.  
  10669. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10670.  
  10671. %@AS@%  vl
  10672. %@AS@%  Rings trapped for int 1 - 0 1 2 3 V
  10673. %@AS@%  Rings trapped for int 3 - 0 1 2 3 V%@AE@%
  10674.  
  10675.  
  10676. %@2@%%@CR:C6A00090082 @%%@AB@%w ─ Change Map%@AE@%%@EH@%%@NL@%
  10677. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10678.  
  10679.  
  10680. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10681.  
  10682. %@AS@%  w «map-name»%@AE@%
  10683.  
  10684. The %@AB@%w%@AE@% command changes the active map file.  %@NL@%
  10685.  
  10686. %@TH:  12   768 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%map-name%@AE@%                          Specifies the name of the map file you                                   want to make active. Use the %@AB@%lm%@AE@% (List                                   Map) command to display a list of                                   available map files.                                  If %@AI@%map-name%@AE@% is not specified, then the                                   loaded maps are displayed and the user                                   is prompted to select a map by pressing                                   its corresponding option number.%@TE:  12   768 02 34 42 @%
  10687.  
  10688.  
  10689. %@3@%%@AB@%Examples%@AE@%%@EH@%%@NL@%
  10690.  
  10691. %@AS@%  lm
  10692. %@AS@%  COMSAM2D is active.
  10693. %@AS@%  DISK01D.
  10694. %@AS@%  w DISK01D%@AE@%
  10695.  
  10696. The first example displays the loaded map files using the %@AB@%lm%@AE@% command, then
  10697. sets the active map file to DISK01D.  %@NL@%
  10698.  
  10699. %@AS@%  W
  10700. %@AS@%  1. KERNEL
  10701. %@AS@%  2. Win386 is active
  10702. %@AS@%  activate which map?%@AE@%
  10703.  
  10704. The second example shows selecting the desired map from the list of
  10705. available maps. At the prompt, pressing 1 will activate the KERNEL map;
  10706. pressing 2 will leave the Win386 map activated; pressing the SPACEBAR will
  10707. leave the current map activated; any other key will be ignored and the
  10708. debugger will continue to wait for input.  %@NL@%
  10709.  
  10710.  
  10711. %@2@%%@CR:C6A00090083 @%%@AB@%y ─ Debugger Option Command%@AE@%%@EH@%%@NL@%
  10712. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10713.  
  10714.  
  10715. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10716.  
  10717. %@AS@%  y [? | 386env | dislwr | regterse | codebytes | symaddrs]%@AE@%
  10718.  
  10719. This command allows the debugger configuration to be changed. The %@AB@%?%@AE@% option
  10720. prints the current options supported. The %@AB@%y%@AE@% command by itself prints the
  10721. current state of the options. The %@AB@%y%@AE@% and a flag name sets or toggles an
  10722. options flag.  %@NL@%
  10723.  
  10724. %@AS@%  386env - 32 bit environment (toggles)
  10725. %@AS@%  dislwr - lower case disassembly (toggles)
  10726. %@AS@%  regterse - terse register set (toggles)
  10727. %@AS@%  codebytes - terse instruction disassembly (toggles)
  10728. %@AS@%  symaddrs - symbols and addresses (toggles)%@AE@%
  10729.  
  10730. All these flags toggle their state when set and are printed only when the
  10731. option is on.  %@NL@%
  10732.  
  10733. The %@AB@%386env%@AE@% flag controls the size of addresses and registers, when
  10734. displayed. When this option is on, addresses, registers, etc., are printed
  10735. in 32-bit formats; otherwise they are printed in 16-bit formats. This flag
  10736. has nothing to do with the CPU (286/386) the debugger is running on, only
  10737. the display sizes.  %@NL@%
  10738.  
  10739. The %@AB@%dislwr%@AE@% flag controls the disassembler's lowercase option. When the flag
  10740. is on, disassembly is in lowercase.  %@NL@%
  10741.  
  10742. The %@AB@%regterse%@AE@% flag controls the number of registers that are displayed in the
  10743. register dump command. In the 386 environment (%@AB@%386env%@AE@% on), when the %@AB@%regterse%@AE@%
  10744. flag is on, only the first three lines are displayed (instead of the normal
  10745. six-line-plus disassembly line display). In the 286 environment (%@AB@%386env%@AE@%
  10746. off), only the first two lines of the normal three-line display (plus the
  10747. disassembly line) are printed.  %@NL@%
  10748.  
  10749. The %@AB@%codebytes%@AE@% flag controls the display of the actual code bytes when
  10750. disassembling.  %@NL@%
  10751.  
  10752. The %@AB@%symaddrs%@AE@% flag controls showing just a symbol name or symbol name and
  10753. address when disassembling.  %@NL@%
  10754.  
  10755.  
  10756. %@2@%%@CR:C6A00090084 @%%@AB@%z ─ Zap Embedded INT 1 and INT 3 Instructions%@AE@%%@EH@%%@NL@%
  10757. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10758.  
  10759.  
  10760. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10761.  
  10762. %@AS@%  z%@AE@%
  10763.  
  10764. Zaps the current INT 3 or the previous INT 1 instruction, by replacing the
  10765. instruction bytes with NOP instructions. This allows the user to avoid INT 1
  10766. or INT 3 instructions that were assembled into the executable file from
  10767. breaking into the debugger more than once.  %@NL@%
  10768.  
  10769.  
  10770. %@2@%%@CR:C6A00090085 @%%@AB@%zd ─ Execute Default Command String%@AE@%%@EH@%%@NL@%
  10771. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10772.  
  10773.  
  10774. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10775.  
  10776. %@AS@%  zd%@AE@%
  10777.  
  10778. The %@AB@%zd%@AE@% command executes the default command string.  %@NL@%
  10779.  
  10780. The default command string is initially set to the %@AB@%r%@AE@% (Display Registers)
  10781. command by the debugger. The default command string is executed every time a
  10782. breakpoint is encountered during program execution or whenever a %@AB@%p%@AE@% (Program
  10783. Trace) or %@AB@%t%@AE@% (Trace Instructions) command is executed.  %@NL@%
  10784.  
  10785. Use the %@AB@%zl%@AE@% command to display the default command string and the %@AB@%zs%@AE@% command
  10786. to change the default command string.  %@NL@%
  10787.  
  10788.  
  10789. %@2@%%@CR:C6A00090086 @%%@AB@%zl ─ Display Default Command String%@AE@%%@EH@%%@NL@%
  10790. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10791.  
  10792.  
  10793. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10794.  
  10795. %@AS@%  zl%@AE@%
  10796.  
  10797. The %@AB@%zl%@AE@% command displays the default command string.  %@NL@%
  10798.  
  10799.  
  10800. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10801.  
  10802. %@AS@%  zl
  10803. %@AS@%  "R"%@AE@%
  10804.  
  10805. This example displays the default command string.  %@NL@%
  10806.  
  10807.  
  10808. %@2@%%@CR:C6A00090087 @%%@AB@%zs ─ Change Default Command String%@AE@%%@EH@%%@NL@%
  10809. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10810.  
  10811.  
  10812. %@3@%%@AB@%Syntax%@AE@%%@EH@%%@NL@%
  10813.  
  10814. %@AS@%  zs "string"%@AE@%
  10815.  
  10816. The %@AB@%zs%@AE@% command lets you change the default command string.  %@NL@%
  10817.  
  10818. %@TH:   8   536 02 34 42 @%Parameter                         Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AI@%string%@AE@%                            Specifies the new default command string.                                  The string must be enclosed in single or                                  double quotation marks. You must                                   separate the debugger commands within                                   the string with semicolons.%@TE:   8   536 02 34 42 @%
  10819.  
  10820.  
  10821. %@3@%%@AB@%Example%@AE@%%@EH@%%@NL@%
  10822.  
  10823. %@AS@%  zs "r;c100 L 100 300"%@AE@%
  10824.  
  10825. This example changes the current default command string to an %@AB@%r%@AE@% (Display
  10826. Register) command followed by a %@AB@%c%@AE@% (Compare Memory) command.  %@NL@%
  10827.  
  10828. %@AS@%  zs "j (by cs:ip) == cc 'g'"%@AE@%
  10829.  
  10830. This example begins execution whenever an INT 3 instruction is executed in
  10831. your test program. This will execute a %@AB@%g%@AE@% (Go) command every time an INT 3
  10832. instruction is executed.  %@NL@%
  10833.  
  10834. You can use %@AB@%zs%@AE@% to set up a watchpoint as follows:  %@NL@%
  10835.  
  10836. %@AS@%  zs "j (wo 40:1234) == 0eeed;t"%@AE@%
  10837.  
  10838. This command traces until the word at 40:1234 is %@AI@%not%@AE@% equal to 0EEED. This
  10839. won't work if you are tracing through the mode switching code in DOS or
  10840. other sections of code that can't be traced.  %@NL@%
  10841.  
  10842.  
  10843.  
  10844.  
  10845.  
  10846. %@2@%%@CR:C6A00090088 @%%@AB@%9.6 386 Enhanced Windows Environment Commands%@AE@%%@EH@%%@NL@%
  10847.  
  10848. These commands are specific to the operating environment of Windows running
  10849. in 386 enhanced mode. These commands are always dot commands, and are in
  10850. addition to the common commands documented in the previous section.  %@NL@%
  10851.  
  10852. All of these commands are listed when the %@AB@%.?%@AE@% command is executed.  %@NL@%
  10853.  
  10854. %@TH: 120  7389 02 34 42 @%Command                           Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%.DG%@AE@%                               Calls Windows to dump its global heap                                   when Windows is installed.%@AB@%.DF%@AE@%                               Calls Windows to dump its free list when                                  Windows is installed. %@AB@%.DL%@AE@%                               Calls Windows to dump the LRU list when                                   Windows is installed. %@AB@%.VM%@AE@%                               Displays the status of the current                                   virtual machine (VM). Status information                                  includes reentry count, VM handle,                                   critical section state, client registers,                                  and top entries from the client's stack.%@AB@%.VC%@AE@%                               Displays the standard fields of the                                   current VM's control block.%@AB@%.VH%@AE@%                               Displays the current VM's handle.%@AB@%.VR%@AE@%                               Displays the current VM's client                                   registers, if the debugger is in                                   protected mode.%@AB@%.VS%@AE@%                               Displays the current VM's virtual mode                                   stack, if the debugger is in protected                                   mode.%@AB@%.VL%@AE@%                               Displays a list of all valid VM handles.%@AB@%.T%@AE@%                                Toggles the fault logging flag. When                                   fault logging is turned on, all system                                   faults (hardware interrupts, general                                   protection faults, page faults, illegal                                   instruction faults, and so on) are                                   logged, with the registers at the time                                   of the fault, and so on. This list of                                   logged faults can then be viewed with                                   the %@AB@%.S%@AE@%, %@AB@%.SS,%@AE@% or %@AB@%.SL%@AE@% commands.%@AB@%.S%@AE@% [%@AI@%item_num%@AE@%]                     Displays fault logging information in a                                   single line-condensed form. If an %@AI@%%@AE@%                                  %@AI@%item_num%@AE@% parameter is given, then the                                   list starts with the specified log item;                                  otherwise it starts with the last (most                                   recent) log item. The list is displayed                                   from most recent to less recent order.                                   It displays item number, fault number,                                   VM handle at the time of fault, critical                                  section state, client's CS:IP; and, in                                   the case of general protection faults,                                   the executed instruction. The display                                   will look like the following:                                  %@AS@%= 00003BB8: 000D 60441000 00 01 %@AE@%                                  %@AS@%02B7:23F5 INT     2A    00008002%@AE@%                                  The first number (00003BB8) is the log                                   item number. The second number (000D) is                                  the fault (interrupt) number (0Dh =                                   General Protection). The next number                                   (60441000) is the VM handle of the VM                                   interrupted.                                  The next two numbers (00) and (01) are                                   the critical section claim counts at the                                  start and end of the fault handling. So,                                  in this example, the critical section                                   was unclaimed on entry, but the fault                                   handler claimed it before exiting.                                  The next number (02B7:23F5) is the                                   client's CS:IP at the time of the                                   interrupt. (INT 2A) is the instruction                                   that the client attempted to execute,                                   causing the protection fault.                                  The last number (00008002) is the value                                   of EAX register. This number is given                                   since it is commonly used for software                                   interrupt function number selection, and                                  since all software interrupts done in                                   virtual 8086 mode will show in this log.                                  This allows the programmer to see the                                   most about each fault in a single line.                                   When the faulting instruction is an IN                                   or OUT instruction, DX and EAX will be                                   displayed as appropriate.                                  After each screenful of display, the                                   debugger pauses, waiting for the user to                                  press a key to continue. Pressing ESCAPE                                  or CONTROL+C aborts any further listing.                                  This command clears the fault logging                                   flag, to disable further logging.%@AB@%.SL%@AE@% [%@AI@%item_num%@AE@%]                    Displays complete fault logging                                   information. If a log item number is                                   specified, then just the one fault's                                   information is displayed, starting with                                   the condensed line, then the register                                   state at the start of the fault, and                                   then the register state at the end. If                                   no item number is specified, then all                                   log items are displayed, starting with                                   the last log item. This list shows the                                   log number, fault number, VM handle,                                   client registers, and instruction (if                                   the item is the end-of-fault item.)                                  Screen handling is performed exactly as                                   in the %@AB@%.S%@AE@% command.%@AB@%.DS%@AE@%                               Dumps the protected-mode stack and                                   displays near code segment labels (if                                   available) next to each%@AB@% DWORD%@AE@% from the                                   stack.%@TE: 120  7389 02 34 42 @%
  10855.  
  10856. The following %@AB@%M%@AE@%%@AI@%x%@AE@% commands are for debugging the 386-enhanced-mode Windows
  10857. environment memory manager. They are probably of little use to other
  10858. programmers.  %@NL@%
  10859.  
  10860. %@TH:  45  2449 02 34 42 @%Command                           Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%.MH%@AE@% [%@AI@%handle%@AE@%]                      Displays the 386-enhanced-mode Windows                                   heap information about a specific handle,                                  if specified; otherwise global                                   information is displayed.%@AB@%.MM%@AE@% [%@AI@%handle%@AE@%]                      Displays the 386-enhanced-mode Windows                                   memory information, such as free and                                   locked pages, if no handle is specified.                                  Otherwise, it displays information about                                  the memory handle such as size and                                   linear address.%@AB@%.MV%@AE@%                               Displays the memory handles that are                                   allocated to the current VM.%@AB@%.MS PFT%@AE@%%@AI@%addr%@AE@%                       Displays PFT (paged memory) information.%@AB@%.MF%@AE@%                               Displays the current free list.%@AB@%.MI%@AE@%                               Displays instanced data regions.%@AB@%.VMM%@AE@%                              This command displays a menu of                                   subcommands. Pressing a single character                                  selects and executes the listed command.%@AB@%.device-name%@AE@%                      This command calls the indicated virtual                                  device so that it can dump information                                   relevant for debugging it.%@AB@%.LQ%@AE@%                               Displays queue outs from the most                                   recent.%@AB@%.ML%@AE@% %@AI@%lin_addr%@AE@%                      Displays page-table information for the                                   given linear address.%@AB@%.MP%@AE@% %@AI@%phys_addr%@AE@%                     Displays all linear addresses that map                                   the given physical address.%@AB@%.MD%@AE@%                               Changes the debug MONO paging display.%@AB@%MO%@AE@%                                Schedules a page-out event of all                                   present pages that are not locked.%@TE:  45  2449 02 34 42 @%
  10861.  
  10862.  
  10863. %@2@%%@CR:C6A00090089 @%%@AB@%9.7 Summary%@AE@%%@EH@%%@NL@%
  10864.  
  10865. The 80386 Debugger is a tool that lets you debug Windows applications in
  10866. protected (standard or 386 enhanced) mode on systems with an 80386 CPU. It
  10867. offers more advanced debugging features not available in CodeView for
  10868. Windows, but lacks %@AB@%CVW%@AE@%'s more convenient user interface.  %@NL@%
  10869.  
  10870. For more information related to the 80386 Debugger, see the following:  %@NL@%
  10871.  
  10872. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  10873. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10874. Programming Windows applications  %@AI@%Guide to Programming%@AE@%
  10875.  
  10876. System requirements               %@AI@%Installation and Update Guide%@AE@%
  10877.  
  10878.  
  10879.  
  10880.  
  10881.  
  10882.  
  10883. %@CR:C6A00100001 @%%@1@%%@AB@%Chapter 10  Monitoring Messages: Spy%@AE@%%@EH@%%@NL@%
  10884. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10885.  
  10886. Microsoft Windows Spy (%@AB@%SPY%@AE@%) monitors system messages sent to a specified
  10887. application window. Spy records the messages and displays them on a
  10888. specified device.%@CR:C6A00100002 @%%@CR:C6A00100003 @%%@NL@%
  10889.  
  10890. Spy is useful for verifying that the messages you think a window is
  10891. receiving are being received. It is also helpful for examining the values of
  10892. message parameters.  %@NL@%
  10893.  
  10894. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10895. NOTE
  10896.  
  10897. %@AI@%If you are using CodeView for Windows to debug your application, you can use
  10898. %@AI@%CodeView instead of Spy to trace messages.%@AE@%
  10899. ────────────────────────────────────────────────────────────────────────────%@NL@%
  10900.  
  10901. This chapter describes the following:  %@NL@%
  10902.  
  10903.  
  10904.   ■   Displaying messages%@NL@%
  10905.  
  10906.   ■   Choosing options%@NL@%
  10907.  
  10908.   ■   Choosing a window%@NL@%
  10909.  
  10910.   ■   Turning Spy on and off
  10911. %@NL@%
  10912.  
  10913.  
  10914.  
  10915. %@2@%%@CR:C6A00100004 @%%@AB@%10.1  Displaying Messages%@AE@%%@EH@%%@NL@%
  10916.  
  10917. To watch messages, do the following:%@CR:C6A00100005 @%%@NL@%
  10918.  
  10919.  
  10920.   1.  Choose the Options menu to display the Options dialog box and select
  10921.       the following:
  10922.  
  10923.       ■   The kind of message you want to watch%@NL@%
  10924.  
  10925.       ■   The output device to which you want messages to go%@NL@%
  10926.  
  10927.       ■   Whether you want Spy to display messages synchronously or
  10928.           asynchronously%@NL@%
  10929. %@NL@%
  10930.  
  10931.   2.  Select the window whose messages you want to watch by choosing the
  10932.       Window command from the Window menu.%@NL@%
  10933.  
  10934.   3.  Click the window you want to watch. To stop watching messages, choose
  10935.       the Spy Off command from the Spy menu.%@NL@%
  10936.  
  10937.  
  10938. Figure 10.1 illustrates the Spy window.  %@NL@%
  10939.  
  10940. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  10941.  
  10942.  
  10943. %@2@%%@CR:C6A00100006 @%%@AB@%10.2  Choosing Options%@AE@%%@EH@%%@NL@%
  10944.  
  10945. The Options menu displays a dialog box that offers you the following
  10946. choices:  %@NL@%
  10947.  
  10948.  
  10949.   ■   The kind of message you want to watch%@NL@%
  10950.  
  10951.   ■   The output device to which you want samples to go%@NL@%
  10952.  
  10953.   ■   Whether or not Spy sends samples to the output device synchronously or
  10954.       asynchronously%@NL@%
  10955.  
  10956.  
  10957. The following sections describe how to choose these options.  %@NL@%
  10958.  
  10959.  
  10960. %@3@%%@CR:C6A00100007 @%%@AB@%10.2.1  Choosing Messages%@AE@%%@EH@%%@NL@%
  10961.  
  10962. The Options menu displays a dialog box that offers the following choices:%@CR:C6A00100008 @%%@NL@%
  10963.  
  10964. %@AB@%Message%@AE@%                           %@AB@%Description%@AE@%
  10965. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10966. Mouse                             Mouse-related messages, such as
  10967.                                   WM_MOUSEMOVE and WM_SETCURSOR.
  10968.  
  10969. Input                             Input-related messages, such as WM_CHAR 
  10970.                                   and WM_COMMAND.
  10971.  
  10972. System                            System-wide messages, such as
  10973.                                   WM_ENDSESSION and WM_TIMECHANGE.
  10974.  
  10975. %@AB@%Message%@AE@%                           %@AB@%Description%@AE@%
  10976. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  10977. Window                            Window manager messages, such as WM_SIZE
  10978.                                   and WM_SHOWWINDOW.
  10979.  
  10980. Init                              Initialization messages, such as 
  10981.                                   WM_INITMENU and WM_INITDIALOG.
  10982.  
  10983. Clipboard                         Clipboard messages, such as
  10984.                                   WM_RENDERFORMAT.
  10985.  
  10986. Other                             Messages other than the types explicitly
  10987.                                   listed.
  10988.  
  10989. DDE                               Dynamic Data Exchange messages, such as 
  10990.                                   WM_DDE_REQUEST.
  10991.  
  10992. Non Client                        Windows nonclient messages, such as
  10993.                                   WM_NCDESTROY and WM_NCHITTEST.
  10994.  
  10995. By default, Spy monitors all messages.%@CR:C6A00100009 @%%@CR:C6A00100010 @%%@CR:C6A00100011 @%%@CR:C6A00100012 @%%@CR:C6A00100013 @%%@CR:C6A00100014 @%%@NL@%
  10996.  
  10997.  
  10998. %@3@%%@CR:C6A00100015 @%%@AB@%10.2.2  Choosing the Output Device%@AE@%%@EH@%%@NL@%
  10999.  
  11000. You can specify that Spy send messages to the following output devices:%@CR:C6A00100016 @%%@NL@%
  11001.  
  11002. %@AB@%Device%@AE@%                            %@AB@%Description%@AE@%
  11003. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11004. Window                            Spy displays messages in the Spy window.
  11005.                                   You can specify how many messages Spy 
  11006.                                   stores in its buffer. By default, it 
  11007.                                   stores 100 lines of messages which you 
  11008.                                   can view by scrolling through the Spy 
  11009.                                   window.
  11010.  
  11011. Com1                              Spy sends messages to the COM1 port.
  11012.  
  11013. File                              Spy sends messages to the specified file.
  11014.                                   The default output file is SPY.OUT.
  11015.  
  11016.  
  11017. %@3@%%@CR:C6A00100017 @%%@AB@%10.2.3  Choosing Frequency of Output%@AE@%%@EH@%%@NL@%
  11018.  
  11019. The following options specify whether Spy sends messages to the output
  11020. device as Spy receives them, or queues messages before sending them:%@CR:C6A00100018 @%%@NL@%
  11021.  
  11022. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  11023. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11024. Synchronous                       Spy displays messages as it receives 
  11025.                                   them.
  11026.  
  11027. Asynchronous                      Spy queues messages for display.
  11028.  
  11029. By default, Spy sends messages synchronously.%@CR:C6A00100019 @%%@NL@%
  11030.  
  11031.  
  11032. %@2@%%@CR:C6A00100020 @%%@AB@%10.3  Choosing a Window: The Window Menu%@AE@%%@EH@%%@NL@%
  11033.  
  11034. After specifying message options, use the Window menu to choose the window
  11035. you want Spy to watch. The Window menu contains the following commands:%@CR:C6A00100021 @%%@CR:C6A00100022 @%%@NL@%
  11036.  
  11037. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  11038. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11039. Window...                         Specifies the window that Spy watches. 
  11040.                                   When you choose the Window... command, 
  11041.                                   Spy displays a dialog box that contains 
  11042.                                   information for the window in which the 
  11043.                                   cursor is located. As you move the 
  11044.                                   cursor from window to window, the 
  11045.                                   following information changes:
  11046.  
  11047.                                   ■ Window─Handle to the window
  11048.  
  11049.                                   ■ Class─Window class
  11050.  
  11051.                                   ■ Module─Program that created the window
  11052.  
  11053.                                   ■ Parent─Handle to the parent window and
  11054.                                   the name of the program that created the
  11055.                                   parent window
  11056.  
  11057.                                   ■ Rect─Upper-right and lower-left 
  11058.                                   coordinates of the window and the window
  11059.                                   size in screen coordinates
  11060.  
  11061.                                   ■ Style─Style bits of the window under 
  11062.                                   the cursor, the principal style of the 
  11063.                                   window, and an identifier, if the window
  11064.                                   is a child window. The principal style 
  11065.                                   can be WS_POPUP, WS_ICONIC, 
  11066.                                   WS_OVERLAPPED, or WS_CHILD.
  11067.  
  11068. All Windows                       Specifies that Spy watches all windows. 
  11069.                                   Choose the All Windows command again to 
  11070.                                   direct Spy to stop watching all windows.
  11071.  
  11072. Clear Window                      Clears the Spy window of messages.
  11073.  
  11074.  
  11075. %@2@%%@CR:C6A00100023 @%%@AB@%10.4  Turning Spy On and Off: The Spy Menu%@CR:C6A00100024 @%%@AE@%%@EH@%%@NL@%
  11076.  
  11077. After selecting a window to monitor, turn Spy on by clicking the window and
  11078. choosing OK in the dialog box.  %@NL@%
  11079.  
  11080. To stop monitoring messages, or to resume monitoring messages, or to exit
  11081. Spy, use the Spy menu. The Spy menu contains the following commands:  %@NL@%
  11082.  
  11083. %@AB@%Command%@AE@%                           %@AB@%Description%@AE@%
  11084. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11085. Spy On/Off                        Starts and stops message monitoring.
  11086.  
  11087. Exit                              Exits Spy.
  11088.  
  11089. About Spy...                      Provides information about the version 
  11090.                                   of Spy you are using.
  11091.  
  11092.  
  11093. %@2@%%@CR:C6A00100025 @%%@AB@%10.5  Summary%@AE@%%@EH@%%@NL@%
  11094.  
  11095. Spy is a tool that lets you monitor messages sent to a specified window. For
  11096. more information about topics related to Spy, see the following:  %@NL@%
  11097.  
  11098. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  11099. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11100. Input messages                    %@AI@%Guide to Programming%@AE@%: Chapter 4, 
  11101.                                   "Keyboard and Mouse Input" %@AI@%%@AE@%
  11102.  
  11103. Message syntax and content        %@AI@%Reference, Volume 1%@AE@%: Chapter 6, 
  11104.                                   "Messages Directory" %@AI@%%@AE@%
  11105.  
  11106.  
  11107.  
  11108.  
  11109.  
  11110.  
  11111. %@CR:C6A00110001 @%%@1@%%@AB@%Chapter 11  Viewing the Heap: Heap Walker%@AE@%%@EH@%%@NL@%
  11112. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11113.  
  11114. Microsoft Windows Heap Walker (%@AB@%HEAPWALK%@AE@%) lets you examine the global heap,
  11115. the system memory that DOS reserves for Windows use. The utility displays
  11116. information about memory segments, or objects. Heap Walker is useful for
  11117. analyzing the effects your application has when it allocates objects in the
  11118. global heap.%@CR:C6A00110002 @%%@CR:C6A00110003 @%%@NL@%
  11119.  
  11120. This chapter describes the following topics:  %@NL@%
  11121.  
  11122.  
  11123.   ■   How Heap Walker views memory%@NL@%
  11124.  
  11125.   ■   The Heap Walker window%@NL@%
  11126.  
  11127.   ■   Using Heap Walker commands to examine the global heap
  11128. %@NL@%
  11129.  
  11130.  
  11131.  
  11132. %@2@%%@CR:C6A00110004 @%%@AB@%11.1  How Heap Walker Views Memory%@AE@%%@EH@%%@NL@%
  11133.  
  11134. Heap Walker displays the global heap when Windows is running in either
  11135. protected or real mode. The heap differs from one mode to the other. The
  11136. following sections describe the differences.  %@NL@%
  11137.  
  11138.  
  11139. %@3@%%@CR:C6A00110005 @%%@AB@%11.1.1  Viewing the Heap in Protected Mode%@AE@%%@EH@%%@NL@%
  11140.  
  11141. If Windows is running in protected (standard or 386 enhanced) mode, the heap
  11142. is an area of memory that starts above DOS, TSR, and system drivers.  %@NL@%
  11143.  
  11144. When viewing the heap in protected mode, Heap Walker identifies objects by
  11145. selector. The CPU uses selectors to indirectly specify memory addresses.%@CR:C6A00110006 @%%@NL@%
  11146.  
  11147.  
  11148. %@3@%%@CR:C6A00110007 @%%@AB@%11.1.2  Viewing the Heap in Real Mode%@AE@%%@EH@%%@NL@%
  11149.  
  11150. If Windows is running in real mode, the heap can consist of one of the
  11151. following:%@CR:C6A00110008 @%%@NL@%
  11152.  
  11153.  
  11154.   ■   The heap that starts above DOS, TSR programs, and system drivers, and
  11155.       ends at the top of DOS memory.%@NL@%
  11156.  
  11157.   ■   The heap that Windows uses in real mode plus expanded memory that
  11158.       Windows can map into the 1-megabyte address space. Windows accesses
  11159.       this area of memory using handles to appropriate segments. This access
  11160.       mechanism, called the Expanded Memory Specification (EMS), is
  11161.       transparent to an application.%@CR:C6A00110009 @% %@CR:C6A00110010 @%%@NL@%
  11162.  
  11163.  
  11164.  
  11165. %@2@%%@CR:C6A00110011 @%%@AB@%11.2  The Heap Walker Window%@AE@%%@EH@%%@NL@%
  11166.  
  11167. Figure 11.1 illustrates the Heap Walker window after the user has executed a
  11168. Walk command.%@CR:C6A00110012 @%%@NL@%
  11169.  
  11170. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  11171.  
  11172. By default, Heap Walker displays all global objects in the area of memory
  11173. below the EMS line, starting at the bottom of the heap. To display objects
  11174. in the heap that includes expanded memory, use the EMS menu described in
  11175. Table 11.2, "Walk Commands."  %@NL@%
  11176.  
  11177. Whether you examine the heap below the line or the EMS heap, Heap Walker
  11178. displays the following information about each object:%@CR:C6A00110013 @%%@NL@%
  11179.  
  11180.  
  11181.   ■   ADDR (real mode only)─Segment of the object arena header; the object
  11182.       starts one paragraph later.%@NL@%
  11183.  
  11184.   ■   SLCT (protected mode only)─Selector of the object.%@NL@%
  11185.  
  11186.   ■   HANDL─Handle of the memory object.%@NL@%
  11187.  
  11188.   ■   SIZE─Size of the object, in bytes.%@NL@%
  11189.  
  11190.   ■   LOCK─Lock count of the object.%@NL@%
  11191.  
  11192.   ■   FLAG─"D" if the object is discardable; "S" if it is shareable.%@NL@%
  11193.  
  11194.   ■   OWNER-NAME─Owner of the object.%@NL@%
  11195.  
  11196.   ■   OBJ-TYPE─Type of the object. %@NL@%
  11197.  
  11198.   ■   ADD-INFO─Additional information that describes the kind of resource
  11199.       objects allocated.%@NL@%
  11200.  
  11201.  
  11202.  
  11203. %@2@%%@CR:C6A00110014 @%%@AB@%11.3  Using Heap Walker Commands%@AE@%%@EH@%%@NL@%
  11204.  
  11205. Heap Walker commands let you do the following:  %@NL@%
  11206.  
  11207.  
  11208.   ■   Perform file operations%@NL@%
  11209.  
  11210.   ■   Walk the heap %@NL@%
  11211.  
  11212.   ■   Sort memory objects %@NL@%
  11213.  
  11214.   ■   Show objects %@NL@%
  11215.  
  11216.   ■   Allocate part or all of the heap%@NL@%
  11217.  
  11218.   ■   Add the size of selected memory objects %@NL@%
  11219.  
  11220.  
  11221. The following sections describe Heap Walker commands.  %@NL@%
  11222.  
  11223.  
  11224. %@3@%%@CR:C6A00110015 @%%@AB@%11.3.1  Performing File Operations: The File Menu%@AE@%%@EH@%%@NL@%
  11225.  
  11226. Table 11.1 describes Heap Walker commands that perform basic file
  11227. operations.%@CR:C6A00110016 @%%@CR:C6A00110017 @%%@CR:C6A00110018 @%%@NL@%
  11228.  
  11229. Table 11.1  File Operation Commands
  11230.  
  11231. %@TH:  16   857 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Save                              Saves the current listing of objects on                                   the heap to a HWG.TXT file. Heap Walker                                   writes the first listing you save to                                   file HWG00.TXT, and numbers subsequent                                   saves consecutively (HWG00.TXT,                                   HWG01.TXT).Exit                              Exits Heap Walker.About Heap Walker                 Displays information about the current                                   version of Heap Walker.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  16   857 02 34 42 @%
  11232.  
  11233. When saving a list of current objects to a file, Heap Walker dumps the heap
  11234. that is displayed on the screen as well as the following information, from
  11235. left to right:  %@NL@%
  11236.  
  11237.  
  11238.   ■   The module name%@NL@%
  11239.  
  11240.   ■   The number of discardable segments loaded in memory%@NL@%
  11241.  
  11242.   ■   The number of bytes that the discardable segments occupy%@NL@%
  11243.  
  11244.   ■   The number of bytes that nondiscardable segments occupy in memory%@NL@%
  11245.  
  11246.   ■   The total number of bytes that the module occupies in memory%@NL@%
  11247.  
  11248.  
  11249.  
  11250. %@3@%%@CR:C6A00110019 @%%@AB@%11.3.2  Walking the Heap: The Walk and EmsWalk Menus%@AE@%%@EH@%%@NL@%
  11251.  
  11252. Table 11.2 describes commands for walking the heap.%@CR:C6A00110020 @%%@CR:C6A00110021 @%%@CR:C6A00110022 @%%@NL@%
  11253.  
  11254. Table 11.2  Walk Commands
  11255.  
  11256. %@TH:  10   644 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Walk Heap                         Displays objects on the heap below the                                   EMS line (real mode only if EMS is                                   present). Each display line identifies                                   one global object. If the heap does not                                   have EMS or the heap is in protected                                   mode, this command displays the entire                                   heap.%@TE:  10   644 02 34 42 @%
  11257.  
  11258. Table 11.2  Walk Commands (continued)
  11259.  
  11260. %@TH:  44  2570 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Walk LRU List                     Displays only discardable objects. The                                   Heap Walker lists objects from the least                                  recently used to the most recently used.                                  The object at the top of the list has                                   been least recently used and, therefore,                                  is most eligible for discarding. Walk Free List                    Displays only free blocks of memory.GC(0) and Walk                    Performs a global compact, asking for                                   zero bytes, then displays the heap.GC(-1) and Walk                   Attempts to throw out all discardable                                   objects and then displays the heap.GC(-1) and Hit A:                 Attempts to throw out all discardable                                   objects, then accesses drive A. Used to                                   test critical error handling. Set Swap Area                     Resets the code fence. The code fence                                   defines an area of memory reserved for                                   discardable code. Segmentation Test                 Dumps the heap to a file called                                   HWG00.TXT and does a global compact (-1).                                  Heap Walker numbers files consecutively                                   in subsequent dumps. This command is                                   available whenever Heap Walker is in the                                  system and EMS memory is not installed,                                   even if Heap Walker is not the active                                   application. Specified application             Walks the heap of a specified                                   application using the Expanded Memory                                   Specification. An EMS walk comprises                                   relevant objects in memory above the EMS                                  line and below 1-megabyte.. This command                                  is available only in real mode for                                   systems with EMS installed. %@CR:C6A00110023 @%%@CR:C6A00110024 @%%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  44  2570 02 34 42 @%
  11261.  
  11262.  
  11263. %@3@%%@CR:C6A00110025 @%%@AB@%11.3.3  Sorting Memory Objects: The Sort Menu%@AE@%%@EH@%%@NL@%
  11264.  
  11265. Heap Walker lets you sort memory objects in a variety of ways. Table 11.3
  11266. describes Heap Walker sort commands.%@CR:C6A00110026 @%%@CR:C6A00110027 @%%@CR:C6A00110028 @%%@NL@%
  11267.  
  11268. Table 11.3  Sort Commands
  11269.  
  11270. %@TH:  15   598 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Address (real mode only)          Sorts by address.Selector (protected mode only)    Sorts by selector.Module                            Sorts by module name.Size                              Sorts by object size.Label Segments                    Substitutes segment names for segment                                   numbers.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  15   598 02 34 42 @%
  11271.  
  11272.  
  11273. %@3@%%@CR:C6A00110029 @%%@AB@%11.3.4  Displaying Memory Objects: The Object Menu%@AE@%%@EH@%%@NL@%
  11274.  
  11275. Heap Walker lets you view objects selectively. Table 11.4 describes commands
  11276. to control and display memory objects.%@CR:C6A00110030 @%%@CR:C6A00110031 @%%@CR:C6A00110032 @%%@CR:C6A00110033 @%%@NL@%
  11277.  
  11278. Table 11.4  Memory Object Commands
  11279.  
  11280. %@TH:  53  2677 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Show                              Displays the contents of a selected                                   object in hexadecimal and ASCII format.Show Bits                         Displays the bitmap (if any) of a                                   selected graphics device interface (GDI)                                  object such as a font or cursor.Discard                           Discards a selected object. Oldest                            Marks a selected object as the next                                   candidate for                                   discarding.Newest                            Marks a selected object as the last                                   candidate for                                   discarding.LocalWalk                         Displays the local heap of the currently                                  selected object. The object must be a                                   data segment. The local walk window                                   shows the following:                                   OFFSET─The offset from the DS register                                   of the object                                  SIZE─Size in bytes of the object                                  MOV/FIX─Indicates whether the object is                                   moveable or fixed                                   FLAGS─Indicates whether or not an object                                  is discardable                                   OBJ TYPE─Object type                                  Windows allocates the first object in                                   the local heap, so there are always at                                   least two objects in a local heap.                                   LocalWalk has a File menu with a Save                                   command that saves to a file named                                   HWL00.TXT. Heap Walker numbers files                                   consecutively on subsequent dumps                                   (HWL00.TXT, HWL01.TXT).LC(-1) and LocalWalk              Compacts the selected local heap, then                                   displays the heap. LocalWalk has a Save                                   command that saves to a file named                                   HWL00.TXT. Heap Walker numbers files                                   consecutively on subsequent dumps                                   (HWL00.TXT, HWL01.TXT).%@TE:  53  2677 02 34 42 @%
  11281.  
  11282. Table 11.4  Memory Object Commands (continued)
  11283.  
  11284. %@TH:  11   701 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%GDI LocalWalk                     Displays the GDI local heap and provides                                  information on the objects in the heap.                                   LocalWalk has a Save command that saves                                   to a file named HWL00.TXT. Heap Walker                                   numbers files consecutively on                                   subsequent dumps (HWL00.TXT, HWL01.TXT).%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  11   701 02 34 42 @%
  11285.  
  11286.  
  11287. %@3@%%@CR:C6A00110034 @%%@AB@%11.3.5  Allocating Memory: The Alloc Menu%@AE@%%@EH@%%@NL@%
  11288.  
  11289. Heap Walker lets you allocate part or all of memory. Table 11.5 describes
  11290. commands that allocate memory.%@CR:C6A00110035 @%%@CR:C6A00110036 @%%@CR:C6A00110037 @%%@CR:C6A00110038 @%%@NL@%
  11291.  
  11292. Table 11.5  Memory Allocation Commands
  11293.  
  11294. %@TH:  39  2009 02 34 42 @%Command                           Action%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Allocate all of memory            Allocates all free memory. This command                                   is useful for testing out-of-memory                                   conditions in applications. Free allocated memory             Frees memory allocated by the Allocate                                   all of memory command. Free 1K                           Frees 1K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free 2K                           Frees 2K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free 5K                           Frees 5K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free 10K                          Frees 10K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free 25K                          Frees 25K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free 50K                          Frees 50K of memory. Applies only to                                   memory allocated by the Allocate all of                                   memory command.Free XK                           Frees a specified number of kilobytes of                                  memory. Heap Walker displays a dialog                                   box that lets you specify the number.%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@TE:  39  2009 02 34 42 @%
  11295.  
  11296.  
  11297. %@3@%%@CR:C6A00110039 @%%@AB@%11.3.6  Determining Memory Size: The Add! Menu%@AE@%%@EH@%%@NL@%
  11298.  
  11299. Heap Walker lets you determine the total size of selected memory objects. To
  11300. add the total number of bytes of selected objects, choose the Add! menu. The
  11301. menu is a command that displays the number of selected segments and total
  11302. segment size in a dialog box.%@CR:C6A00110040 @%%@CR:C6A00110041 @%%@CR:C6A00110042 @%%@NL@%
  11303.  
  11304.  
  11305. %@2@%%@CR:C6A00110043 @%%@AB@%11.4  Suggestions for Using Heap Walker%@AE@%%@EH@%%@NL@%
  11306.  
  11307. One error that frequently occurs in applications is the failure to free
  11308. memory objects once they are no longer needed. This can cause Windows to
  11309. fail when one of its data segments grows beyond the 64K limit.  %@NL@%
  11310.  
  11311. You can use Heap Walker to help determine if your application is not freeing
  11312. memory objects. Heap Walker lets you view changes in the size of all Windows
  11313. data segments, allowing you to observe the effect your application has on
  11314. these segments.  %@NL@%
  11315.  
  11316. To check how your application changes the size of the Windows data segments,
  11317. follow these steps:  %@NL@%
  11318.  
  11319.  
  11320.   1.  Make sure that your application does not generate fatal exits.%@NL@%
  11321.  
  11322.   2.  Start the debugging version of Windows, making sure that all the
  11323.       values for settings in the [kernel] section of WIN.INI are correct.%@NL@%
  11324.  
  11325.   3.  Immediately start Heap Walker and note the sizes of the GDI and USER
  11326.       data segments. This establishes the baseline against which you can
  11327.       compare the size of the data segments later.%@NL@%
  11328.  
  11329.   4.  Select the Object GDI LocalWalk(DATASEG) menu option to display a
  11330.       window that lists the different objects in the GDI data segment.
  11331.       Select the Save! menu option of this window to copy this list to a
  11332.       file; the file will also contain a summary of GDI objects.%@NL@%
  11333.  
  11334.   5.  Run your application and exercise it fully over a long period of time,
  11335.       noting the changes in the size of the GDI and USER data segments which
  11336.       Heap Walker displays as your application runs. While your application
  11337.       is running, repeat step 4 a number of times to take "snapshots" of the
  11338.       effect your application has on the GDI data segment.%@NL@%
  11339.  
  11340.   6.  Close your application, take a final "snapshot" of the GDI data
  11341.       segment, and note the total sizes of the GDI and USER data segments.%@NL@%
  11342.  
  11343.  
  11344. As you analyze the data that you've recorded, you should look for GDI
  11345. objects that your application creates but does not delete when they are no
  11346. longer needed.  %@NL@%
  11347.  
  11348. You should also check the size of the USER data segment before and after you
  11349. run your application. While it is normal for the USER data segment to be a
  11350. little larger after your application has run once, it should not grow larger
  11351. after you have run your application additional times. If it does, your
  11352. application probably is calling the %@AB@%MakeProcInstance%@AE@% function without
  11353. calling %@AB@%FreeProcInstance%@AE@% to free the procedure-instance address when it is
  11354. no longer needed.  %@NL@%
  11355.  
  11356.  
  11357. %@2@%%@CR:C6A00110044 @%%@AB@%11.5  Summary%@AE@%%@EH@%%@NL@%
  11358.  
  11359. Heap Walker is a tool that lets you examine objects on the global heap. For
  11360. more information on the heap, see Chapter 15, "Memory Management," and
  11361. Chapter 16, "More Memory Management," in%@AI@% Guide to Programming.  %@AE@%%@NL@%
  11362.  
  11363.  
  11364.  
  11365.  
  11366.  
  11367.  
  11368. %@CR:C6A00120001 @%%@1@%%@AB@%Chapter 12  Moving Memory: Shaker%@AE@%%@EH@%%@NL@%
  11369. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11370.  
  11371. The Microsoft Windows Shaker (%@AB@%SHAKER%@AE@%) lets you see the effect of memory
  11372. movement on your application. Shaker randomly allocates and frees chunks of
  11373. global memory with the intention of forcing the system to relocate moveable
  11374. data or code segments in your application.  %@NL@%
  11375.  
  11376. Shaker is useful for making sure that no problems occur when memory moves.%@CR:C6A00120002 @%%@CR:C6A00120003 @%%@CR:C6A00120004 @%%@NL@%
  11377.  
  11378. This chapter describes commands you use to allocate and free global memory.
  11379. %@NL@%
  11380.  
  11381.  
  11382. %@2@%%@CR:C6A00120005 @%%@AB@%12.1  Using Shaker%@AE@%%@EH@%%@NL@%
  11383.  
  11384. To use Shaker, select the parameters you want and start Shaker. You select
  11385. parameters and start or stop Shaker with the following commands on the menu
  11386. bar:  %@NL@%
  11387.  
  11388. %@AB@%Command%@AE@%                           %@AB@%Function%@AE@%
  11389. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11390. Parameter                         Displays a dialog box that lets you 
  11391.                                   specify the following parameters:
  11392.  
  11393.                                   ■ Allocation Granularity─Sets the 
  11394.                                   minimum
  11395.                                   size of the objects to be allocated. 
  11396.                                   Each object
  11397.                                   is some multiple of this size; for 
  11398.                                   example, if the granularity is 128, 
  11399.                                   Shaker allocates objects that have byte 
  11400.                                   sizes of 128, 256, 384, and so on. The 
  11401.                                   smaller the granularity, the more likely
  11402.                                   it is that the allocated objects will 
  11403.                                   fit in the spaces between global objects.
  11404.                                   %@CR:C6A00120006 @% %@CR:C6A00120007 @%%@CR:C6A00120008 @%
  11405.  
  11406.                                   ■ Time Interval─Sets the time interval, 
  11407.                                   in system-timer ticks, between 
  11408.                                   allocations. Shaker allocates a new 
  11409.                                   object after each interval elapses. If 
  11410.                                   the maximum number of objects has been 
  11411.                                   allocated, it reallocates one it had 
  11412.                                   previously allocated. 
  11413.  
  11414.                                   ■ Max Objects─Sets the maximum number 
  11415.                                   of
  11416.                                   objects to be allocated.
  11417.  
  11418. Display                           Displays or removes the display of 
  11419.                                   object handles and allocation sizes.
  11420.  
  11421. %@AB@%Command%@AE@%                           %@AB@%Function%@AE@%
  11422. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11423. Start                             Starts the allocation.
  11424.  
  11425. Stop                              Stops the allocation.
  11426.  
  11427. Step                              Allocates one object and stops. This 
  11428.                                   command can be used when Shaker is 
  11429.                                   otherwise stopped.%@CR:C6A00120009 @% 
  11430.  
  11431.  
  11432. %@2@%%@CR:C6A00120010 @%%@AB@%12.2  Summary%@AE@%%@EH@%%@NL@%
  11433.  
  11434. Shaker is a tool that shows you the effect of memory movement on your
  11435. application. For more information on memory management, see Chapter 15,
  11436. "Memory Management," and Chapter 16, "More Memory Management," in %@AI@% Guide to
  11437. %@AI@%Programming%@AE@%.  %@NL@%
  11438.  
  11439.  
  11440.  
  11441.  
  11442.  
  11443.  
  11444. %@CR:C6A00130001 @%%@1@%%@AB@%Chapter 13  Analyzing CPU Time: Profiler%@AE@%%@EH@%%@NL@%
  11445. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11446.  
  11447. Microsoft Windows Profiler (%@AB@%PROFILER%@AE@%) is an analytical tool that helps you
  11448. optimize the performance of Windows applications. Profiler lets you sample
  11449. the amount of time Windows spends executing sections of code.%@CR:C6A00130002 @%%@NL@%
  11450.  
  11451. This chapter describes the following topics:  %@NL@%
  11452.  
  11453.  
  11454.   ■   An overview of Profiler%@NL@%
  11455.  
  11456.   ■   Preparing to run Profiler%@NL@%
  11457.  
  11458.   ■   Using Profiler functions%@NL@%
  11459.  
  11460.   ■   Sampling code%@NL@%
  11461.  
  11462.   ■   Displaying samples%@NL@%
  11463.  
  11464.  
  11465. Profiler analyzes applications running with Windows in real mode or in 386
  11466. enhanced mode; it cannot analyze applications running with Windows in
  11467. standard mode. If you are analyzing Windows applications in real mode, you
  11468. use Profiler differently than if you are analyzing applications running with
  11469. Windows in 386 enhanced mode. Section 13.4, "Sampling Code," discusses the
  11470. differences. Profiler does not support Windows running in standard mode.  %@NL@%
  11471.  
  11472.  
  11473. %@2@%%@CR:C6A00130003 @%%@AB@%13.1  Overview of Profiler%@AE@%%@EH@%%@NL@%
  11474.  
  11475. Profiler contains the following:  %@NL@%
  11476.  
  11477.  
  11478.   ■   A sampling utility%@NL@%
  11479.  
  11480.   ■   A reporting utility%@NL@%
  11481.  
  11482.   ■   A set of functions that you call from your application%@NL@%
  11483.  
  11484.  
  11485. The sampling utility gathers information about the time spent between
  11486. adjacent labels, and records memory addresses of code. If the application
  11487. you are profiling runs with Windows in real mode, the sampling utility is
  11488. PROF.COM. To run the Profiler you invoke PROF.COM, which in turns invokes
  11489. Windows.  %@NL@%
  11490.  
  11491. If the application you are profiling runs with Windows in 386 enhanced mode,
  11492. the sampling utility is a special device driver, VPROD.386. To run Profiler,
  11493. first install VPROD.386, and then run Windows directly.  %@NL@%
  11494.  
  11495. Profiler stores the information it gathers in a buffer. It writes the buffer
  11496. to disk when Windows terminates, producing a CSIPS.DAT file and a
  11497. SEGENTRY.DAT file in the directory that was your current directory when you
  11498. started Windows. The CSIPS.DAT file contains statistical samplings of the
  11499. code segment (CS), instruction pointer (IP) registers. The SEGENTRY.DAT file
  11500. contains information about the movement of code segments. Because code
  11501. segments can be located at different physical addresses during the execution
  11502. of the program, information in both the CSIPS.DAT and SEGENTRY.DAT files are
  11503. required to prepare the profiling report. %@CR:C6A00130004 @% %@CR:C6A00130005 @% %@CR:C6A00130006 @% %@CR:C6A00130007 @%%@NL@%
  11504.  
  11505. After the sampling utility has finished gathering information, the reporting
  11506. utility, SHOWHITS.EXE, organizes and displays the results.%@CR:C6A00130008 @%%@NL@%
  11507.  
  11508. Profiler's functions let you start and stop examining code, manage the
  11509. output of code samples, and get information about Profiler. All applications
  11510. that Profiler examines must include two functions that start and stop the
  11511. sampling of code. Other Profiler functions are optional.  %@NL@%
  11512.  
  11513.  
  11514. %@2@%%@CR:C6A00130009 @%%@AB@%13.2  Preparing to Run Profiler%@AE@%%@EH@%%@NL@%
  11515.  
  11516. To profile a Windows application in real mode, you need an IBM PC/AT(R) or
  11517. PS/2(R) compatible system because Profiler uses the AT CMOS clock chip to
  11518. time sampling intervals. The utility will not run on standard PC and
  11519. PC/XT(tm) systems.  %@NL@%
  11520.  
  11521. To profile an application running with Windows in 386 enhanced mode, use any
  11522. system capable of running Windows in 386 enhanced mode.%@CR:C6A00130010 @%%@CR:C6A00130011 @%%@NL@%
  11523.  
  11524. In addition to ensuring that your system is compatible with Profiler, you
  11525. must do the following:  %@NL@%
  11526.  
  11527.  
  11528.   1.  Ensure that the Windows directory is defined in your PATH environment
  11529.       variable.%@NL@%
  11530.  
  11531.   2.  Include in your application at least two mandatory Profiler functions,
  11532.       %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@%. %@NL@%
  11533.  
  11534. %@STUB@%      %@AB@%ProfStart%@AE@% indicates when you want Profiler to start sampling code;
  11535.       %@AB@%ProfStop%@AE@% indicates when you want Profiler to stop sampling. Other
  11536.       functions are optional.%@NL@%
  11537.  
  11538.   3.  Compile your application and link the compiled code with the standard
  11539.       Windows libraries. Use the %@AB@%LINK /m%@AE@% option to prepare a .MAP file. This
  11540.       file is required by the %@AB@%MAPSYM%@AE@% utility.%@CR:C6A00130012 @%%@NL@%
  11541.  
  11542.   4.  Use %@AB@%MAPSYM%@AE@% to produce an application symbol (.SYM) file.%@NL@%
  11543.  
  11544.  
  11545.  
  11546. %@2@%%@CR:C6A00130013 @%%@AB@%13.3  Using Profiler Functions%@AE@%%@EH@%%@NL@%
  11547.  
  11548. In addition to the mandatory %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@% functions, Profiler
  11549. includes functions that determine if Profiler is installed, specify a rate
  11550. for sampling, and control the output buffer.  %@NL@%
  11551.  
  11552. The way you use the Profiler functions depends on whether your application
  11553. runs in real mode or in 386 enhanced mode.%@CR:C6A00130014 @%%@NL@%
  11554.  
  11555. If your application runs with Windows in real mode and you want to override
  11556. the standard sampling rate or the amount of data that the Profiler writes to
  11557. disk, you can use either command line options when invoking the Profiler or
  11558. Profiler functions. For information on using command line options, see
  11559. Section 13.4, "Sampling Code."  %@NL@%
  11560.  
  11561. If your application runs with Windows in 386 enhanced mode and you want to
  11562. specify nondefault values, you must use Profiler functions. You cannot
  11563. change default values when invoking the utility.%@CR:C6A00130015 @%%@CR:C6A00130016 @%%@NL@%
  11564.  
  11565. The sections that follow describe Profiler functions.  %@NL@%
  11566.  
  11567.  
  11568. %@3@%%@CR:C6A00130017 @%%@AB@%13.3.1  Starting and Stopping Sampling: The ProfStart and ProfStop Functions%@AE@%%@EH@%%@NL@%
  11569.  
  11570. Use the %@AB@%ProfStart%@AE@% and%@AB@% ProfStop%@AE@% functions for each section of code that you
  11571. want to sample. Deciding where to call%@AB@% ProfStart%@AE@% and %@AB@%ProfStop%@AE@% is important.
  11572. You should avoid sampling when your application calls Windows functions that
  11573. yield to other applications. For example, sampling a function such as
  11574. %@AB@%GetMessage%@AE@% could cause Profiler to collect data on applications other than
  11575. your own. %@CR:C6A00130018 @% %@CR:C6A00130019 @% %@CR:C6A00130020 @%%@CR:C6A00130021 @%%@NL@%
  11576.  
  11577. The following example illustrates when to call %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@%:  %@NL@%
  11578.  
  11579. %@AS@%  #include "windows.h" 
  11580. %@AS@%  #include "hello.h"   
  11581. %@AS@%     . 
  11582. %@AS@%     . 
  11583. %@AS@%     . 
  11584. %@AS@%  void HelloPaint( hDC )
  11585. %@AS@%  HDC hDC;
  11586. %@AS@%  {
  11587. %@AS@%      int i, j;
  11588. %@AS@%     
  11589. %@AS@%      ProfStart();%@AE@%
  11590.  
  11591. %@AS@%  for(i = 1; i <= 3; i++)
  11592. %@AS@%        for(j = 1; j <= 20; j++)
  11593. %@AS@%   {
  11594. %@AS@%        TextOut( hDC,
  11595. %@AS@%                   (short)(i * 120),
  11596. %@AS@%                    (short)(j * 12),
  11597. %@AS@%                    (LPSTR)szMessage,
  11598. %@AS@%                    (short)MessageLength );
  11599. %@AS@%   }
  11600. %@AS@%      ProfStop();
  11601. %@AS@%  }
  11602. %@AS@%     .
  11603. %@AS@%     .
  11604. %@AS@%     .%@AE@%
  11605.  
  11606. In this example, the Profiler %@AB@%ProfStart%@AE@% and %@AB@%ProfStop%@AE@% functions specify that
  11607. Profiler sample the application's %@AB@%HelloPaint%@AE@% function. Profiler samples only
  11608. the nested loops that include the call to the %@AB@%TextOut%@AE@% function.  %@NL@%
  11609.  
  11610.  
  11611. %@3@%%@CR:C6A00130022 @%%@AB@%13.3.2  Checking if Profiler Is Installed: The ProfInsChk Function%@AE@%%@EH@%%@NL@%
  11612.  
  11613. To determine if Profiler is installed, use the %@AB@%ProfInsChk%@AE@% function.
  11614. %@AB@%ProfInsChk%@AE@% has the following syntax:  %@NL@%
  11615.  
  11616. %@AS@%  int FAR PASCAL ProfInsChk(void)%@AE@%
  11617.  
  11618. The function returns the following values:  %@NL@%
  11619.  
  11620.  
  11621.   ■   0 if Profiler is not installed %@NL@%
  11622.  
  11623.   ■   1 if the Windows real-mode Profiler is installed%@NL@%
  11624.  
  11625.   ■   2 if the Windows 386-enhanced-mode Profiler is installed%@NL@%
  11626.  
  11627.  
  11628. If Profiler is not installed, the system ignores other Profiler function
  11629. calls.%@CR:C6A00130023 @%%@CR:C6A00130024 @%%@NL@%
  11630.  
  11631.  
  11632. %@3@%%@CR:C6A00130025 @%%@AB@%13.3.3  Setting the Sampling Rate: The ProfSampRate Function%@AE@%%@EH@%%@NL@%
  11633.  
  11634. To set the rate of code sampling, use the %@AB@%ProfSampRate%@AE@% function.
  11635. %@AB@%ProfSampRate%@AE@% has the following syntax: %@CR:C6A00130026 @%%@NL@%
  11636.  
  11637. %@AS@%  void FAR PASCAL ProfSampRate(int,int)%@AE@%
  11638.  
  11639. The first parameter specifies the sampling rate of Profiler if the
  11640. application is running with Windows in real mode. The value of the first
  11641. parameter ranges from 1 to 13, indicating the following sampling rates:%@CR:C6A00130027 @%%@CR:C6A00130028 @%%@NL@%
  11642.  
  11643. %@AB@%Numeric Value%@AE@%                     %@AB@%Sampling Rate%@AE@%
  11644. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11645. 1                                 122.070 microseconds
  11646.  
  11647. 2                                 244.141 microseconds
  11648.  
  11649. 3                                 488.281 microseconds
  11650.  
  11651. 4                                 976.562 microseconds
  11652.  
  11653. 5                                 1.953125 milliseconds
  11654.  
  11655. 6                                 3.90625 milliseconds
  11656.  
  11657. 7                                 7.8125 milliseconds
  11658.  
  11659. 8                                 15.625 milliseconds
  11660.  
  11661. 9                                 31.25 milliseconds
  11662.  
  11663. 10                                62.5 milliseconds
  11664.  
  11665. 11                                125 milliseconds
  11666.  
  11667. 12                                250 milliseconds
  11668.  
  11669. 13                                500 milliseconds
  11670.  
  11671. The second parameter defines sampling rates if Profiler is analyzing an
  11672. application running with Windows in 386 enhanced mode. The value of the
  11673. second parameter can range from 1 to 1000, specifying the sampling rate in
  11674. milliseconds.  %@NL@%
  11675.  
  11676. For Windows in real mode the initial rate is 5 (1.953125 milliseconds) or
  11677. what you specify when invoking PROF.COM.  %@NL@%
  11678.  
  11679. For Windows in 386 enhanced mode, the default rate is 2 milliseconds.  %@NL@%
  11680.  
  11681. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11682. NOTE
  11683.  
  11684. %@AI@%Profiler selects only the parameter appropriate for the version of Windows
  11685. %@AI@%used. If your application runs with Windows in real mode, Profiler reads
  11686. %@AI@%only the first parameter; if your application runs with Windows in 386
  11687. %@AI@%enhanced mode, Profiler reads only the second. %@CR:C6A00130029 @%%@CR:C6A00130030 @%%@AE@%
  11688. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11689.  
  11690.  
  11691. %@3@%%@CR:C6A00130031 @%%@AB@%13.3.4  Managing Output: The ProfClear, ProfFlush, and ProfSetup Functions%@AE@%%@EH@%%@NL@%
  11692.  
  11693. To manage the output of samples that Profiler gathers, use the %@AB@%ProfClear%@AE@%,%@AB@%
  11694. %@AB@%ProfFlush%@AE@%, and%@AB@% ProfSetup%@AE@% functions. %@AB@%ProfClear%@AE@% discards all samples currently
  11695. in the sampling buffer.%@AB@% ProfFlush%@AE@% flushes the sampling buffer to disk,
  11696. provided that samples do not exceed the limit you define.%@CR:C6A00130032 @%%@CR:C6A00130033 @%%@NL@%
  11697.  
  11698. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11699. IMPORTANT
  11700.  
  11701. %@AI@%Use %@AB@%ProfFlush%@AE@%%@AI@% sparingly because it can distort the performance of your
  11702. %@AI@%application. Additionally, do not call the function when DOS may be
  11703. %@AI@%unstable, as in interrupt handling.%@AE@%%@AE@%
  11704. ────────────────────────────────────────────────────────────────────────────%@NL@%
  11705.  
  11706. The %@AB@%ProfSetup%@AE@% function lets you specify the size of the output buffer and
  11707. the amount of samples written to disk. %@AB@%ProfSetup%@AE@% is available only to
  11708. applications running with Windows in 386 enhanced mode.  %@NL@%
  11709.  
  11710. If your application runs with Windows in real mode, you must specify the
  11711. size of the output buffer and the size of sampling data when you invoke
  11712. Profiler.  %@NL@%
  11713.  
  11714. The syntax of %@AB@%ProfSetup%@AE@% is as follows:  %@NL@%
  11715.  
  11716. %@AS@%  void FAR PASCAL ProfSetup(int, int)%@AE@%
  11717.  
  11718. The first parameter specifies the size of the output buffer in kilobytes
  11719. (K), from 1 to 1064. The default value is 64.  %@NL@%
  11720.  
  11721. The second parameter controls how much sampling data Profiler writes to
  11722. disk. Default value is the size of the output buffer in kilobytes. A value
  11723. of 0 specifies unlimited sampling data.  %@NL@%
  11724.  
  11725. The following example uses %@AB@%ProfSetup%@AE@% to specify values for the size of the
  11726. output buffer and the amount of samples written to disk. It also calls
  11727. %@AB@%ProfSampRate%@AE@% to change the default sampling rate.  %@NL@%
  11728.  
  11729. %@AS@%  BOOL HelloInit( hInstance )
  11730. %@AS@%  HANDLE hInstance;
  11731. %@AS@%  {
  11732. %@AS@%      PWNDCLASS   pHelloClass;
  11733. %@AS@%     .
  11734. %@AS@%     .
  11735. %@AS@%     .%@AE@%
  11736.  
  11737. %@AS@%  int PASCAL WinMain( hInstance, hPrevInstance, lpszCmdLine, cmdShow )
  11738. %@AS@%  HANDLE hInstance, hPrevInstance;
  11739. %@AS@%  LPSTR lpszCmdLine;
  11740. %@AS@%  int cmdShow;
  11741. %@AS@%  {
  11742. %@AS@%      MSG   msg;
  11743. %@AS@%      HWND  hWnd;
  11744. %@AS@%      HMENU hMenu;
  11745. %@AS@%     .
  11746. %@AS@%     .
  11747. %@AS@%     .
  11748. %@AS@%      ProfSetup(100,0);
  11749. %@AS@%      ProfSampRate(4,1);
  11750. %@AS@%     .
  11751. %@AS@%     .
  11752. %@AS@%     .%@AE@%
  11753.  
  11754. In this example, the %@AB@%ProfSetup%@AE@% function changes the default sample buffer
  11755. size from 64K to 100K and specifies that Profiler write an unlimited amount
  11756. of data to disk. The function applies only if the application is running
  11757. with Windows in 386 enhanced mode. The %@AB@%ProfSampRate%@AE@% function changes default
  11758. sampling rates to 1 millisecond in 386 enhanced mode.%@CR:C6A00130034 @%%@NL@%
  11759.  
  11760. If the application runs with Windows in real mode, Profiler ignores the
  11761. %@AB@%ProfSetup%@AE@% call. The %@AB@%ProfSampRate%@AE@% function changes default sampling rates to
  11762. 976.562 microseconds in real mode.  %@NL@%
  11763.  
  11764.  
  11765. %@3@%%@CR:C6A00130035 @%%@AB@%13.3.5  Stopping Profiler: The ProfFinish Function%@AE@%%@EH@%%@NL@%
  11766.  
  11767. To stop Profiler, use the %@AB@%ProfFinish%@AE@% function. %@AB@%ProfFinish%@AE@% stops sampling and
  11768. flushes the output buffer to disk. If your application is running with
  11769. Windows in 386 enhanced mode, %@AB@%ProfFinish%@AE@% also frees the buffer for system
  11770. use.%@CR:C6A00130036 @%%@CR:C6A00130037 @%%@NL@%
  11771.  
  11772. If you do not call %@AB@%ProfFinish%@AE@%, the output buffer automatically flushes to
  11773. disk when you terminate Windows.  %@NL@%
  11774.  
  11775. If you are profiling more than one instance of the same application, calling
  11776. the %@AB@%ProfFinish%@AE@% function will stop Profiler for all instances of the
  11777. application.  %@NL@%
  11778.  
  11779.  
  11780. %@2@%%@CR:C6A00130038 @%%@AB@%13.4  Sampling Code%@AE@%%@EH@%%@NL@%
  11781.  
  11782. The method you use to sample code depends on the version of Windows your
  11783. application runs with. If your application runs with Windows in real mode,
  11784. you invoke the PROF.COM program, which loads and runs Windows. If your
  11785. application runs with Windows in 386 enhanced mode, you first install
  11786. VPROD.386, a virtual device driver, and then run Windows directly.  %@NL@%
  11787.  
  11788. In real mode, the Profiler output buffer is limited to 64K. In 386 enhanced
  11789. mode, your application can call %@AB@%ProfSetup%@AE@% to set the size of the output
  11790. buffer up to 1064K.  %@NL@%
  11791.  
  11792. Both sampling methods use memory that is otherwise available to Windows.
  11793. Therefore, using Profiler may decrease the performance of the application
  11794. you are analyzing. You can reduce the amount of memory used by specifying a
  11795. small output buffer. However, a small output buffer may cause sample loss.  %@NL@%
  11796.  
  11797. Profiler can write samples to disk only when Windows indicates it is safe to
  11798. do so. When the sampling buffer fills, Profiler ignores additional samples
  11799. until the buffer is flushed to disk. To minimize sample loss, either
  11800. 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@%
  11801.  
  11802. The following sections describe features specific to Windows in real mode,
  11803. and Windows in 386 enhanced mode.%@CR:C6A00130045 @%%@CR:C6A00130046 @%%@CR:C6A00130047 @%%@NL@%
  11804.  
  11805.  
  11806. %@3@%%@CR:C6A00130048 @%%@AB@%13.4.1  Sampling Applications in Windows Real Mode%@AE@%%@EH@%%@NL@%
  11807.  
  11808. To profile applications running with Windows in real mode, use the PROF.COM
  11809. utility.  %@NL@%
  11810.  
  11811. The syntax for invoking PROF.COM is as follows:  %@NL@%
  11812.  
  11813. %@AS@%  PROF «-tn» [[-cn» «-ln» «-d» «program arguments»%@AE@%
  11814.  
  11815. The KERNEL.EXE file must be in the current directory or in the current PATH
  11816. environment. The following describes the command line options:  %@NL@%
  11817.  
  11818. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  11819. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11820. -%@AB@%t%@AE@%%@AI@%n%@AE@%                               Specifies the intervals at which 
  11821.                                   Profiler samples code. For values of %@AI@%n%@AE@%, 
  11822.                                   see the description of real-mode Windows
  11823.                                   arguments to the %@AB@%ProfSampRate%@AE@% function 
  11824.                                   in Section 13.3.3, "Setting the Sampling
  11825.                                   Rate: The ProfSampRate Function."
  11826.  
  11827. -%@AB@%c%@AE@%%@AI@%n%@AE@%                               Specifies the size of the output buffer 
  11828.                                   in kilobytes. The value of %@AI@%n%@AE@% can range 
  11829.                                   from 1 to 64 (default buffer size is 
  11830.                                   64K). 
  11831.  
  11832. -%@AB@%l%@AE@%%@AI@%n%@AE@%                               Limits the total size of samples written
  11833.                                   to disk. If this option is not specified,
  11834.                                   the default is the size of the output 
  11835.                                   buffer.
  11836.  
  11837. -%@AB@%d%@AE@%                                Specifies that the program being 
  11838.                                   analyzed runs with DOS, not Windows. 
  11839.  
  11840. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  11841. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11842. %@AI@%program arguments%@AE@%                 Names the program and arguments, if any,
  11843.                                   that Profiler loads and runs. You would 
  11844.                                   typically place arguments, such as the 
  11845.                                   name of the application you are running,
  11846.                                   on the Windows command line. If 
  11847.                                   specified, the name must include an 
  11848.                                   extension. When profiling Windows 
  11849.                                   applications, this parameter should be 
  11850.                                   the name of the Windows program, 
  11851.                                   typically WIN.COM. %@CR:C6A00130049 @% %@CR:C6A00130050 @% %@CR:C6A00130051 @%
  11852.  
  11853.  
  11854. %@3@%%@CR:C6A00130052 @%%@AB@%13.4.2  Sampling Applications in Windows 386 Enhanced Mode%@AE@%%@EH@%%@NL@%
  11855.  
  11856. The PROF.COM command line options are not available when you profile
  11857. applications that run with Windows in 386 enhanced mode. Instead, you add
  11858. the Profiler functions to your source code to get equivalent results.  %@NL@%
  11859.  
  11860. To profile applications that run with Windows in 386 enhanced mode, do the
  11861. following:%@CR:C6A00130053 @%%@NL@%
  11862.  
  11863.  
  11864.   1.  Install the VPROD.386 driver by adding the following to the [386enh]
  11865.       section of your SYSTEM.INI file:%@CR:C6A00130054 @%%@CR:C6A00130055 @%%@CR:C6A00130056 @%%@CR:C6A00130057 @%
  11866.  
  11867. %@AS@%      DEVICE=VPROD.386%@AE@%
  11868. %@NL@%
  11869.  
  11870.   2.  Run Windows in 386 enhanced mode.%@NL@%
  11871.  
  11872.   3.  Run the application you want to profile.%@NL@%
  11873.  
  11874.   4.  When you have finished profiling your application, remove the
  11875.       VPROD.386 entry from your SYSTEM.INI file.%@NL@%
  11876.  
  11877.  
  11878.  
  11879. %@2@%%@CR:C6A00130058 @%%@AB@%13.5  Displaying Samples: SHOWHITS.EXE%@AE@%%@EH@%%@NL@%
  11880.  
  11881. Use a DOS application, SHOWHITS.EXE, to display data that the Profiler
  11882. gathers. This reporting utility reads CSIPS.DAT, SEGENTRY.DAT, and .SYM
  11883. files, and organizes and displays the data. The sampling utility places the
  11884. CSIPS.DAT and SEGENTRY.DAT files in the current directory. To ensure that
  11885. SHOWHITS can locate these files, either run SHOWHITS from the same
  11886. directory, or else specify full pathnames for the CSIPS.DAT and SEGENTRY.DAT
  11887. files. If the .SYM files are not in the current directory, then use the %@AB@%-i%@AE@%
  11888. option to specify the directory or directories containing the symbols files.%@CR:C6A00130059 @%%@CR:C6A00130060 @%%@CR:C6A00130061 @%%@NL@%
  11889.  
  11890. SHOWHITS.EXE reads .SYM files to match instruction pointer samples with
  11891. global symbols in the application. When you run SHOWHITS.EXE the utility
  11892. searches for .SYM files that contain symbolic names identical to the names
  11893. of modules that Profiler sampled. If the sampled program is written in the C
  11894. language, the symbolic names are typically function names. If the sampled
  11895. program is written in assembly language, the symbolic names can be either
  11896. procedure names or %@AB@%PUBLIC%@AE@% symbols within procedures.  %@NL@%
  11897.  
  11898. SHOWHITS.EXE reports the number of times sampling occurred between  adjacent
  11899. symbols.  %@NL@%
  11900.  
  11901. The syntax for invoking SHOWHITS.EXE is as follows:  %@NL@%
  11902.  
  11903. %@AS@%  SHOWHITS «-r|3» «-ipath [-ipath«...»»» «csips_file» «segentry_file»%@AE@%
  11904.  
  11905. The following describes SHOWHITS.EXE options:  %@NL@%
  11906.  
  11907. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  11908. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11909. -%@AB@%r%@AE@%                                The Profiler was run in real mode 
  11910.                                   (PROF.COM). SHOWHITS uses the KERNEL.SYM
  11911.                                   Windows
  11912.                                   kernel symbol file.
  11913.  
  11914. -%@AB@%3%@AE@%                                The Profiler was run in 386 enhanced 
  11915.                                   mode (VPROD.386). SHOWHITS uses the 
  11916.                                   KRNL386.SYM Windows kernel symbol file.
  11917.  
  11918. -%@AB@%i%@AE@%%@AI@%path%@AE@%                            The %@AI@%path%@AE@% option specifies one or more 
  11919.                                   directories to search for .SYM files. 
  11920.                                   The default is the current directory. 
  11921.                                   SHOWHITS.EXE loads all .SYM files in the
  11922.                                   specified directories, regardless of 
  11923.                                   their relevance to the application you 
  11924.                                   are profiling.
  11925.  
  11926. %@AI@%csips_file%@AE@%                        Specifies the full pathname of the 
  11927.                                   CSIPS.DAT file. If not specified, 
  11928.                                   SHOWHITS.EXE looks for the file in the 
  11929.                                   current directory.
  11930.  
  11931. %@AI@%segentry file%@AE@%                     Specifies the full pathname of the 
  11932.                                   SEGENTRY.DAT file. If not specified, 
  11933.                                   SHOWHITS.EXE looks for the file in the 
  11934.                                   current directory.
  11935.  
  11936. If you do not supply the %@AB@%-r%@AE@% or%@AB@% -3%@AE@% option, SHOWHITS.EXE will prompt you for
  11937. the mode.  %@NL@%
  11938.  
  11939. SHOWHITS.EXE displays information about hits, which are instruction pointer
  11940. samples, into the following four categories:%@CR:C6A00130062 @%%@CR:C6A00130063 @%%@CR:C6A00130064 @%%@CR:C6A00130065 @%%@NL@%
  11941.  
  11942. %@AB@%Category%@AE@%                          %@AB@%Description%@AE@%
  11943. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11944. Unrecognized                      A list of instruction pointers that 
  11945. segments                          occur within segments for which there 
  11946.                                   are no symbols of module names. 
  11947.                                   Unrecognized segments are typically code
  11948.                                   for device drivers, TSR programs, and 
  11949.                                   other code that Windows does not use.
  11950.  
  11951. %@AB@%Category%@AE@%                          %@AB@%Description%@AE@%
  11952. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  11953. Known segments                    The number of hits that occur within 
  11954.                                   known modules. Hits on known segments 
  11955.                                   typically include counts for the 
  11956.                                   application and counts for Windows 
  11957.                                   modules such as KERNEL, GDI, and DISPLAY.
  11958.                                   Profiler also counts hits in DOS and the
  11959.                                   ROM BIOS. In addition to display hits, 
  11960.                                   SHOWHITS.EXE lists the total number of 
  11961.                                   hits and the segment's percentage of 
  11962.                                   total hits.
  11963.  
  11964. Breakdown                         A detailed breakdown of the hits between
  11965.                                   labels
  11966.                                   of the modules for which SHOWHITS.EXE 
  11967.                                   finds .SYM files. SHOWHITS.EXE also 
  11968.                                   displays the
  11969.                                   total number of hits and the percentage 
  11970.                                   of the total number.
  11971.  
  11972. Summary                           A list of the top 10 hits.
  11973.  
  11974. The following example illustrates a display:%@CR:C6A00130066 @%%@NL@%
  11975.  
  11976. %@AS@%  Here are the Hits for Unrecognized Segments
  11977. %@AS@%  
  11978. %@AS@%  Here are the Hits for Known Segments
  11979. %@AS@%  
  11980. %@AS@%   0.3%        3  Hits on SYSTEM-0
  11981. %@AS@%   0.5%        5  Hits on HELLO-0
  11982. %@AS@%  76.5%      786  Hits on DISPLAY-0
  11983. %@AS@%  11.3%      116  Hits on GDI-0
  11984. %@AS@%  11.5%      118  Hits on KERNEL-0
  11985. %@AS@%  
  11986. %@AS@%     1028  TOTAL HITS
  11987. %@AS@%  
  11988. %@AS@%  
  11989. %@AS@%  HELLO!_TEXT
  11990. %@AS@%  
  11991. %@AS@%   0.4%        4  Hits between labels _HelloPaint and _HelloInit
  11992. %@AS@%   0.1%        1  Hits between labels __cintDIV and __fptrap
  11993. %@AS@%  
  11994. %@AS@%  Profiler Summary (Top 10 Hits):
  11995. %@AS@%  
  11996. %@AS@%   0.4%        4  HELLO! _TEXT! _HelloPaint - _HelloInit
  11997. %@AS@%   0.1%        1  HELLO! _TEXT! __cintDIV - __fptrap%@AE@%
  11998.  
  11999.  
  12000. %@2@%%@CR:C6A00130067 @%%@AB@%13.6  Summary%@AE@%%@EH@%%@NL@%
  12001.  
  12002. Profiler is a tool that lets you determine the amount of time Windows spends
  12003. executing sections of code. For more information about Profiler functions,
  12004. see %@AI@%Reference, Volume 1%@AE@%: Chapter 4, "Functions Directory."%@AI@%  %@AE@%%@NL@%
  12005.  
  12006.  
  12007.  
  12008.  
  12009.  
  12010.  
  12011. %@CR:C6A00140001 @%%@1@%%@AB@%Chapter 14  Analyzing Swaps: Swap%@AE@%%@EH@%%@NL@%
  12012. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12013.  
  12014. Microsoft Windows Swap (%@AB@%SWAP%@AE@%) is a tool that lets you analyze the calls,
  12015. swaps, discards, and returns that occur when your Windows application runs.
  12016. Swap includes a utility that records swapping information and another
  12017. utility that displays the information to a standard output device.%@CR:C6A00140002 @%%@CR:C6A00140003 @%%@NL@%
  12018.  
  12019. Swap is useful for determining the number of procedure calls that occur
  12020. across segment boundaries. You can optimize the performance of your
  12021. application by reducing the number of calls across boundaries.  %@NL@%
  12022.  
  12023. This chapter describes the following topics:  %@NL@%
  12024.  
  12025.  
  12026.   ■   Preparing to run Swap%@NL@%
  12027.  
  12028.   ■   Running Swap%@NL@%
  12029.  
  12030.   ■   Displaying swapping information
  12031. %@NL@%
  12032.  
  12033.  
  12034.  
  12035. %@2@%%@CR:C6A00140004 @%%@AB@%14.1  Preparing to Run Swap%@AE@%%@EH@%%@NL@%
  12036.  
  12037. Before running Swap, do the following:  %@NL@%
  12038.  
  12039.  
  12040.   ■   Ensure that you have the necessary Swap files.%@NL@%
  12041.  
  12042.   ■   Place the %@AB@%SwapRecording%@AE@% function in your application.%@NL@%
  12043.  
  12044.  
  12045.  
  12046. %@3@%%@CR:C6A00140005 @%%@AB@%14.1.1  Files You Need to Run Swap%@AE@%%@EH@%%@NL@%
  12047.  
  12048. To run Swap, you need the following files:  %@NL@%
  12049.  
  12050.  
  12051.   ■   SKERNEL.EXE─Windows uses this file instead of KERNEL.EXE as part of
  12052.       the debugging version of Windows. The SKERNEL.EXE file produces a data
  12053.       file named SWAPPRO.DAT, which contains information about the swapping
  12054.       behavior of your application. SKERNEL.EXE runs only when Windows is in
  12055.       real mode.%@CR:C6A00140006 @%%@NL@%
  12056.  
  12057.   ■   Application .SYM files─Swap requires symbol files for the modules of
  12058.       your application that you want to analyze. To create symbol files,
  12059.       first link the program using the%@AB@% /map%@AE@% option, and then run the %@AB@%MAPSYM%@AE@%
  12060.       utility.%@CR:C6A00140007 @%%@NL@%
  12061.  
  12062.   ■   SWAP.EXE─This file uses the SWAPPRO.DAT file to produce a report of
  12063.       swapping behavior.%@CR:C6A00140008 @%%@NL@%
  12064.  
  12065.  
  12066. Swap also includes the optional SKERNEL.SYM file, which provides a listing
  12067. of symbols in SKERNEL.EXE.%@CR:C6A00140009 @%%@NL@%
  12068.  
  12069.  
  12070. %@3@%%@CR:C6A00140010 @%%@AB@%14.1.2  Using the SwapRecording Function%@AE@%%@EH@%%@NL@%
  12071.  
  12072. Place the %@AB@%SwapRecording%@AE@% function in your application to indicate when to
  12073. start and stop recording swapping behavior. The syntax of the function is as
  12074. follows:%@CR:C6A00140011 @%%@NL@%
  12075.  
  12076. %@AS@%  SwapRecording(value)%@AE@%
  12077.  
  12078. The %@AI@%value%@AE@% parameter specifies whether Swap begins or stops analyzing
  12079. swapping behavior, as follows:  %@NL@%
  12080.  
  12081. %@TH:  11   565 02 34 42 @%Value                             Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%0                                 Specifies that Swap stop analyzing.1                                 Specifies that Swap record calls,                                   discards, and swap returns.2                                 Specifies that Swap record calls,                                   discards, swap returns, and all calls                                   through thunks.%@TE:  11   565 02 34 42 @%
  12082.  
  12083.  
  12084. %@2@%%@CR:C6A00140012 @%%@AB@%14.2  Running Swap%@AE@%%@EH@%%@NL@%
  12085.  
  12086. To run Swap, do the following:  %@NL@%
  12087.  
  12088.  
  12089.   1.  Make a backup copy of the KERNEL.EXE file in your Windows system
  12090.       directory by copying or renaming it. %@NL@%
  12091.  
  12092.   2.  Copy SKERNEL.EXE in the Windows development tools directory (named
  12093.       \WINDEV by default at installation) to the Windows system directory.%@NL@%
  12094.  
  12095.   3.  Start Windows in real mode (WIN /R) and run the application you want
  12096.       to analyze.%@NL@%
  12097.  
  12098.   4.  Exit from Windows.%@NL@%
  12099.  
  12100.   5.  Run SWAP.EXE.%@NL@%
  12101.  
  12102.   6.  When you are finished, be sure to restore the original KERNEL.EXE in
  12103.       your Windows system directory. %@NL@%
  12104.  
  12105.  
  12106. The following command invokes SWAP.EXE:  %@NL@%
  12107.  
  12108. %@AS@%  SWAP [-Ipath[;path...» [-Fswapfile]
  12109. %@AS@%[-Mmodule[:segment][;module[:segment]...»%@AE@%
  12110.  
  12111. Command line options are as follows:%@CR:C6A00140013 @%%@NL@%
  12112.  
  12113. %@AB@%Option%@AE@%                            %@AB@%Description%@AE@%
  12114. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12115. %@AB@%-I%@AE@%                                Specifies one or more directory 
  12116.                                   pathnames containing the symbol files of
  12117.                                   the modules to be analyzed. 
  12118.  
  12119. %@AB@%-F%@AE@%                                Specifies the pathname of the data 
  12120.                                   collection file.
  12121.  
  12122. %@AB@%-M%@AE@%%@AI@%module%@AE@%                          Specifies the application module that 
  12123.                                   Swap analyzes.
  12124.  
  12125. %@AI@%segment%@AE@%                           Specifies the segment that Swap 
  12126.                                   analyzes.
  12127.  
  12128.  
  12129. %@3@%%@CR:C6A00140014 @%%@AB@%14.2.1  Specifying a Symbol-File Path%@AE@%%@EH@%%@NL@%
  12130.  
  12131. By default, Swap searches for all required symbol files in the current
  12132. directory. To evaluate data in symbol files located in other directories,
  12133. specify the pathnames with the %@AB@%-I%@AE@% option. The pathnames must be separated by
  12134. semicolons.  %@NL@%
  12135.  
  12136. For example, the following command line specifies that symbol files reside
  12137. in the \PRE\SYSTEM and \TEST\SWAP directories:  %@NL@%
  12138.  
  12139. %@AS@%  SWAP -I\pre\system;\test\swap%@AE@%
  12140.  
  12141.  
  12142. %@3@%%@CR:C6A00140015 @%%@AB@%14.2.2  Specifying a Pathname for the Data Collection File%@AE@%%@EH@%%@NL@%
  12143.  
  12144. By default, Swap searches for the SWAPPRO.DAT file in the current directory.
  12145. If you rename the data collection file or place it somewhere other than the
  12146. current directory, use the %@AB@%-F%@AE@% option.  %@NL@%
  12147.  
  12148. For example, the following command line specifies that the data collection
  12149. file, named SWAPREC, resides in directory TMP:  %@NL@%
  12150.  
  12151. %@AS@%  SWAP -F\TMP\SWAPREC%@AE@%
  12152.  
  12153.  
  12154. %@3@%%@CR:C6A00140016 @%%@AB@%14.2.3  Specifying a Module and Segment%@AE@%%@EH@%%@NL@%
  12155.  
  12156. If the data collection file contains a large amount of data, Swap takes a
  12157. long time processing the module and symbol names. To reduce the time, use
  12158. the %@AB@%-M%@AE@% option to limit the number of modules and segments for which Swap
  12159. prepares output.%@CR:C6A00140017 @%%@NL@%
  12160.  
  12161. The following example specifies that Swap display only records that contain
  12162. the _FONTRES segment of the GDI:  %@NL@%
  12163.  
  12164. %@AS@%  SWAP -MGDI:_FONTRES%@AE@%
  12165.  
  12166. You can list multiple segments or module/segment pairs by separating them on
  12167. the command line with semicolons. The following example specifies that Swap
  12168. display records that contain the _FONTRES segment of the GDI and any segment
  12169. of USER:  %@NL@%
  12170.  
  12171. %@AS@%  SWAP -MGDI:_FONTRES;USER %@AE@%
  12172.  
  12173.  
  12174. %@2@%%@CR:C6A00140018 @%%@AB@%14.3  Displaying Output%@AE@%%@EH@%%@NL@%
  12175.  
  12176. Swap displays records of swapping behavior on standard output devices. Use
  12177. DOS commands to direct output to either a file or a screen.  %@NL@%
  12178.  
  12179. Swap records information in columns of ASCII text separated by tabs. The
  12180. format is suitable for reading into spreadsheet programs such as Microsoft
  12181. Excel.%@CR:C6A00140019 @%%@NL@%
  12182.  
  12183. Swap displays information from left to right as follows:  %@NL@%
  12184.  
  12185. %@AB@%Column%@AE@%                            %@AB@%Description%@AE@%
  12186. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12187. Type                              The kind of event that occurred. The 
  12188.                                   event can be one of the following:
  12189.  
  12190.                                   ■ CALL─A normal call through a thunk.
  12191.  
  12192.                                   ■ SWAP─A call through a thunk that 
  12193.                                   caused a swap.
  12194.  
  12195.                                   ■ DISCARD─Discard of a segment. If the 
  12196.                                   discard was the result of a swap, then 
  12197.                                   the discard records occur after the swap
  12198.                                   record.
  12199.  
  12200.                                   ■ RETURN─Return that caused a swap in 
  12201.                                   the
  12202.                                   caller.
  12203.  
  12204. Time                              The relative time that the event 
  12205.                                   occurred, in milliseconds. Resolution is
  12206.                                   1/18.2 seconds. The first event is 
  12207.                                   always 0.
  12208.  
  12209. Segment (1st)                     One of the following:%@CR:C6A00140020 @%
  12210.  
  12211.                                   ■ If CALL or SWAP, the segment being 
  12212.                                   called.
  12213.  
  12214.                                   ■ If DISCARD, the segment being 
  12215.                                   discarded.
  12216.  
  12217.                                   ■ If RETURN, the segment being returned 
  12218.                                   to.
  12219.  
  12220.                                   If the module name appears in 
  12221.                                   parentheses, Swap could not find the 
  12222.                                   .SYM file for the module.
  12223.  
  12224. Offset (1st)                      One of the following:
  12225.  
  12226.                                   ■ If CALL or SWAP, the offset into the 
  12227.                                   segment being called.
  12228.  
  12229.                                   ■ If RETURN, the offset into the segment
  12230.                                   being
  12231.                                   returned to.
  12232.  
  12233.                                   ■ If DISCARD, this field is blank.
  12234.  
  12235. Segment (2nd)                     One of the following:
  12236.  
  12237.                                   ■ If CALL or SWAP, the segment that did 
  12238.                                   the
  12239.                                   calling.
  12240.  
  12241. %@AB@%Column%@AE@%                            %@AB@%Description%@AE@%
  12242. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12243.                                   ■ If DISCARD, this field is blank.
  12244.  
  12245.                                   ■ If RETURN, this field is blank.
  12246.  
  12247.                                   If the module name appears in 
  12248.                                   parentheses, Swap could not find the 
  12249.                                   .SYM file for the module.
  12250.  
  12251. Offset (2nd)                      One of the following:
  12252.  
  12253.                                   ■ If CALL or SWAP, the offset into the 
  12254.                                   segment that did the calling.
  12255.  
  12256.                                   ■ If RETURN, this field is blank.
  12257.  
  12258.                                   ■ If DISCARD, this field is blank.
  12259.  
  12260.  
  12261. %@2@%%@CR:C6A00140021 @%%@AB@%14.4  Summary%@AE@%%@EH@%%@NL@%
  12262.  
  12263. Swap is a tool that lets you analyze the swapping behavior of Windows
  12264. applications. For more information about memory management, see Chapter 15,
  12265. "Memory Management," and Chapter 16, "More Memory Management," in %@AI@%Guide%@AE@% %@AI@%to
  12266. %@AI@%Programming%@AE@%.  %@NL@%
  12267.  
  12268.  
  12269.  
  12270.  
  12271.  
  12272.  
  12273. %@CR:C6A-Part 04 @%%@1@%%@AB@%PART IV  Help Tools%@AE@%%@EH@%%@NL@%
  12274. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12275.  
  12276. Part 4 provides a guideline for authors and developers of Help systems for
  12277. Microsoft Windows applications. It also defines some specific rules that
  12278. must be adhered to when creating a Help system for any single application.
  12279. For that reason, some sections include step-by-step procedures, while other
  12280. sections suggest general methods.  %@NL@%
  12281.  
  12282. To illustrate concepts and procedures, several chapters use sample screens
  12283. and text from the on-line Help in Helpex, a Windows application supplied in
  12284. your Software Development Kit. If you want to study this material in greater
  12285. detail, you can use the Helpex system as a working model.  %@NL@%
  12286.  
  12287.  
  12288.  
  12289.  
  12290.  
  12291.  
  12292. %@CR:C6A00150001 @%%@1@%%@AB@%Chapter 15  Providing Help: The Help System%@AE@%%@EH@%%@NL@%
  12293. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12294.  
  12295. A Help system provides users with online information about an application.
  12296. Creating the system requires the efforts of both a Help writer and a Help
  12297. programmer. The Help writer plans, writes, codes, builds, and keeps track of
  12298. Help topic files, which are text files that describe various aspects of the
  12299. application. The Help programmer ensures that the Help system works properly
  12300. with the application.%@NL@%
  12301.  
  12302. This chapter describes the following topics:  %@NL@%
  12303.  
  12304.  
  12305.   ■   Creating the Help system%@NL@%
  12306.  
  12307.   ■   How Help appears to the user%@NL@%
  12308.  
  12309.   ■   How Help appears to the Help writer%@NL@%
  12310.  
  12311.   ■   How Help appears to the Help programmer%@NL@%
  12312.  
  12313.  
  12314. This chapter and those that follow assume you are familiar with Microsoft
  12315. Windows Help. The chapters use examples from a sample application called
  12316. Helpex, provided on the SDK Sample Source Code disk. If you are unfamiliar
  12317. with Windows Help, take a moment to run the Helpex sample application and
  12318. use Helpex Help.  %@NL@%
  12319.  
  12320.  
  12321. %@2@%%@CR:C6A00150002 @%%@AB@%15.1  Creating a Help System: The Development Cycle%@AE@%%@EH@%%@NL@%
  12322.  
  12323. The creation of a Help system for a Windows application comprises the
  12324. following major tasks:%@CR:C6A00150003 @%%@NL@%
  12325.  
  12326.  
  12327.   1.  Gathering information for the Help topics.%@NL@%
  12328.  
  12329.   2.  Planning the Help system.%@NL@%
  12330.  
  12331. %@STUB@%      Chapter 16, "Planning the Help System," describes considerations you
  12332.       should keep in mind when planning your Help system.%@NL@%
  12333.  
  12334.   3.  Writing the text for the Help topics. %@NL@%
  12335.  
  12336.   4.  Entering all required control codes into the text files. %@NL@%
  12337.  
  12338. %@STUB@%      Control codes determine how the user can move around the Help system.
  12339.       Section 15.3, "How Help Appears to the Writer," includes an example of
  12340.       several control codes. Chapter 17, "Creating the Help Topic Files,"
  12341.       describes the codes in detail.%@NL@%
  12342.  
  12343.   5.  Creating a project file for the build. %@NL@%
  12344.  
  12345. %@STUB@%      The Help project file provides information that the Help Compiler
  12346.       needs to build a Help resource file. Chapter 18, "Building the Help
  12347.       File," describes the Help project file.%@NL@%
  12348.  
  12349.   6.  Building the Help resource file.%@NL@%
  12350.  
  12351. %@STUB@%      The Help resource file is a compiled version of the topic files the
  12352.       writer creates. Chapter 18, "Building the Help File," describes how to
  12353.       compile a Help resource file.%@NL@%
  12354.  
  12355.   7.  Testing and debugging the Help system.%@NL@%
  12356.  
  12357.   8.  Programming the application so that it can access Windows Help.%@NL@%
  12358.  
  12359.  
  12360. The following flow diagram shows the general work flow in the conception and
  12361. development of the Help system.%@CR:C6A00150004 @%%@NL@%
  12362.  
  12363. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12364.  
  12365.  
  12366. %@2@%%@CR:C6A00150005 @%%@AB@%15.2  How Help Appears to the User%@CR:C6A00150006 @%%@AE@%%@EH@%%@NL@%
  12367.  
  12368. To the user, the Help system appears to be part of the application, and is
  12369. made up of text and graphics displayed in the Help window in front of the
  12370. application. Figure 15.2 illustrates the Help window that appears when the
  12371. user asks for help with copying text in Helpex.  %@NL@%
  12372.  
  12373. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12374.  
  12375. The Help window displays one sample Help topic, a partial description of how
  12376. to perform one task. In Figure 15.2 the first sentence includes a definition
  12377. of the word "clipboard." By pressing the mouse button when the cursor is on
  12378. the word (denoted by dotted underlined text), the user can read the
  12379. definition, which appears in an overlapping box as long as the mouse button
  12380. is held down.%@CR:C6A00150007 @%%@NL@%
  12381.  
  12382. Cross-references to related topics are called jumps. By clicking on a jump
  12383. term for a related topic (denoted by underlined text), the user changes the
  12384. content of the Help window to a description of the new topic or command.
  12385. Figure 15.2 includes a look-up to the definition of "clipboard."  %@NL@%
  12386.  
  12387.  
  12388. %@2@%%@CR:C6A00150008 @%%@AB@%15.3  How Help Appears to the Help Writer%@AE@%%@EH@%%@NL@%
  12389.  
  12390. To the writer, the Help system is a group of topic files, which are text
  12391. files that include special codes. Figure 15.3 illustrates the source text
  12392. that corresponds to the topic shown in Figure <$R[C#1]>.2.%@CR:C6A00150009 @%%@NL@%
  12393.  
  12394. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12395.  
  12396. To create this topic, the Help writer describes the task, formats the text,
  12397. and inserts codes using strikethrough text, underlined text, and footnotes.
  12398. In place of strikethrough, the writer can use double underlining if the word
  12399. processor does not support strikethrough formatting. Footnotes in the text
  12400. contain linking information required by the Help Compiler. Chapter 16,
  12401. "Planning the Help System," discusses formatting considerations. Chapter 17,
  12402. "Creating the Help Topic Files," describes how to create topics and enter
  12403. the special codes that the Help system uses.%@CR:C6A00150010 @%%@NL@%
  12404.  
  12405.  
  12406. %@2@%%@CR:C6A00150011 @%%@AB@%15.4  How Help Appears to the Help Programmer%@AE@%%@EH@%%@NL@%
  12407.  
  12408. To the programmer, Windows Help is a stand-alone Windows application  which
  12409. the user can run like any other application. Your application can call the
  12410. %@AB@%WinHelp%@AE@% function to ask Windows to run the Help application and specify
  12411. which topic to display in the Help window.%@CR:C6A00150012 @%%@NL@%
  12412.  
  12413. See Chapter 18, "Building the Help File," for details about the Help
  12414. application programming interface (API).  %@NL@%
  12415.  
  12416.  
  12417. %@2@%%@CR:C6A00150013 @%%@AB@%15.5  Summary%@AE@%%@EH@%%@NL@%
  12418.  
  12419. The Help system is made up of topics linked via hypertext. The topics and
  12420. links appear differently on the screen to the user than they do in a topic
  12421. file to the writer. To the programmer, Help is a stand-alone application.%@CR:C6A00150014 @%%@NL@%
  12422.  
  12423. For more information about related topics, see the following:  %@NL@%
  12424.  
  12425. %@TH:   4   337 02 22 54 @%Topic                 Reference%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Coding Help topics    %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help Topic Files"Compiling Help files  %@AI@%Tools%@AE@%: Chapter 18, "Building the Help File"%@CR:C6A00150015 @%%@TE:   4   337 02 22 54 @%
  12426.  
  12427.  
  12428.  
  12429.  
  12430.  
  12431.  
  12432. %@CR:C6A00160001 @%%@1@%%@AB@%Chapter 16  Planning the Help System%@AE@%%@EH@%%@NL@%
  12433. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12434.  
  12435. The initial task for the Help writer is to develop a plan for creating the
  12436. system. This chapter discusses planning the Help system for a particular
  12437. application.  %@NL@%
  12438.  
  12439. The chapter covers the following topics:  %@NL@%
  12440.  
  12441.  
  12442.   ■   Developing a plan%@NL@%
  12443.  
  12444.   ■   Determining the topic file structure%@NL@%
  12445.  
  12446.   ■   Designing the visual appearance of Help topics
  12447. %@NL@%
  12448.  
  12449.  
  12450.  
  12451. %@2@%%@CR:C6A00160002 @%%@AB@%16.1  Developing a Plan%@AE@%%@EH@%%@NL@%
  12452.  
  12453. Before you begin writing Help topics using the information you have
  12454. gathered, you and the other members of the Help team should develop a plan
  12455. that addresses the following issues:%@CR:C6A00160003 @%%@NL@%
  12456.  
  12457.  
  12458.   ■   The audience for your application%@NL@%
  12459.  
  12460.   ■   The content of the Help topics%@NL@%
  12461.  
  12462.   ■   The structure of topics%@NL@%
  12463.  
  12464.   ■   The use of context-sensitive topics%@NL@%
  12465.  
  12466.  
  12467. You might want to present your plan in a design document that includes an
  12468. outline of Help information, a diagram of the structure of topics, and
  12469. samples of the various kinds of topics your system will include. Keep in
  12470. mind that contextsensitive Help requires increased development time,
  12471. especially for the application programmer.  %@NL@%
  12472.  
  12473.  
  12474. %@3@%%@CR:C6A00160004 @%%@AB@%16.1.1  Defining the Audience%@AE@%%@EH@%%@NL@%
  12475.  
  12476. The audience you address determines what kind of information you make
  12477. available in your Help system and how you present the information.%@CR:C6A00160005 @%%@NL@%
  12478.  
  12479. Users of Help systems might be classified as follows:  %@NL@%
  12480.  
  12481. %@AB@%User%@AE@%                              %@AB@%Background%@AE@%
  12482. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12483. Computer novice                   Completely new to computing.
  12484.  
  12485. Application novice                Some knowledge of computing, but new to 
  12486.                                   your kind of application. For example, 
  12487.                                   if you are providing Help for a 
  12488.                                   spreadsheet program, the application 
  12489.                                   novice might be familiar only with 
  12490.                                   word-processing packages.
  12491.  
  12492. Application                       Knowledgeable about your kind of 
  12493. intermediate                      application.
  12494.  
  12495. Application expert                Experienced extensively with your type 
  12496.                                   of application.
  12497.  
  12498. Keep in mind that one user may have various levels of knowledge. For
  12499. example, the expert in word processors may have no experience using
  12500. spreadsheets.%@CR:C6A00160006 @%%@NL@%
  12501.  
  12502.  
  12503. %@3@%%@CR:C6A00160007 @%%@AB@%16.1.2  Planning the Content of the Help System%@AE@%%@EH@%%@NL@%
  12504.  
  12505. You should create topics that are numerous enough and specific enough to
  12506. provide your users with the help they need.%@CR:C6A00160008 @%%@CR:C6A00160009 @%%@NL@%
  12507.  
  12508. Novice users need help learning tasks and more definitions of terms. More
  12509. sophisticated users occasionally seek help with a procedure or term, but
  12510. most often refresh their memory of commands and functions. The expert user
  12511. tends only to seek help with command or function syntax, keyboard
  12512. equivalents and shortcut keys.  %@NL@%
  12513.  
  12514. There are no rules for determining the overall content of your Help system.
  12515. If you are providing Help for all types of users, you will want to document
  12516. commands, procedures, definitions, features, functions, and other relevant
  12517. aspects of your application. If you are providing help for expert users
  12518. only, you might want to omit topics that describe procedures. Let your
  12519. audience definition guide you when deciding what topics to include.  %@NL@%
  12520.  
  12521. Keep in mind that the decision to implement context-sensitive Help is an
  12522. important one. Context-sensitive Help demands a close working relationship
  12523. between the Help author and the application programmer, and will therefore
  12524. increase the development time necessary to create a successful Help system.
  12525. %@NL@%
  12526.  
  12527.  
  12528. %@3@%%@CR:C6A00160010 @%%@AB@%16.1.3  Planning the Structure of Help Topics%@AE@%%@EH@%%@NL@%
  12529.  
  12530. Many Help systems structure topics hierarchically. At the top of the
  12531. hierarchy is an index or a table of contents, or both. The index and table
  12532. of contents list individual topics or categories of topics available to the
  12533. user.%@CR:C6A00160011 @%%@NL@%
  12534.  
  12535. Topics themselves can be related hierarchically. Each successive step takes
  12536. the user one level down in the hierarchy of the Help system until the user
  12537. reaches topic information. The hierarchical relationship of Help topics
  12538. determines in part how the user navigates through the Help system. Figure
  12539. 16.1 illustrates a possible hierarchy:  %@NL@%
  12540.  
  12541. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12542.  
  12543. Helpex contains an index that lists several categories of topics. Each
  12544. category includes a secondary index, which lists topics in the category, and
  12545. the topics themselves.  %@NL@%
  12546.  
  12547. Moving from the index to a topic, the user goes from the general to the
  12548. specific.  %@NL@%
  12549.  
  12550. The hierarchical structure provides the user a point of reference within
  12551. Help. Users are not constrained to navigate up and down the hierarchy; they
  12552. can jump from one topic to another, moving across categories of topics. The
  12553. effect of jumps is to obscure hierarchical relationships. For example, the
  12554. Windows Help application contains a search feature that lets the user enter
  12555. a key word into a dialog box and search for topics associated with that key
  12556. word. The Help application then displays a list of titles to choose from in
  12557. order to access information that relates to the key word.  %@NL@%
  12558.  
  12559. Because users often know which feature they want help with, they can usually
  12560. find what they want faster using the search feature than they can by moving
  12561. through the hierarchical structure. For more information about the search
  12562. feature, see Section 17.3.4, "Assigning Key Words."  %@NL@%
  12563.  
  12564. In addition to ordering topics hierarchically, you can order them in a
  12565. logical sequence that suits your audience. The logical sequence, or "browse
  12566. sequence," lets the user choose the Browse button to move from topic to
  12567. topic. Browse sequences are especially important for users who like to read
  12568. several related topics at once, such as the topics covering the commands on
  12569. the File menu. For more information about browse sequences, see Chapter 17,
  12570. "Creating the Help Topic Files."  %@NL@%
  12571.  
  12572. Whichever structure you decide to use, try to minimize the number of lists
  12573. that users must traverse in order to obtain information. Also, avoid making
  12574. users move through many levels to reach a topic. Most Help systems function
  12575. quite well with only two or three levels.%@CR:C6A00160012 @%%@NL@%
  12576.  
  12577.  
  12578. %@3@%%@CR:C6A00160013 @%%@AB@%16.1.4  Displaying Context-Sensitive Help Topics%@AE@%%@EH@%%@NL@%
  12579.  
  12580. Windows Help supports context-sensitive Help. When written in conjunction
  12581. with programming of the application, context-sensitive Help lets the user
  12582. press F1 in an open menu to get help with the selected menu item.
  12583. Alternatively, the user can press SHIFT+F1 and then click on a screen region
  12584. or command to get help on that item.%@CR:C6A00160014 @%%@CR:C6A00160015 @%%@NL@%
  12585.  
  12586. For example, if the user presses SHIFT+F1, then clicks on the maximize icon
  12587. when using the sample application Helpex, the Help system displays the
  12588. information illustrated in Figure 16.2:  %@NL@%
  12589.  
  12590. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12591.  
  12592. Developing context-sensitive Help requires coordination between the Help
  12593. writer and the application programmer so that Help and the application pass
  12594. the correct information back and forth.%@CR:C6A00160016 @%%@CR:C6A00160017 @%%@NL@%
  12595.  
  12596. To plan for context-sensitive Help, the Help author and the application
  12597. programmer should agree on a list of context numbers. Context numbers are
  12598. arbitrary numbers that correspond to each menu command or screen region in
  12599. the application, and are used to create the links to the corresponding Help
  12600. topics. You can then enter these numbers, along with their corresponding
  12601. context-string identifiers, in the Help project file, which the Help
  12602. Compiler uses to build a Help resource file. Section 18.1, "Creating the
  12603. Help Project File," provides details  on how to create a Help project file.
  12604. %@NL@%
  12605.  
  12606. The context numbers assigned in the Help project file must correspond to the
  12607. context numbers that the application sends at run time to invoke a
  12608. particular topic. See Section 18.9, "Programming the Application to Access
  12609. Help," for more information on assigning context numbers.  %@NL@%
  12610.  
  12611. If you do not explicitly assign context numbers to topics, the Help Compiler
  12612. generates default values by converting topic context strings into context
  12613. numbers. See Section 18.6, "Mapping Context-Sensistive Topics: The Map
  12614. Section," for more information on context-sensitive Help and context
  12615. strings.%@CR:C6A00160018 @%%@CR:C6A00160019 @%%@NL@%
  12616.  
  12617. To manage context numbers and file information, you might want to create a
  12618. Help tracker to list the context numbers for your context-sensitive topics.
  12619. See Section 17.5.1, "Creating the Help Tracker," for information about using
  12620. a tracker.%@CR:C6A00160020 @%%@CR:C6A00160021 @%%@NL@%
  12621.  
  12622.  
  12623. %@2@%%@CR:C6A00160022 @%%@AB@%16.2  Determining the Topic File Structure%@AE@%%@EH@%%@NL@%
  12624.  
  12625. The Help file structure remains essentially the same for all applications
  12626. even though the context and number of topic files differ. Topic files are
  12627. segmented into the different topics by means of page breaks. When you build
  12628. the Help system, the compiler uses these topic files to create the
  12629. information displayed for the user in the application's Help window.%@CR:C6A00160023 @%%@CR:C6A00160024 @%%@NL@%
  12630.  
  12631. Figure 16.3 shows this basic file structure.  %@NL@%
  12632.  
  12633. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12634.  
  12635.  
  12636. %@3@%%@CR:C6A00160025 @%%@AB@%16.2.1  Choosing a File Structure for Your Application%@AE@%%@EH@%%@NL@%
  12637.  
  12638. When choosing a file structure for your Help system, consider the scope and
  12639. content of the Help system you are planning. For example, you could place
  12640. all Help topics in a single large topic file. Or, you could place each Help
  12641. topic in a separate file. Neither of these file structures is generally
  12642. acceptable. An enormous single file or too many individual files can present
  12643. difficulties during the creation of the Help resource file.%@CR:C6A00160026 @%%@CR:C6A00160027 @%%@NL@%
  12644.  
  12645. The number of topics relates to the number of features covered by the Help
  12646. system. Consequently, you cannot make extensive changes to one without
  12647. making changes to the other. For instance, if a number of additional product
  12648. features are added to Help, then additional topics must be created to
  12649. accommodate the new information.  %@NL@%
  12650.  
  12651. Figure 16.4 illustrates the file structure of a possible Help system. The
  12652. number of topics and topic files is limited to simplify the diagram and more
  12653. clearly show the concept of linking the topics together through jumps, shown
  12654. in the figure as arrows. The figure is not intended to show the number of
  12655. files that can be included in the Help file system. Moreover, the figure
  12656. does not show how topic files are ordered using the browse feature.%@CR:C6A00160028 @%%@CR:C6A00160029 @%%@NL@%
  12657.  
  12658. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12659.  
  12660.  
  12661. %@2@%%@CR:C6A00160030 @%%@AB@%16.3  Designing the Appearance of Help Topics%@AE@%%@EH@%%@NL@%
  12662.  
  12663. How the information in the Help window appears to the user is primarily a
  12664. function of the layout of the Help topic. The Windows Help application
  12665. supports a number of text attributes and graphic images you can use to
  12666. design your Help window.  %@NL@%
  12667.  
  12668. This section provides general guidelines for designing a window and
  12669. describes fonts and graphic images that Windows Help supports.  %@NL@%
  12670.  
  12671.  
  12672. %@3@%%@CR:C6A00160031 @%%@AB@%16.3.1  Layout of the Help Text%@AE@%%@EH@%%@NL@%
  12673.  
  12674. Help text files are not limited to plain, unformatted text. You can use
  12675. different fonts and point sizes, include color and graphics to emphasize
  12676. points, present information in tables, indent paragraphs to present complex
  12677. information, and use a variety of other visual devices to present your
  12678. information.%@CR:C6A00160032 @%%@CR:C6A00160033 @%%@NL@%
  12679.  
  12680. Research on screen format and Help systems has produced general guidelines
  12681. for presenting information to users. Section 16.5, "Summary," lists some
  12682. sources of this research. The following list summarizes the findings of
  12683. these studies.  %@NL@%
  12684.  
  12685. %@TH:  82  4691 02 34 42 @%Design Issue                      Guideline%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Language                          Use language appropriate for the                                   audience you have defined.                                  Language that is too sophisticated for                                   your audience can frustrate users by                                   requiring them                                   to learn the definition of unfamiliar                                   terms and                                   concepts.Amount of text                    Use a minimum of text.                                  Studies indicate that reading speed                                   decreases by 30 percent when users read                                   online text rather than printed text.                                   Minimal, concise text helps users                                   compensate for the decreased reading                                   speed.Paragraph length                  Use short paragraphs.                                  Online users become overloaded with text                                  more easily than do readers of printed                                   material. Breaking your text into short                                   paragraphs helps avoid this problem.%@CR:C6A00160034 @%White space                       Use it to help group information                                   visually.                                  White space is important to making                                   online text more readable. Use it                                   liberally, while also considering the                                   overall size that a topic will occupy on                                  the screen. Users tend to think there is                                  more information on a screen than exists.                                  For example, if the ratio of white space                                  to text is 50:50, users perceive the                                   ratio to be 40:60. Highlighting                      Use highlighting techniques judiciously.                                  Windows Help provides a variety of                                   highlighting devices, such as font sizes,                                  font types, and color. Using a few                                   devices can help users find information                                   quickly. Using many devices will                                   decrease                                   the effectiveness of your visual                                   presentation and frustrate users. As                                   with print-based documentation, use only                                  one or two fonts at a time.Graphics and icons                Use graphics to support the explanation                                   of visual events.                                  Windows Help supports the use of                                   bitmapped graphic images. Use                                   appropriate images to help                                   explain the function of icons and screen                                  elements  in your application. Remember                                   that graphics will draw the user's eye                                   before the accompanying text. Be sure to                                  crop your images to remove distracting                                   information. Use color images only if                                   you are                                   certain that all your users' systems                                   have color capability. As with                                   context-sensitive Help, consider the                                   additional time necessary to create                                   accurate and meaningful graphic images.Design consistency                Be rigorously consistent in your design.                                  Users expect the appearance of Help                                   topics to be the same, regardless of the                                  information presented. Consistent                                   titling, highlighting, fonts, and                                   positioning of text in the window is                                   essential to an effective Help system.%@CR:C6A00160035 @%%@TE:  82  4691 02 34 42 @%
  12686.  
  12687. Figure 16.5 illustrates a Help window that follows these design principles.
  12688. %@NL@%
  12689.  
  12690. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12691.  
  12692.  
  12693. %@3@%%@CR:C6A00160036 @%%@AB@%16.3.2  Type Fonts and Sizes%@AE@%%@EH@%%@NL@%
  12694.  
  12695. The Windows Help application can display text in any font and size available
  12696. to the system. When the topic files are passed to the build process, the
  12697. Help Compiler attempts to use the fonts and sizes found in the topic files.
  12698. If a font or point size cannot be matched exactly when the Help file is
  12699. displayed by Windows Help, the closest available font and size on the user's
  12700. system will be used.%@CR:C6A00160037 @%%@NL@%
  12701.  
  12702. Windows ships with only certain fonts in specific font sizes. If you write
  12703. Help files using these fonts and sizes, the displayed Help file will closely
  12704. match the printed word-processed file. Because fonts other than those
  12705. shipped with Windows may not be available on users' machines, you might want
  12706. to limit your font selection to the shipped Windows fonts.  %@NL@%
  12707.  
  12708. The fonts included with Windows are:  %@NL@%
  12709.  
  12710.  
  12711.   ■   Courier 10,12,15%@NL@%
  12712.  
  12713.   ■   Helv 8,10,12,14,18,24%@NL@%
  12714.  
  12715.   ■   Modern%@NL@%
  12716.  
  12717.   ■   Roman%@NL@%
  12718.  
  12719.   ■   Script%@NL@%
  12720.  
  12721.   ■   Symbol 8,10,12,14,18,24%@NL@%
  12722.  
  12723.   ■   Tms Rmn 8,10,12,14,18,24%@CR:C6A00160038 @%%@NL@%
  12724.  
  12725.  
  12726. Figure 16.6 illustrates a Help window with Helv-font text:  %@NL@%
  12727.  
  12728. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12729.  
  12730. Since Windows Help supports any Windows font, special symbols such as arrows
  12731. can be included in your topics by using the Symbol font, as shown in Figure
  12732. 16.7:  %@NL@%
  12733.  
  12734. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12735.  
  12736.  
  12737. %@3@%%@CR:C6A00160039 @%%@AB@%16.3.3  Graphic Images%@AE@%%@EH@%%@NL@%
  12738.  
  12739. The Windows Help application allows you to embed graphics in the Help file.
  12740. Graphics can be placed and displayed anywhere on the page. Text can appear
  12741. next to the graphic, as shown in Figure 16.8:%@CR:C6A00160040 @%%@CR:C6A00160041 @%%@NL@%
  12742.  
  12743. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12744.  
  12745. Color graphic images can be included, provided you use only the available
  12746. Windows system colors. If you use graphics tools that support an enhanced
  12747. color palette to create or capture images, these images may not always
  12748. display with the intended colors. And since you cannot control the color
  12749. capabilities on a user's machine, you might want to limit your graphic
  12750. images to black and white bitmaps.  %@NL@%
  12751.  
  12752. Keep in mind that graphics are most effective when they contribute to the
  12753. learning process. Graphics not tied to the information are usually
  12754. distracting rather than helpful and should be avoided. See Section 17.4,
  12755. "Inserting Graphic Images," for more information on placing graphics into
  12756. your Help files.%@CR:C6A00160042 @%%@NL@%
  12757.  
  12758.  
  12759. %@2@%%@CR:C6A00160043 @%%@AB@%16.4  Summary%@AE@%%@EH@%%@NL@%
  12760.  
  12761. This chapter described how to plan a Help system, including defining the
  12762. audience, planning the content, implementing context-sensitive Help,
  12763. structuring topic files, and designing the layout of Help topics.  %@NL@%
  12764.  
  12765. For additional information about planning your Help system, see the
  12766. following:  %@NL@%
  12767.  
  12768. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  12769. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12770. Creating topic files              %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help 
  12771.                                   Topic Files"
  12772.  
  12773. Screen design                     Bradford, Annette Norris. "Conceptual 
  12774.                                   Differences Between the Display Screen 
  12775.                                   and the Printed Page." %@AI@%Technical %@AE@%
  12776.                                   %@AI@%Communication%@AE@% (Third Quarter 1984):
  12777.                                   13-16
  12778.  
  12779.                                   Galitz, Wilbert O. %@AI@%Handbook of Screen %@AE@%
  12780.                                   %@AI@%Format%@AE@%
  12781.                                   %@AI@%Design.%@AE@% 3d ed. Wellesley, MA: QED 
  12782.                                   Information Sciences, Inc., 1989
  12783.  
  12784.                                   Houghton, Raymond C., Jr. "Online Help 
  12785.                                   Systems: A Conspectus." %@AI@%Communications %@AE@%
  12786.                                   %@AI@%of the ACM%@AE@% 27(February 1984): 126-133
  12787.  
  12788.                                   Queipo, Larry. "User Expectations of 
  12789.                                   Online
  12790.                                   Information." %@AI@%IEEE Transactions on %@AE@%
  12791.                                   %@AI@%Professional Communications%@AE@% PC 
  12792.                                   29(December 1986): 11-15
  12793.  
  12794.  
  12795.  
  12796.  
  12797.  
  12798.  
  12799. %@CR:C6A00170001 @%%@1@%%@AB@%Chapter 17  Creating the Help Topic Files%@AE@%%@EH@%%@NL@%
  12800. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12801.  
  12802. Probably the most time-consuming task in developing a Help system for your
  12803. application is creating the Help topic files from which you compile the Help
  12804. system. Help topic files are text files that define what the user sees when
  12805. using the Help system. The topic files can define various kinds of
  12806. information, such as an index to information on the system, a list of
  12807. commands, or a description of how to perform a task.  %@NL@%
  12808.  
  12809. Creating topic files entails writing the text that the user sees when using
  12810. Help, and entering control codes that determine how the user can move from
  12811. one topic to another.  %@NL@%
  12812.  
  12813. This chapter describes the following topics:  %@NL@%
  12814.  
  12815.  
  12816.   ■   Choosing an authoring tool%@NL@%
  12817.  
  12818.   ■   Structuring Help topic files%@NL@%
  12819.  
  12820.   ■   Coding Help topic files%@NL@%
  12821.  
  12822.   ■   Managing Help topic files
  12823. %@NL@%
  12824.  
  12825.  
  12826.  
  12827. %@2@%%@CR:C6A00170002 @%%@AB@%17.1  Choosing an Authoring Tool%@AE@%%@EH@%%@NL@%
  12828.  
  12829. To write your text files, you will need a Rich Text Format (RTF) editor,
  12830. which lets you create the footnotes, underlined text, and strikethrough or
  12831. double-underlined text that indicate the control codes. These codes are
  12832. described in Section 17.3, "Coding Help Topic Files." Your choices include,
  12833. but are not limited to:%@CR:C6A00170003 @%%@NL@%
  12834.  
  12835.  
  12836.   ■   Microsoft Word for Windows, version 1.0.%@NL@%
  12837.  
  12838.   ■   Microsoft Word for the PC, version 5.0.%@NL@%
  12839.  
  12840.   ■   Microsoft Word for the Macintosh, version 3.0 or 4.0.%@NL@%
  12841.  
  12842.   ■   Other word processors that support RTF.%@NL@%
  12843.  
  12844.  
  12845. Microsoft Word's RTF capability allows you to insert the coded text required
  12846. to define Help terms, such as jumps, key words, and definitions. If you
  12847. choose an editor other than one of the Microsoft Word products, make sure it
  12848. will create Help files that work as you intend.  %@NL@%
  12849.  
  12850.  
  12851. %@2@%%@CR:C6A00170004 @%%@AB@%17.2  Structuring Help Topic Files%@AE@%%@EH@%%@NL@%
  12852.  
  12853. A Help topic file typically contains multiple Help topics. To identify each
  12854. topic within a file:%@CR:C6A00170005 @%%@NL@%
  12855.  
  12856.  
  12857.   ■   Topics are separated by hard page breaks.%@NL@%
  12858.  
  12859.   ■   Each topic accessible via a hypertext link must have a unique
  12860.       identifier, or context string.%@NL@%
  12861.  
  12862.   ■   Each topic can have a title.%@NL@%
  12863.  
  12864.   ■   Each topic can have a list of key words associated with it.%@NL@%
  12865.  
  12866.   ■   Each topic can have a build-tag indicator.%@NL@%
  12867.  
  12868.   ■   Any topic can have an assigned browse sequence.%@NL@%
  12869.  
  12870.  
  12871. Figure 17.1 illustrates part of the topic file that contains descriptions of
  12872. how to perform tasks using the sample application Helpex.  %@NL@%
  12873.  
  12874. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  12875.  
  12876. For information about inserting page breaks between topics, see the
  12877. documentation for the editor you are using. For information about assigning
  12878. context strings and titles to topics, see the following sections.  %@NL@%
  12879.  
  12880.  
  12881. %@2@%%@CR:C6A00170006 @%%@AB@%17.3  Coding Help Topic Files%@AE@%%@EH@%%@NL@%
  12882.  
  12883. The Help system uses control codes for particular purposes:%@CR:C6A00170007 @%%@CR:C6A00170008 @%%@NL@%
  12884.  
  12885. %@AB@%Control Code%@AE@%                      %@AB@%Purpose%@AE@%
  12886. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  12887. Asterisk (*) footnote             Build tag─Defines a tag that specifies 
  12888.                                   topics the compiler conditionally builds
  12889.                                   into the system. Build tags are optional,
  12890.                                   but they must appear first in a topic 
  12891.                                   when they are used.
  12892.  
  12893. Pound sign (#) footnote           Context string─Defines a context string 
  12894.                                   that uniquely identifies a topic. 
  12895.                                   Because hypertext relies on links 
  12896.                                   provided by context strings, topics 
  12897.                                   without context strings can only be 
  12898.                                   accessed using key words or browse 
  12899.                                   sequences.
  12900.  
  12901. Dollar sign ($) footnote          Title─Defines the title of a topic. 
  12902.                                   Titles are optional.
  12903.  
  12904. Letter "K" footnote               Key word─Defines a key word the user 
  12905.                                   uses to search for a topic. Key words 
  12906.                                   are optional.
  12907.  
  12908. Plus sign (+) footnote            Browse sequence number─Defines a 
  12909.                                   sequence that determines the order in 
  12910.                                   which the user can browse through topics.
  12911.                                   Browse sequences are optional. However, 
  12912.                                   if you omit browse sequences, the Help 
  12913.                                   window will still include the Browse 
  12914.                                   buttons, but they will be grayed.
  12915.  
  12916. Strikethrough or                  Cross-reference─Indicates the text the 
  12917. double-underlined text            user can choose to jump to another 
  12918.                                   topic.
  12919.  
  12920. Underlined text                   Definition─Specifies that a temporary or
  12921.                                   "look-up" box be displayed when the user
  12922.                                   holds down the mouse button or ENTER key.
  12923.                                   The box can include such information as 
  12924.                                   the definition of a word or phrase, or a
  12925.                                   hint about a procedure.
  12926.  
  12927. Hidden text                       Cross-reference context string─Specifies
  12928.                                   the context string for the topic that 
  12929.                                   will be displayed when the user chooses 
  12930.                                   the text that immediately precedes it.
  12931.  
  12932. If you are using build tags, footnote them at the very beginning of the
  12933. topic. Place other footnotes in any order you want. For information about
  12934. assigning specific control codes, see the following sections.  %@NL@%
  12935.  
  12936.  
  12937. %@3@%%@CR:C6A00170009 @%%@AB@%17.3.1  Assigning Build Tags%@CR:C6A00170010 @%%@AE@%%@EH@%%@NL@%
  12938.  
  12939. Build tags are strings that you assign to a topic in order to conditionally
  12940. include or exclude that topic from a build. Each topic can have one or more
  12941. build tags. Build tags are not a necessary component of your Help system.
  12942. However, they do provide a means of supporting different versions of a Help
  12943. system without having to create different source files for each version.
  12944. Topics without build tags are always included in a build.  %@NL@%
  12945.  
  12946. You insert build tags as footnotes using the asterisk (*). When you assign a
  12947. build tag footnote to a topic, the compiler includes or excludes the topic
  12948. according to build information specified in the %@AB@%BUILD%@AE@% option and [BuildTags]
  12949. section of the Help project file. For information about the %@AB@%BUILD %@AE@%option,
  12950. the [BuildTags] section and the Help project file, see Chaper 18, "Building
  12951. the Help File."%@CR:C6A00170011 @%%@NL@%
  12952.  
  12953. To assign a build tag to a topic:  %@NL@%
  12954.  
  12955.  
  12956.   1.  Place the cursor at the beginning of the topic heading line, so that
  12957.       it appears before all other footnotes for that topic.%@NL@%
  12958.  
  12959.   2.  Insert the asterisk (*) as a footnote reference mark.%@NL@%
  12960.  
  12961. %@STUB@%      Note that a superscript asterisk ( * ) appears next to the heading. %@NL@%
  12962.  
  12963.   3.  Type the build tag name as the footnote. %@NL@%
  12964.  
  12965. %@STUB@%      Be sure to allow only a single space between the asterisk (*) and the
  12966.       build tag. %@NL@%
  12967.  
  12968.  
  12969. Build tags can be made up of any alphanumeric characters. The build tag is
  12970. not case-sensitive. The tag may not contain spaces. You can specify multiple
  12971. build tags by separating them with a semicolon, as in the following example:
  12972. %@NL@%
  12973.  
  12974. %@AS@%  * AppVersion1; AppVersion2; Test_Build%@AE@%
  12975.  
  12976. Including a build tag footnote with a topic is equivalent to setting the tag
  12977. to true when compared to the value set in the project file. The compiler
  12978. assumes all other build tags to be false for that topic. After setting the
  12979. truth value of the build tag footnotes, the compiler evaluates the build
  12980. expression in the Options section of the Help project file. Note that all
  12981. build tags must be declared in the project file, regardless of whether a
  12982. given conditional compilation declares the tags. If the evaluation results
  12983. in a true state, the compiler includes the topic in the build. Otherwise,
  12984. the compiler omits the topic.  %@NL@%
  12985.  
  12986. The compiler includes in all builds topics that do not have a build tag
  12987. footnote regardless of the build tag expressions defined in the Help project
  12988. file. For this reason, you may want to use build tags primarily to exclude
  12989. specific topics from certain builds. If the compiler finds any build tags
  12990. not declared in the Help project file, it displays an error message.  %@NL@%
  12991.  
  12992. By allowing conditional inclusion and exclusion of specific topics, you can
  12993. create multiple builds using the same topic files. This saves time and
  12994. effort for the Help development team. It also means that you can develop
  12995. Help topics that will help you maintain a higher level of consistency across
  12996. your product lines.%@CR:C6A00170012 @%%@NL@%
  12997.  
  12998.  
  12999. %@3@%%@CR:C6A00170013 @%%@AB@%17.3.2  Assigning Context Strings%@AE@%%@EH@%%@NL@%
  13000.  
  13001. Context strings identify each topic in the Help system. Each context string
  13002. must be unique. A given context string may be assigned to only one topic
  13003. within the Help project; it cannot be used for any other topic.%@CR:C6A00170014 @%%@NL@%
  13004.  
  13005. The context string provides the means for creating jumps between topics or
  13006. to display look-up boxes, such as word and phrase definitions. Though not
  13007. required, most topics in the Help system will have context-string
  13008. identifiers, Topics without context strings may not be accessed through
  13009. hypertext jumps. However, topics without context-string identifiers can be
  13010. accessed through browse sequences or key-word searches, if desired. It is up
  13011. to the Help writer to justify the authoring of topics that can be accessed
  13012. only in these manners. For information about assigning jumps, see Section
  13013. 17.3.6, "Creating Cross-References Between Topics." For information about
  13014. assigning browse sequences, see Section 17.3.5, "Assigning Browse Sequence
  13015. Numbers." For information about assigning key words, see Section 17.3.4,
  13016. "Assigning Key Words."  %@NL@%
  13017.  
  13018. To assign a context string to a Help topic:  %@NL@%
  13019.  
  13020.  
  13021.   1.  Place the cursor to the left of the topic heading.%@NL@%
  13022.  
  13023.   2.  Insert the pound sign (#) as the footnote reference mark.%@NL@%
  13024.  
  13025. %@STUB@%      Note that a superscript pound sign ( # ) appears next to the heading. %@NL@%
  13026.  
  13027.   3.  Type the context string as the footnote. %@NL@%
  13028.  
  13029. %@STUB@%      Be sure to allow only a single space between the pound sign (#) and
  13030.       the string. %@NL@%
  13031.  
  13032. %@STUB@%      Context strings are not case-sensitive. %@NL@%
  13033.  
  13034.  
  13035. Valid context strings may contain the alphabetic characters A-Z, the numeric
  13036. characters 0-9, and the period (.) and underscore (_) characters. The
  13037. following example shows the context string footnote that identifies a topic
  13038. called "Opening an Existing Text File":  %@NL@%
  13039.  
  13040. %@AS@%  #OpeningExistingTextFile%@AE@%
  13041.  
  13042. Although a context string has a practical limitation of about 255
  13043. characters, there is no good reason for approaching this value. Keep the
  13044. strings sensible and short so that they're easier to enter into the text
  13045. files.%@CR:C6A00170015 @%%@NL@%
  13046.  
  13047.  
  13048. %@3@%%@CR:C6A00170016 @%%@AB@%17.3.3  Assigning Titles%@AE@%%@EH@%%@NL@%
  13049.  
  13050. Title footnotes perform the following functions within the Help system:%@CR:C6A00170017 @%%@NL@%
  13051.  
  13052.  
  13053.   ■   They appear on the Bookmark menu.%@NL@%
  13054.  
  13055.   ■   They appear in the "Topics found " list that results from a key-word
  13056.       search. (Topics that do not have titles, but are accessible via key
  13057.       words are listed as >>Untitled Topic<< in the Topics found list.)%@NL@%
  13058.  
  13059.  
  13060. Although not required, most topics have a title. You might not assign a
  13061. title to topics containing low-level information that Help's search feature,
  13062. look-up boxes and system messages do not access.  %@NL@%
  13063.  
  13064. To assign a title to a topic:%@CR:C6A00170018 @%%@NL@%
  13065.  
  13066.  
  13067.   1.  Place the cursor to the left of the topic heading.%@NL@%
  13068.  
  13069.   2.  Insert a footnote with a dollar sign ($) as the footnote reference
  13070.       mark.%@NL@%
  13071.  
  13072. %@STUB@%      Note that a superscript dollar sign ( $ ) appears next to the heading.
  13073.       %@NL@%
  13074.  
  13075.   3.  Type the title as the footnote. %@NL@%
  13076.  
  13077. %@STUB@%      Be sure to allow only a single space between the dollar sign ($) and
  13078.       the title.%@NL@%
  13079.  
  13080.  
  13081. The following is an example of a footnote that defines the title for a
  13082. topic:  %@NL@%
  13083.  
  13084. %@AS@%  $ Help Keys%@AE@%
  13085.  
  13086. When adding titles, keep in mind the following restrictions:  %@NL@%
  13087.  
  13088. %@TH:  15   770 02 34 42 @%Item                              Restrictions%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Characters                        Titles can be up to 128 characters in                                   length.                                  The Help compiler truncates title                                   strings longer than 128 characters.                                  The help system displays titles in a                                   list box when the user searches for a                                   key word or enters a bookmark.Formatting                        Title footnote entries cannot be                                   formatted.%@CR:C6A00170019 @%%@TE:  15   770 02 34 42 @%
  13089.  
  13090.  
  13091. %@3@%%@CR:C6A00170020 @%%@AB@%17.3.4  Assigning Key Words%@AE@%%@EH@%%@NL@%
  13092.  
  13093. Help allows the user to search for topics with the use of key words assigned
  13094. to the topics. When the user searches for a topic by key word, Help matches
  13095. the user-entered word to key words assigned to specific topics. Help then
  13096. lists matching topics by their titles in the Search dialog box. Because a
  13097. key-word search is often a fast way for users to access Help topics, you'll
  13098. probably want to assign key words to most topics in your Help system.%@CR:C6A00170021 @%%@CR:C6A00170022 @%%@NL@%
  13099.  
  13100. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13101. NOTE 
  13102.  
  13103. %@AI@%You should specify a key-word footnote only if the topic has a title
  13104. %@AI@%footnote since the title of the topic will appear in the search dialog when
  13105. %@AI@%the user searches for the key word.%@AE@%
  13106. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13107.  
  13108. To assign a key word to a topic:  %@NL@%
  13109.  
  13110.  
  13111.   1.  Place the cursor to the left of the topic heading.%@NL@%
  13112.  
  13113.   2.  Insert an uppercase K as the footnote reference mark.%@NL@%
  13114.  
  13115. %@STUB@%      Note that a superscript K ( K ) appears next to the heading.%@NL@%
  13116.  
  13117.   3.  Type the key word, or key words, as the footnote. %@NL@%
  13118.  
  13119. %@STUB@%      Be sure to allow only a single space between the K and the first key
  13120.       word.%@NL@%
  13121.  
  13122. %@STUB@%      If you add more than one key word, separate each with a semicolon.%@NL@%
  13123.  
  13124.  
  13125. The following is an example of key words for a topic:  %@NL@%
  13126.  
  13127. %@AS@%  K open;opening;text file;ASCII;existing;text only;documents;%@AE@%
  13128.  
  13129. Whenever the user performs a search on any of these key words, the
  13130. corresponding titles appear in a list box. More than one topic may have the
  13131. same key word.  %@NL@%
  13132.  
  13133. When adding key words, keep in mind the following restrictions:%@CR:C6A00170023 @%%@CR:C6A00170024 @%%@NL@%
  13134.  
  13135. %@TH:  21  1059 02 34 42 @%Item                              Restrictions%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%Characters                        Key words can include any ANSI character,                                  including accented characters. The                                   maximum length for key words is 255                                   characters.                                  A space imbedded in a key phrase is                                   considered to be a character, permitting                                  phrases to be key words.Phrases                           Help searches for any word in the                                   specified phrase.Formatting                        Key words are unformatted.Case sensitivity                  Key words are not case-sensitive.Punctuation                       Except for semicolon delimiters, you can                                  use punctuation. %@CR:C6A00170025 @%%@CR:C6A00170026 @%%@TE:  21  1059 02 34 42 @%
  13136.  
  13137.  
  13138. %@4@%%@AB@%Creating Multiple Key-Word Tables%@AE@%%@EH@%%@NL@%
  13139.  
  13140. Multiple key-word tables are useful to allow a program to look up topics
  13141. that are defined in alternate key-word tables. You can use an additional
  13142. key-word table to allow users familiar with key words in a different
  13143. application to discover the matching key words in your application.  %@NL@%
  13144.  
  13145. Authoring additional key-word tables is a two-part process. First, the
  13146. %@AB@%MULTIKEY%@AE@% option must be placed in the [Options] section of the project file.
  13147. For information on the%@AB@% MULTIKEY%@AE@% option, see Section 18.4.8, "Multiple
  13148. Key-Word Tables: The Multikey Option."  %@NL@%
  13149.  
  13150. Second, the topics to be associated with the additional key-word table must
  13151. be authored and labeled. Footnotes are assigned in the same manner as the
  13152. normal key-word footnotes, except that the letter specified with the%@AB@%
  13153. %@AB@%MULTIKEY%@AE@% option is used. With this version of the Help Compiler, the
  13154. key-word footnote used is case-sensitive. Therefore, care should be taken to
  13155. use the same case, usually uppercase, for your key-word footnote. Be sure to
  13156. associate only one topic with a key word. Help does not display the normal
  13157. search dialog box for a multiple key-word search. Instead it displays the
  13158. first topic found with the specified key word. If you want the topics in
  13159. your additional key-word table to appear in the normal Help key-word table,
  13160. you must also specify a "K" footnote and the given key word.  %@NL@%
  13161.  
  13162. The application you are developing Help for can then display the Help topic
  13163. associated with a given string in a specified key-word table. Key words are
  13164. sorted without regard to case for the key-word table. For information on the
  13165. parameters passed by the application to call a topic found in alternate
  13166. key-word table, see Section 18.9.4, "Accessing Additional Key-Word Tables."%@CR:C6A00170027 @%%@CR:C6A00170028 @%%@NL@%
  13167.  
  13168.  
  13169. %@3@%%@CR:C6A00170029 @%%@AB@%17.3.5  Assigning Browse Sequence Numbers%@AE@%%@EH@%%@NL@%
  13170.  
  13171. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13172. NOTE 
  13173.  
  13174. %@AI@%In this version of Help, topics defined in browse sequences are accessed
  13175. %@AI@%using the Browse buttons at the top of the Help window. Future versions of
  13176. %@AI@%Help will not normally display browse buttons for the user. However, if your
  13177. %@AI@%Help resource file includes browse sequences authored in the format
  13178. %@AI@%described here, these versions will support the feature by automatically
  13179. %@AI@%displaying browse buttons for the user. %@CR:C6A00170030 @%%@AE@%
  13180. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13181.  
  13182. The Browse >> and Browse browse sequence." A browse sequence is determined
  13183. by sequence numbers, established by the Help writer.  %@NL@%
  13184.  
  13185. To build browse sequences into the Help topics, the writer must:  %@NL@%
  13186.  
  13187.  
  13188.   1.  Decide which topics should be grouped together and what order they
  13189.       should follow when viewed as a group. %@NL@%
  13190.  
  13191. %@STUB@%      Help supports multiple, discontiguous sequence lists.%@NL@%
  13192.  
  13193.   2.  Code topics to implement the sequence.
  13194. %@NL@%
  13195.  
  13196.  
  13197.  
  13198. %@4@%%@AB@%Organizing Browse Sequences%@AE@%%@EH@%%@NL@%
  13199.  
  13200. When organizing browse sequences, the writer must arrange the topics in an
  13201. order that will make sense to the user. Topics can be arranged in
  13202. alphabetical order within a subject, in order of difficulty, or in a
  13203. sensible order that seems natural to the application. The following example
  13204. illustrates browse sequences for the menu commands used in a given
  13205. application. The Help writer has subjectively defined the order that makes
  13206. the most sense from a procedural point of view. You may, of course, choose a
  13207. different order.%@CR:C6A00170031 @%%@NL@%
  13208.  
  13209. %@AS@%  SampleApp Commands 
  13210. %@AS@%   File Menu - commands:005 
  13211. %@AS@%    New Command - file_menu:005 
  13212. %@AS@%    Open Command - file_menu:010 
  13213. %@AS@%    Save Command - file_menu:015 
  13214. %@AS@%    Save As Command - file_menu:020 
  13215. %@AS@%    Print Command - file_menu:025 
  13216. %@AS@%     Printer Setup Command - file_menu:030 
  13217. %@AS@%    Exit Command - file_menu:035 
  13218. %@AS@%   Edit Menu - commands:010 
  13219. %@AS@%    Undo Command - edit_menu:025 
  13220. %@AS@%    Cut Command - edit_menu:015 
  13221. %@AS@%    Copy Command - edit_menu:010 
  13222. %@AS@%    Paste Command - edit_menu:020 
  13223. %@AS@%    Clear Command - edit_menu:005 
  13224. %@AS@%    Select All Command - edit_menu:030 
  13225. %@AS@%    Word Wrap Command - edit_menu:035 
  13226. %@AS@%    Type Face Command - edit_menu:040 
  13227. %@AS@%    Point Size Command - edit_menu:045 
  13228. %@AS@%   Search Menu - commands:015 
  13229. %@AS@%    Find Command - search_menu:005 
  13230. %@AS@%    Find Next Command - search_menu:010 
  13231. %@AS@%    Previous Command - search_menu:015 
  13232. %@AS@%   Window Menu - commands:020 
  13233. %@AS@%    Tile Command - window_menu:005 
  13234. %@AS@%    Cascade Command - window_menu:010 
  13235. %@AS@%    Arrange Icons Command - window_menu:015 
  13236. %@AS@%    Close All Command - window_menu:020 
  13237. %@AS@%    Document Names Command - window_menu:025%@AE@%
  13238.  
  13239. Each line consists of a sequence list name followed by a colon and a
  13240. sequence number. The sequence list name is optional. If the sequence does
  13241. not have a list name, as in the following example, the compiler places the
  13242. topic in a "null" list:  %@NL@%
  13243.  
  13244. %@AS@%  Window Menu - 120%@AE@%
  13245.  
  13246. Note that the numbers used in the browse sequence example begin at 005 and
  13247. advance in increments of 005. Generally, it is good practice to skip one or
  13248. more numbers in a sequence so you can add new topics later if necessary.
  13249. Skipped numbers are of no conseqence to the Help Compiler; only their order
  13250. is significant.%@CR:C6A00170032 @%%@NL@%
  13251.  
  13252. Sequence numbers establish the order of topics within a browse sequence
  13253. list. Sequence numbers can consist of any alphanumeric characters. During
  13254. the compiling process, strings are sorted using the ASCII sorting technique,
  13255. not a numeric sort.  %@NL@%
  13256.  
  13257. Both the alphabetic and numeric portions of a sequence can be several
  13258. characters long; however, their lengths should be consistent throughout all
  13259. topic files. If you use only numbers in the strings make sure the strings
  13260. are all the same length; otherwise a higher sequence number could appear
  13261. before a lower one in certain cases. For example, the number 100 is
  13262. numerically higher than 99, but 100 will appear before 99 in the sort used
  13263. by Help, because Help is comparing the first two digits in the strings. In
  13264. order to keep the topics in their correct numeric order, you would have to
  13265. make 99 a three-digit string: 099.  %@NL@%
  13266.  
  13267.  
  13268. %@4@%%@AB@%Coding Browse Sequences%@AE@%%@EH@%%@NL@%
  13269.  
  13270. After determining how to group and order topics, code the sequence by
  13271. assigning the appropriate sequence list name and number to each topic, as
  13272. follows:%@CR:C6A00170033 @%%@NL@%
  13273.  
  13274.  
  13275.   1.  Place the cursor to the left of the topic heading.%@NL@%
  13276.  
  13277.   2.  Insert the plus sign (+) as the footnote reference mark.%@NL@%
  13278.  
  13279. %@STUB@%      Note that a superscript plus sign ( + ) appears next to the heading.%@NL@%
  13280.  
  13281.   3.  Type the sequence number using alphanumeric characters.%@NL@%
  13282.  
  13283.  
  13284. For example, the following footnote defines the browse sequence number for
  13285. the Edit menu topic in the previous browse sequence example:  %@NL@%
  13286.  
  13287. %@AS@%  + commands:010%@AE@%
  13288.  
  13289. While it may be easier to list topics within the file in the same order that
  13290. they appear in a browse sequence, it is not necessary. The compiler orders
  13291. the sequence for you.%@CR:C6A00170034 @%%@NL@%
  13292.  
  13293.  
  13294. %@3@%%@CR:C6A00170035 @%%@AB@%17.3.6  Creating Cross-References Between Topics%@AE@%%@EH@%%@NL@%
  13295.  
  13296. Cross-references, or "jumps," are specially-coded words or phrases that are
  13297. linked to other topics. Although you indicate jump terms with strikethrough
  13298. or double-underlined text in the topic file, they appear underlined in the
  13299. Help window. In addition, jump terms appear in color on color systems. For
  13300. example, the strikethrough text (double-underlined in Word for Windows) New
  13301. Command appears as %@AU@%New Command%@AE@% in green text to the user.%@CR:C6A00170036 @%%@NL@%
  13302.  
  13303. To code a word or phrase as a jump in the topic file :  %@NL@%
  13304.  
  13305.  
  13306.   1.  Place the cursor at the point in the text where you want to enter the
  13307.       jump term.%@CR:C6A00170037 @%%@CR:C6A00170038 @%%@CR:C6A00170039 @%%@NL@%
  13308.  
  13309.   2.  Select the strikethrough (or double-underline) feature of your editor.%@NL@%
  13310.  
  13311.   3.  Type the jump word or words in strikethrough mode.%@NL@%
  13312.  
  13313.   4.  Turn off strikethrough and select the editor's hidden text feature.%@NL@%
  13314.  
  13315.   5.  Type the context string assigned to the topic that is the target of
  13316.       the jump. %@NL@%
  13317.  
  13318.  
  13319. When coding jumps, keep in mind that:  %@NL@%
  13320.  
  13321.  
  13322.   ■   No spaces can occur between the strikethrough (or double-underlined)
  13323.       text and the hidden text. %@NL@%
  13324.  
  13325.   ■   Coded spaces before or after the jump term are not permitted.%@NL@%
  13326.  
  13327.   ■   Paragraph marks must be entered as plain text.%@NL@%
  13328.  
  13329.  
  13330.  
  13331. %@3@%%@CR:C6A00170040 @%%@AB@%17.3.7  Defining Terms%@AE@%%@EH@%%@NL@%
  13332.  
  13333. Most topic files contain words or phrases that require further definition.
  13334. To get the definition of a word or phrase, the user first selects the word
  13335. and then holds down the mouse button or ENTER key, causing the definition to
  13336. appear in a box within the Help window. The Help writer decides which words
  13337. to define, considering the audience that will be using the application and
  13338. which terms might already be familiar.%@CR:C6A00170041 @%%@CR:C6A00170042 @%%@NL@%
  13339.  
  13340. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13341. NOTE 
  13342.  
  13343. %@AI@%The look-up feature need not be limited to definitions. With the capability
  13344. %@AI@%to temporarily display information in a box, you might want to show a hint
  13345. %@AI@%about a procedure, or other suitable information for the user.%@AE@%
  13346. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13347.  
  13348. Defining a term requires that you:  %@NL@%
  13349.  
  13350.  
  13351.   ■   Create a topic that defines the term.%@NL@%
  13352.  
  13353. %@STUB@%      The definition topic must include a context string. See Section
  13354.       17.3.2, "Assigning Context Strings."%@NL@%
  13355.  
  13356.   ■   Provide a cross-reference for the definition topic whenever the term
  13357.       occurs.%@NL@%
  13358.  
  13359. %@STUB@%      You don't need to define the same word multiple times in the same
  13360.       topic, just its first occurrence. Also, consider the amount of colored
  13361.       text you are creating in the Help window.%@NL@%
  13362.  
  13363. %@STUB@%      See the following "Coding Definitions" section.%@NL@%
  13364.  
  13365.  
  13366.  
  13367. %@4@%%@AB@%Creating Definition Topics%@AE@%%@EH@%%@NL@%
  13368.  
  13369. You can organize definition topics any way you want. For example, you can
  13370. include each definition topic in the topic file that mentions the term. Or
  13371. you can organize all definitions in one topic file and provide the user with
  13372. direct access to it. Helpex uses the latter method, with all definitions
  13373. residing in the TERMS.RTF file. Organizing definition topics into one file
  13374. provides you with a glossary and lets you make changes easily.%@CR:C6A00170043 @%%@CR:C6A00170044 @%%@NL@%
  13375.  
  13376.  
  13377. %@4@%%@AB@%Coding Definitions%@AE@%%@EH@%%@NL@%
  13378.  
  13379. After creating definition topics, code the terms as they occur, as follows:
  13380. %@NL@%
  13381.  
  13382.  
  13383.   1.  Place the insertion point where you want to place the term that
  13384.       requires definition.%@NL@%
  13385.  
  13386.   2.  Select the underline feature of your editor.%@NL@%
  13387.  
  13388.   3.  Type the term.%@NL@%
  13389.  
  13390.   4.  Turn off the underline feature, and select the editor's hidden-text
  13391.       feature.%@NL@%
  13392.  
  13393.   5.  Type the context string assigned to the topic that contains the
  13394.       definition of the term.%@NL@%
  13395.  
  13396.  
  13397. Figure 17.2 includes a definition of the term "Clipboard."  %@NL@%
  13398.  
  13399. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13400.  
  13401.  
  13402. %@2@%%@CR:C6A00170045 @%%@AB@%17.4  Inserting Graphic Images%@AE@%%@EH@%%@NL@%
  13403.  
  13404. Bitmapped graphic images can be placed in Help topics using either of two
  13405. methods. If your word processor supports the placement of Windows 2.1 or
  13406. Windows 3.0 graphics directly into a document, you can simply paste your
  13407. bitmaps into each topic file. Alternatively, you can save each bitmap in a
  13408. separate file and specify the file by name where you want it to appear in
  13409. the Help topic file. The latter method of placing graphics is referred to as
  13410. "bitmaps by reference." The following sections describe the process of
  13411. placing bitmaps directly or by reference into your Help topics.%@CR:C6A00170046 @%%@NL@%
  13412.  
  13413.  
  13414. %@3@%%@CR:C6A00170047 @%%@AB@%17.4.1  Creating and Capturing Bitmaps%@AE@%%@EH@%%@NL@%
  13415.  
  13416. You can create your bitmaps using any graphical tools, as long as the
  13417. resulting images can be displayed in the Windows environment. Each graphic
  13418. image can then be copied to the Windows clipboard. Once on the clipboard, a
  13419. graphic can be pasted into a graphics editor such as Paint, and modified or
  13420. cleaned up as needed.%@CR:C6A00170048 @%%@NL@%
  13421.  
  13422. Windows Help 3.0 supports color bitmaps. However, for future compatibility,
  13423. you might want to limit graphics to monochrome format. If you are producing
  13424. monochrome images, you might have to adjust manually the elements of your
  13425. source graphic that were originally different colors to either black, white,
  13426. or a pattern of black and white pixels.  %@NL@%
  13427.  
  13428. When you are satisfied with the appearance of your bitmap, you can either
  13429. save it as a file, to be used as a bitmap by reference, or you can copy it
  13430. onto the clipboard and paste it into your word processor. If you save the
  13431. graphic as a file, be sure to specify its size in your graphics editor
  13432. first, so that only the area of interest is saved for display in the Help
  13433. window. The tighter you crop your images, the more closely you will be able
  13434. to position text next to the image. Always save (or convert and save if
  13435. necessary) graphics in Windows' .BMP format.  %@NL@%
  13436.  
  13437. Bitmap images should be created in the same screen mode that you intend Help
  13438. to use when topics are displayed. If your Help files will be displayed in a
  13439. different mode, bitmaps might not retain the same aspect ratio or
  13440. information as their source images.%@CR:C6A00170049 @%%@NL@%
  13441.  
  13442.  
  13443. %@3@%%@CR:C6A00170050 @%%@AB@%17.4.2  Placing Bitmaps Using a Graphical Word Processor%@AE@%%@EH@%%@NL@%
  13444.  
  13445. The easiest way to precisely place bitmaps into Help topics is to use a
  13446. graphical word processor. Word for Windows supports the direct importation
  13447. of bitmaps from the clipboard. Simply paste the graphic image where you want
  13448. it to appear in the Help topic. You can format your text so that it is
  13449. positioned below or alongside the bitmap. When you save your Help topic file
  13450. in RTF, the pasted-in bitmap is converted as well and will automatically be
  13451. included in the Help resource file.%@CR:C6A00170051 @%%@NL@%
  13452.  
  13453.  
  13454. %@3@%%@CR:C6A00170052 @%%@AB@%17.4.3  Placing Bitmaps by Reference%@AE@%%@EH@%%@NL@%
  13455.  
  13456. If your word processor cannot import and display bitmaps directly, you can
  13457. specify the location of a bitmap that you have saved as a file. To insert a
  13458. bitmap reference in the Help topic file, insert one the following statements
  13459. where you want the bitmap to appear in the topic:  %@NL@%
  13460.  
  13461. {%@AB@%bmc%@AE@% %@AI@%filename%@AE@%.bmp} {%@AB@%bml%@AE@% %@AI@%filename%@AE@%.bmp} {%@AB@%bmr%@AE@% %@AI@%filename%@AE@%.bmp}  %@NL@%
  13462.  
  13463. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13464. NOTE 
  13465.  
  13466. %@AI@%Do not specify a full path for %@AI@%filename%@AE@%%@AI@%. If you need to direct the compiler
  13467. %@AI@%to a bitmap in a location other than the root directory for the build,
  13468. %@AI@%specify the absolute path for the bitmap in the [Bitmaps] section of the
  13469. %@AI@%project file.%@AE@%%@AE@%
  13470. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13471.  
  13472. The argument %@AB@%bmc%@AE@% stands for "bitmap character," indicating that the bitmap
  13473. referred to will be treated the same as a character placed in the topic file
  13474. at the same location on a line. Text can precede or follow the bitmap on the
  13475. same line, and line spacing will be determined based upon the size of the
  13476. characters (including the bitmap character) on the line. Do not specify
  13477. negative line spacing for a paragraph with a bitmap image, or the image may
  13478. inadvertently overwrite text above it when it is displayed in Help. When you
  13479. use the argument %@AB@%bmc%@AE@%, there is no automatic text wrapping around the graphic
  13480. image. Text will follow the bitmap, positioned at the baseline.%@CR:C6A00170053 @%%@NL@%
  13481.  
  13482. The argument %@AB@%bml%@AE@% specifies that the bitmap appear at the left margin, with
  13483. text wrapping automatically along the right edge of the image. The argument
  13484. %@AB@%bmr%@AE@% specifies that the bitmap appear at the right margin, with text to its
  13485. left. Bitmap filenames must be the same as those listed in the [Bitmaps]
  13486. section of the Help project file. The [Bitmaps] section is described in
  13487. Chapter 18, "Building the Help File."  %@NL@%
  13488.  
  13489. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13490. NOTE 
  13491.  
  13492. %@AI@%Multiple references to a bitmap of the same name refer to the same bitmap
  13493. %@AI@%when the Help file is displayed. This means that bitmap references can be
  13494. %@AI@%repeated in your Help system without markedly increasing the size of the
  13495. %@AI@%Help resource file.%@AE@%
  13496. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13497.  
  13498. Figure 17.3 shows the placement of three bitmaps with related text in a
  13499. topic as displayed in Help.  %@NL@%
  13500.  
  13501. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13502.  
  13503.  
  13504. %@2@%%@CR:C6A00170054 @%%@AB@%17.5  Managing Topic Files%@AE@%%@EH@%%@NL@%
  13505.  
  13506. Help topic files can be saved in the default word-processor format or in
  13507. RTF. If you always save your files in RTF, and later need to make a change,
  13508. the word processor may take additional time to interpret the format as it
  13509. reloads the file. If you anticipate making numerous changes during Help
  13510. development, you might want to minimize this delay by saving topic files in
  13511. both default and RTF formats, with different file extensions to distinguish
  13512. them. The compiler needs only the RTF files, and you will have faster access
  13513. to the source files for changes. On a large project, this practice can save
  13514. a considerable amount of development time.%@CR:C6A00170055 @%%@NL@%
  13515.  
  13516.  
  13517. %@3@%%@CR:C6A00170056 @%%@AB@%17.5.1  Keeping Track of Files and Topics%@AE@%%@EH@%%@NL@%
  13518.  
  13519. It is important to keep track of all topic files for the following reasons:%@CR:C6A00170057 @%%@NL@%
  13520.  
  13521.  
  13522.   ■   To ensure that no topics are left out of the build process%@NL@%
  13523.  
  13524.   ■   To ensure that each topic has been assigned a unique context string%@NL@%
  13525.  
  13526.   ■   To double-check browse sequencing within general and specific lists%@NL@%
  13527.  
  13528.   ■   To show key-word and title matches%@NL@%
  13529.  
  13530.   ■   To allow writers to see where the text for each of the topics is
  13531.       located%@NL@%
  13532.  
  13533.   ■   To keep track of changes to files and the current status%@NL@%
  13534.  
  13535.   ■   To track any other aspect of the Help development process that you
  13536.       think essential%@NL@%
  13537.  
  13538.  
  13539. At a minimum, writers must keep track of their own topic files, and must
  13540. pass the filenames to the person who is responsible for creating the Help
  13541. project file.  %@NL@%
  13542.  
  13543.  
  13544. %@3@%%@CR:C6A00170058 @%%@AB@%17.5.2  Creating a Help Tracker%@AE@%%@EH@%%@NL@%
  13545.  
  13546. While it is important that you track topic files throughout the development
  13547. cycle, the tracking tool can be anything that suits your needs. You can
  13548. maintain a current list of topics in an ASCII text file, in a Microsoft
  13549. Excel worksheet (if available), or in another format.%@CR:C6A00170059 @%%@NL@%
  13550.  
  13551. When you or another writer creates or revises a topic, you should update the
  13552. Help tracking file to reflect the change. The contents of the tracking file
  13553. are not rigidly defined, but should contain entries for filename, context
  13554. string, title, browse sequence, and key words. If your application makes use
  13555. of the context-sensitive feature of Help, you may want to keep track of the
  13556. context-sensitive information as well. This entry is necessary only if you
  13557. are assigning context numbers to topics in the Help project file. You can
  13558. also include optional information, such as date created, date modified,
  13559. status, and author, if you want to keep track of all aspects of the Help
  13560. development process. How you organize this information is entirely up to
  13561. you.  %@NL@%
  13562.  
  13563. The following sample text file and worksheet illustrate how the tracker
  13564. might be organized for the Help system topics. The examples show both Help
  13565. menu and context-sensitive Help entries for the topic files. Typically, the
  13566. same topics that the user accesses when choosing commands from the Help
  13567. menus can be accessed by the context-sensitive Help feature. The topics with
  13568. entries in the context ID column are used for context-sensitive help as well
  13569. as for the Help menus. Notice that some topics have more than one
  13570. context-sensitive help number. This enables the topic to be displayed when
  13571. the user clicks on different regions of the screen.%@CR:C6A00170060 @%%@CR:C6A00170061 @%%@NL@%
  13572.  
  13573. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13574.  
  13575. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  13576.  
  13577. Of course, you are free to keep track of the topic files you produce in a
  13578. manner different from either of these two examples.  %@NL@%
  13579.  
  13580.  
  13581. %@2@%%@CR:C6A00170062 @%%@AB@%17.6  Summary%@AE@%%@EH@%%@NL@%
  13582.  
  13583. This chapter described how to write, code, and keep track of Help topic
  13584. files. For information about building a Help file, see Chapter 18, "Building
  13585. the Help File."  %@NL@%
  13586.  
  13587.  
  13588.  
  13589.  
  13590.  
  13591.  
  13592. %@CR:C6A00180001 @%%@1@%%@AB@%Chapter 18  Building the Help File%@AE@%%@EH@%%@NL@%
  13593. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13594.  
  13595. After the topic files for your Help system have been written, you are ready
  13596. to create a Help project file and run a build to test the Help file. The
  13597. Help project file contains all information the compiler needs to convert
  13598. help topic files into a binary Help resource file.%@CR:C6A00180002 @%%@NL@%
  13599.  
  13600. You use the Help project file to tell the Help Compiler which topic files to
  13601. include in the build process. Information in the Help project file also
  13602. enables the compiler to map specific topics to context numbers (for the
  13603. context-sensitive portion of Help).  %@NL@%
  13604.  
  13605. After you have compiled your Help file, the development team programs the
  13606. application so the user can access it.  %@NL@%
  13607.  
  13608. The chapter describes the following:  %@NL@%
  13609.  
  13610.  
  13611.   ■   Creating a Help project file%@NL@%
  13612.  
  13613.   ■   Compiling the Help file%@NL@%
  13614.  
  13615.   ■   Programming the application to access Help
  13616. %@NL@%
  13617.  
  13618.  
  13619.  
  13620. %@2@%%@CR:C6A00180003 @%%@AB@%18.1  Creating the Help Project File%@AE@%%@EH@%%@NL@%
  13621.  
  13622. You use the Help project file to control how the Help Compiler builds your
  13623. topic files. The Help project file can contain up to six sections that
  13624. perform the following functions:%@CR:C6A00180004 @%%@NL@%
  13625.  
  13626. %@TH:  24  1271 02 34 42 @%Section                           Function%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%[Files]                           Specifies topic files to be included in                                   the build. This section is mandatory.[Options]                         Specifies the level of error reporting,                                   topics to be included in the build, the                                   directory in which to find the files,                                   and the location of your Help index.                                   This section is optional.[BuildTags]                       Specifies valid build tags. This section                                  is optional.[Alias]                           Assigns one or more context strings to                                   the same topic. This section is                                   optional.[Map]                             Associates context strings with context                                   numbers. This section is optional.[Bitmaps]                         Specifies bitmap files to be included in                                  the build. This section is optional.%@TE:  24  1271 02 34 42 @%
  13627.  
  13628. You can use any ASCII text editor to create your Help project file. The
  13629. extension of a Help project file is .HPJ. If you do not use the extension
  13630. .HPJ on the %@AB@%HC%@AE@% command line, the compiler looks for a project file with this
  13631. extension before loading the file. The .HLP output file will have the same
  13632. name as the .HPJ file.%@CR:C6A00180005 @%%@NL@%
  13633.  
  13634. The order of the various sections within the Help project file is arbitrary,
  13635. with one exception: under all circumstances an [Alias] section must precede
  13636. the [Map] section (if an [Alias] section is used).  %@NL@%
  13637.  
  13638. Section names are placed within square brackets using the following syntax:
  13639. %@NL@%
  13640.  
  13641. %@AS@%  [section-name]%@AE@%
  13642.  
  13643. You can use a semicolon to indicate a comment in the project file. The
  13644. compiler ignores all text from the semicolon to the end of the line on which
  13645. it occurs.  %@NL@%
  13646.  
  13647.  
  13648. %@2@%%@CR:C6A00180006 @%%@AB@%18.2  Specifying Topic Files: The Files Section%@AE@%%@EH@%%@NL@%
  13649.  
  13650. Use the [Files] section of the Help project file to list all topic files
  13651. that the Help Compiler should process to produce a Help resource file. A
  13652. Help project file must have a [Files] section.%@CR:C6A00180007 @%%@NL@%
  13653.  
  13654. The following sample shows the format of the [Files] section:  %@NL@%
  13655.  
  13656. %@AS@%  [FILES] 
  13657. %@AS@%  HELPEX.RTF ;Main topics for HelpEx application 
  13658. %@AS@%  TERMS.RTF  ;Lookup terms for HelpEx appliction%@AE@%
  13659.  
  13660. Using the path defined in the %@AB@%ROOT%@AE@% option, the Help Compiler finds and
  13661. processes all files listed in this section of the Help project file. If the
  13662. file is not on the defined path and cannot be found, the compiler generates
  13663. an error. For more information about the %@AB@%ROOT%@AE@% option, see Section 18.4.3,
  13664. "Specifying the Root Directory: The Root Option."  %@NL@%
  13665.  
  13666. You can include files in the build process using the C %@AB@%#include%@AE@% directive
  13667. command.  %@NL@%
  13668.  
  13669. The %@AB@%#include%@AE@% directive uses the following syntax:  %@NL@%
  13670.  
  13671. %@AS@%  #include <filename>%@AE@%
  13672.  
  13673. You must include the angle brackets around the filename. The pound sign ( #
  13674. ) must be the first character in the line. The filename must specify a
  13675. complete path, either the path defined by the %@AB@%ROOT %@AE@%option or an absolute
  13676. directory path to the file.  %@NL@%
  13677.  
  13678. You may find it easier to create a text file that lists all files in the
  13679. Help project and include that file in the build, as in this example:  %@NL@%
  13680.  
  13681. %@AS@%  [FILES] 
  13682. %@AS@%  #include <hlpfiles.inc>%@AE@%
  13683.  
  13684.  
  13685. %@2@%%@CR:C6A00180008 @%%@AB@%18.3  Specifying Build Tags: The BuildTags Section%@AE@%%@EH@%%@NL@%
  13686.  
  13687. If you code build tags in your topic files, use the [BuildTags] section of
  13688. the Help project file to define all the valid build tags for a particular
  13689. Help project. The [BuildTags] section is optional.%@CR:C6A00180009 @%%@NL@%
  13690.  
  13691. The following example shows the format of the [BuildTags] section in a
  13692. sample Help project file:  %@NL@%
  13693.  
  13694. %@AS@%  [BUILDTAGS] 
  13695. %@AS@%  WINENV  ;topics to include in Windows build 
  13696. %@AS@%  DEBUGBUILD ;topics to include in debugging build 
  13697. %@AS@%  TESTBUILD ;topics to include in a mini-build for testing%@AE@%
  13698.  
  13699. The [BuildTags] section can include up to 30 build tags. The build tags are
  13700. not case-sensitive and may not contain space characters. Only one build tag
  13701. is allowed per line in this section. The compiler will generate an error
  13702. message if anything other than a comment is listed after a build tag in the
  13703. [BuildTags] section.  %@NL@%
  13704.  
  13705. For information about coding build tags in topic files, see Section 17.3.3,
  13706. "Assigning Build Tags."%@CR:C6A00180010 @%%@NL@%
  13707.  
  13708.  
  13709. %@2@%%@CR:C6A00180011 @%%@AB@%18.4  Specifying Options: The Options Section%@AE@%%@EH@%%@NL@%
  13710.  
  13711. Use the [Options] section of the Help project file to specify the following
  13712. options:%@CR:C6A00180012 @%%@NL@%
  13713.  
  13714. %@TH:  29  1401 02 34 42 @%Option                            Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%%@AB@%BUILD%@AE@%                             Determines what topics the compiler                                   includes in the build.%@AB@%COMPRESS%@AE@%                          Specifies compression of the Help                                   resource file.%@AB@%FORCEFONT%@AE@%                         Specifies the creation of a Help                                   resource file using only one font.%@AB@%INDEX%@AE@%                             Specifies the context string of the Help                                  index.%@AB@%MAPFONTSIZE%@AE@%                       Determines the mapping of specified font                                  sizes to different sizes.%@AB@%MULTIKEY%@AE@%                          Specifies alternate key-word mapping for                                  topics.%@AB@%ROOT%@AE@%                              Designates the directory to be used for                                   the Help build.%@AB@%TITLE%@AE@%                             Specifies the title shown for the Help                                   system.%@AB@%WARNING%@AE@%                           Indicates the kind of error message the                                   compiler reports.%@TE:  29  1401 02 34 42 @%
  13715.  
  13716. These options can appear in any order within the [Options] section. The
  13717. [Options] section is not required.  %@NL@%
  13718.  
  13719. Detailed explanations of the available options follow.%@CR:C6A00180013 @%%@NL@%
  13720.  
  13721.  
  13722. %@3@%%@CR:C6A00180014 @%%@AB@%18.4.1  Specifying Error Reporting: The Warning Option%@AE@%%@EH@%%@NL@%
  13723.  
  13724. Use the %@AB@%WARNING%@AE@% option to specify the amount of debugging information that
  13725. the compiler reports. The %@AB@%WARNING%@AE@% option has the following syntax:%@CR:C6A00180015 @%%@NL@%
  13726.  
  13727. %@AS@%  WARNING = level%@AE@%
  13728.  
  13729. You can set the %@AB@%WARNING%@AE@% option to any of the following levels:  %@NL@%
  13730.  
  13731. %@TH:   9   472 02 34 42 @%Level                             Information Reported%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%1                                 Only the most severe warnings.2                                 An intermediate level of warnings. 3                                 All warnings. This is the default level                                   if no %@AB@%WARNING%@AE@% option is specified.%@TE:   9   472 02 34 42 @%
  13732.  
  13733. The following example specifies an intermediate level of error reporting:  %@NL@%
  13734.  
  13735. %@AS@%  [OPTIONS] 
  13736. %@AS@%  WARNING=2%@AE@%
  13737.  
  13738. The compiler reports errors to the standard output file, typically the
  13739. screen. You may want to redirect the errors to a disk file so that you can
  13740. browse it when you are debugging the Help system. The following example
  13741. shows the redirection of compiler screen output to a file.  %@NL@%
  13742.  
  13743. %@AS@%  HC HELPEX > errors.out%@AE@%
  13744.  
  13745. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13746. HINT 
  13747.  
  13748. %@AI@%Use the DOS CONTROL+PRINT SCREEN%@AI@% accelerator key before you begin your
  13749. %@AI@%compilation to echo errors which appear on the screen to your printer. Type
  13750. %@AI@%CONTROL+PRINT SCREEN%@AE@%%@AI@% again to stop sending information to the printer.%@CR:C6A00180016 @%%@AE@%%@AE@%
  13751. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13752.  
  13753.  
  13754. %@3@%%@CR:C6A00180017 @%%@AB@%18.4.2  Specifying Build Topics: The Build Option%@AE@%%@EH@%%@NL@%
  13755.  
  13756. If you have included build tags in your topic files, use the %@AB@%BUILD%@AE@% option to
  13757. specify which topics to conditionally include in the build. If your topic
  13758. files have no build tags, omit the %@AB@%BUILD%@AE@% option from the [Options] section.%@CR:C6A00180018 @%%@NL@%
  13759.  
  13760. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13761. NOTE 
  13762.  
  13763. %@AI@%All build tags must be listed in the [BuildTags] section of the project
  13764. %@AI@%file, regardless whether or not a given conditional compilation declares the
  13765. %@AI@%tags.%@AE@%
  13766. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13767.  
  13768. See Chapter 17, "Creating the Help Topic Files," for information on
  13769. assigning build tags to topics in the Help topic files.  %@NL@%
  13770.  
  13771. The %@AB@%BUILD%@AE@% option line uses the following syntax:  %@NL@%
  13772.  
  13773. %@AS@%  BUILD = expression%@AE@%
  13774.  
  13775. %@AB@%BUILD%@AE@% expressions cannot exceed 255 characters in length, and must be
  13776. entered on only one line. %@AB@%BUILD%@AE@% expressions use Boolean logic to specify
  13777. which topics within the specified Help topic files the compiler will include
  13778. in the build. The tokens of the language are:  %@NL@%
  13779.  
  13780. %@TH:   7   339 02 24 52 @%Token                   Description%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%<tag>                   Build tag( )                     Parentheses&                       AND operator|                       OR operator~                       NOT operator%@TE:   7   339 02 24 52 @%
  13781.  
  13782. The compiler evaluates all build expressions from left to right. The
  13783. operators have the following precedence:%@CR:C6A00180019 @%%@NL@%
  13784.  
  13785. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13786. 1. ( )
  13787. 2. ~
  13788. 3. &
  13789. 4. |
  13790.  
  13791. For example, if you coded build tags called WINENV, APP1, and TEST_BUILD in
  13792. your topic files, you could include one of the following build expressions
  13793. in the [Options] section:  %@NL@%
  13794.  
  13795. %@AB@%Build Expression%@AE@%                  %@AB@%Topics Built%@AE@%
  13796. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  13797. BUILD = WINENV                    Only topics that have the WINENV tag 
  13798.  
  13799. BUILD = WINENV & APP1             Topics that have both the WINENV and 
  13800.                                   APP1 tags 
  13801.  
  13802. BUILD = WINENV | APP1             Topics that have either the WINENV tag 
  13803.                                   or the APP1 tag
  13804.  
  13805. BUILD = (WINENV | APP1) &         Topics that have either the WINENV or 
  13806. TESTBUILD                         the APP1 tags and that also have the 
  13807.                                   TESTBUILD tag
  13808.  
  13809. BUILD =~ APP1                     Topics that do not have a APP1 tag%@CR:C6A00180020 @%
  13810.  
  13811.  
  13812. %@3@%%@CR:C6A00180021 @%%@AB@%18.4.3  Specifying the Root Directory: The Root Option%@AE@%%@EH@%%@NL@%
  13813.  
  13814. Use the %@AB@%ROOT%@AE@% option to designate the root directory of the Help project. The
  13815. compiler searches for files in the specified root directory.%@CR:C6A00180022 @%%@NL@%
  13816.  
  13817. The %@AB@%ROOT%@AE@% option uses the following syntax:  %@NL@%
  13818.  
  13819. %@AS@%  ROOT = pathname%@AE@%
  13820.  
  13821. For example, the following root option specifies that the root directory is
  13822. \BUILD\TEST on drive D:  %@NL@%
  13823.  
  13824. %@AS@%  [OPTIONS] 
  13825. %@AS@%  ROOT=D:\BUILD\TEST%@AE@%
  13826.  
  13827. The %@AB@%ROOT%@AE@% option allows you to refer to all relative paths off the root
  13828. directory of the Help project. For example, the following entry in the
  13829. [Files] section refers to a relative path off the root directory:  %@NL@%
  13830.  
  13831. %@AS@%  TOPICS\FILE.RTF%@AE@%
  13832.  
  13833. To refer to a file in a fixed location, independent of the project root, you
  13834. must specify a fully qualified or "absolute" path, including a drive letter,
  13835. if necessary, as in the following line:  %@NL@%
  13836.  
  13837. %@AS@%  D:\HELPTEST\TESTFILE.RTF%@AE@%
  13838.  
  13839. If you do not include the %@AB@%ROOT%@AE@% option in your Help project file, all paths
  13840. are relative to the current DOS directory.%@CR:C6A00180023 @%%@NL@%
  13841.  
  13842.  
  13843. %@3@%%@CR:C6A00180024 @%%@AB@%18.4.4  Specifying the Index: The Index Option%@AE@%%@EH@%%@NL@%
  13844.  
  13845. Use the %@AB@%INDEX%@AE@% option to identify the context string of the Help index.
  13846. Because the Index button gives the user access to the index from anywhere in
  13847. the Help system, you will probably not want to author terms to jump to the
  13848. index. Users access this general index either from the Help menu of the
  13849. application or by choosing the Index button from the Help window.%@CR:C6A00180025 @%%@NL@%
  13850.  
  13851. Assigning a context string to the index topic in the [Options] section lets
  13852. the compiler know the location of the main index of Help topics for the
  13853. application's Help file. If you do not include the %@AB@%INDEX%@AE@% option in the
  13854. [Options] section, the compiler assumes that the first topic it encounters
  13855. is the index.  %@NL@%
  13856.  
  13857. The %@AB@%INDEX%@AE@% option uses the following syntax:  %@NL@%
  13858.  
  13859. %@AS@%  INDEX = context-string%@AE@%
  13860.  
  13861. The context string specified must match the context string you assigned to
  13862. the Help index topic. In the following example, the writer informs the
  13863. compiler that the context string of the Help index is "main_index":  %@NL@%
  13864.  
  13865. %@AS@%  [OPTIONS] 
  13866. %@AS@%  INDEX=main_index%@AE@%
  13867.  
  13868. For information about assigning context strings, see Section 17.3.2,
  13869. "Assigning Context Strings."%@CR:C6A00180026 @%%@NL@%
  13870.  
  13871.  
  13872. %@3@%%@CR:C6A00180027 @%%@AB@%18.4.5  Assigning a Title to the Help System: The Title Option%@AE@%%@EH@%%@NL@%
  13873.  
  13874. You can assign a title to your Help system with the %@AB@%TITLE%@AE@% option. The title
  13875. appears in the title bar of the Help window with the word "Help"
  13876. automatically appended, followed by the DOS filename of the Help resource
  13877. file.%@CR:C6A00180028 @%%@NL@%
  13878.  
  13879. The %@AB@%TITLE%@AE@% option uses the following syntax:  %@NL@%
  13880.  
  13881. %@AS@%  TITLE = Help-system-title-name%@AE@%
  13882.  
  13883. Titles are limited to 32 characters in length. If you do not specify a title
  13884. using the %@AB@%TITLE%@AE@% option, only the word Help followed by the Help system
  13885. filename will be displayed in the title bar. Because the compiler always
  13886. inserts the word Help, you should keep in mind not to duplicate it in your
  13887. title.Title option  %@NL@%
  13888.  
  13889.  
  13890. %@3@%%@CR:C6A00180029 @%%@AB@%18.4.6  Converting Fonts: The Forcefont Option%@AE@%%@EH@%%@NL@%
  13891.  
  13892. You can use the %@AB@%FORCEFONT%@AE@% option to create a Help resource file that is made
  13893. up of only one typeface or font. This is useful if you must compile a Help
  13894. system using topic files that include fonts not supported by your users'
  13895. systems.%@CR:C6A00180030 @%%@NL@%
  13896.  
  13897. The %@AB@%FORCEFONT%@AE@% option uses the following syntax:  %@NL@%
  13898.  
  13899. %@AS@%  FORCEFONT = fontname%@AE@%
  13900.  
  13901. The %@AI@%fontname%@AE@% parameter is any Windows system font. Windows ships with the
  13902. following fonts and sizes:  %@NL@%
  13903.  
  13904.  
  13905.   ■   Courier 10,12,15 %@NL@%
  13906.  
  13907.   ■   Helv 8,10,12,14,18,24 %@NL@%
  13908.  
  13909.   ■   Modern %@NL@%
  13910.  
  13911.   ■   Roman %@NL@%
  13912.  
  13913.   ■   Script %@NL@%
  13914.  
  13915.   ■   Symbol 8,10,12,14,18,24 %@NL@%
  13916.  
  13917.   ■   Tms Rmn 8,10,12,14,18,24%@NL@%
  13918.  
  13919.  
  13920. Font names must be spelled the same as they are in the Fonts dialog box in
  13921. Control Panel. Font names do not exceed 20 characters in length. If you
  13922. designate a font that is not recognized by the compiler, an error message is
  13923. generated and the compilation continues using the default Helv font.  %@NL@%
  13924.  
  13925. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13926. NOTE
  13927.  
  13928. %@AI@%The %@AI@%fontname%@AE@%%@AI@% used in the %@AE@%%@AI@%%@AB@%FORCEFONT%@AE@%%@AE@%%@AI@% option cannot contain spaces. Therefore,
  13929. %@AI@%Tms Rmn font cannot be used with %@AE@%%@AI@%%@AB@%FORCEFONT%@AE@%%@AE@%%@AI@%.%@CR:C6A00180031 @%%@AE@%%@AE@%
  13930. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13931.  
  13932.  
  13933. %@3@%%@CR:C6A00180032 @%%@AB@%18.4.7  Changing Font Sizes : The Mapfontsize Option%@AE@%%@EH@%%@NL@%
  13934.  
  13935. The font sizes specified in your topic files can be mapped to different
  13936. sizes using the %@AB@%MAPFONTSIZE%@AE@% option. In this manner, you can create and edit
  13937. text in a size chosen for easier viewing in the topic files and have them
  13938. sized by the compiler for the actual Help display. This may be useful if
  13939. there is a large size difference between your authoring monitor and your
  13940. intended display monitor.%@CR:C6A00180033 @%%@NL@%
  13941.  
  13942. The %@AB@%MAPFONTSIZE%@AE@% option uses the following syntax:  %@NL@%
  13943.  
  13944. %@AS@%  MAPFONTSIZE = m[-n]:p%@AE@%
  13945.  
  13946. The %@AI@%m%@AE@% parameter is the size of the source font, and the %@AI@%p%@AE@% parameter is the
  13947. size of the desired font for the Help resource file. All fonts in the topic
  13948. files that are size %@AI@%m%@AE@% are changed to size %@AI@%p%@AE@%. The optional parameter %@AI@%n%@AE@% allows
  13949. you to specify a font range to be mapped. All fonts in the topic files
  13950. falling between %@AI@%m%@AE@% and %@AI@%n%@AE@%, inclusive, are changed to size %@AI@%p%@AE@%. The following
  13951. examples illustrate the use of the %@AB@%MAPFONTSIZE%@AE@% option:  %@NL@%
  13952.  
  13953. %@AS@%  MAPFONTSIZE=12-24:16 ;make fonts from 12 to 24 come out 16.
  13954. %@AS@%  MAPFONTSIZE=8:12  ;make all size 8 fonts come out size 12.%@AE@%
  13955.  
  13956. Note that you can map only one font size or range with each %@AB@%MAPFONTSIZE%@AE@%
  13957. statement used in the Options section. If you use more than one %@AB@%MAPFONTSIZE%@AE@%
  13958. statement, the source font size or range specified in subsequent statements
  13959. cannot overlap previous mappings. For instance, the following mappings would
  13960. generate an error when the compiler encountered the second statement:  %@NL@%
  13961.  
  13962. %@AS@%  MAPFONTSIZE=12-24:16 MAPFONTSIZE=14:20%@AE@%
  13963.  
  13964. Because the second mapping shown in the first example contains a size
  13965. already mapped in the preceding statement, the compiler will ignore the
  13966. line. There is a maximum of five font ranges that can be specified in the
  13967. project file.%@CR:C6A00180034 @%%@NL@%
  13968.  
  13969.  
  13970. %@3@%%@CR:C6A00180035 @%%@AB@%18.4.8  Multiple Key-Word Tables: The Multikey Option%@AE@%%@EH@%%@NL@%
  13971.  
  13972. The %@AB@%MULTIKEY%@AE@% option specifies a character to be used for an additional
  13973. key-word table.%@CR:C6A00180036 @%%@NL@%
  13974.  
  13975. The %@AB@%MULTIKEY%@AE@% option uses the following syntax:  %@NL@%
  13976.  
  13977. %@AS@%  MULTIKEY = footnote-character%@AE@%
  13978.  
  13979. The %@AI@%footnote-character%@AE@% parameter is the case-sensitive letter to be used for
  13980. the key-word footnote. The following example illustrates the enabling of the
  13981. letter L for a key word-table footnote:  %@NL@%
  13982.  
  13983. %@AS@%  MULTIKEY=L%@AE@%
  13984.  
  13985. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13986. NOTE
  13987.  
  13988. %@AI@%You must be sure to limit your key word-table footnotes to one case, usually
  13989. %@AI@%uppercase. In the previous example, topics with the footnote L would have
  13990. %@AI@%their key words incorporated into the additional key word table, whereas
  13991. %@AI@%those assigned the letter l would not.%@AE@%
  13992. ────────────────────────────────────────────────────────────────────────────%@NL@%
  13993.  
  13994. You may use any alphanumeric character for a key-word table except "K" and
  13995. "k" which are reserved for Help's normal key-word table. There is an
  13996. absolute limit of five key-word tables, including the normal table. However,
  13997. depending upon system configuration and the structure of your Help system, a
  13998. practical limit of only two or three may actually be the case. If the
  13999. compiler cannot create an additional table, the excess table is ignored in
  14000. the build.%@CR:C6A00180037 @%%@NL@%
  14001.  
  14002.  
  14003. %@3@%%@CR:C6A00180038 @%%@AB@%18.4.9  Compressing the File: The Compress Option%@AE@%%@EH@%%@NL@%
  14004.  
  14005. You can use the %@AB@%COMPRESS%@AE@% option to reduce the size of the Help resource file
  14006. created by the compiler. The amount of file compression realized will vary
  14007. according to the number, size and complexity of topics that are compiled. In
  14008. general, the larger the Help files, the more they can be compressed.%@CR:C6A00180039 @%%@NL@%
  14009.  
  14010. The %@AB@%COMPRESS%@AE@% option uses the following syntax:  %@NL@%
  14011.  
  14012. %@AS@%  COMPRESS = TRUE | FALSE%@AE@%
  14013.  
  14014. Because the Help application can load compressed files quickly, there is a
  14015. clear advantage in creating and shipping compressed Help files with your
  14016. application. Compiling with compression turned on, however, may increase the
  14017. compile time, because of the additional time required to assemble and sort a
  14018. key-phrase table. Thus, you may want to compile without compression in the
  14019. early stages of a project.  %@NL@%
  14020.  
  14021. The %@AB@%COMPRESS%@AE@% option causes the compiler to compress the system by combining
  14022. repeated phrases found within the source file(s). The compiler creates a
  14023. phrase-table file with the .PH extension if it does not find one already in
  14024. existence. If the compiler finds a file with the .PH extension, it will use
  14025. the file for the current compilation. This is in order to speed compression
  14026. when not a lot of text has changed since the last compilation.  %@NL@%
  14027.  
  14028. Deleting the key-phrase file before each compilation will prevent the
  14029. compiler from using the previous file. Maximum compression will result only
  14030. by forcing the compiler to create a new phrase table.%@CR:C6A00180040 @%%@NL@%
  14031.  
  14032.  
  14033. %@2@%%@CR:C6A00180041 @%%@AB@%18.5  Specifying Alternate Context Strings: The Alias Section%@AE@%%@EH@%%@NL@%
  14034.  
  14035. Use the [Alias] section to assign one or more context strings to the same
  14036. topic alias. Because context strings must be unique for each topic and
  14037. cannot be used for any other topic in the Help project, the [Alias] section
  14038. provides a way to delete or combine Help topics without recoding your files.
  14039. The [Alias] section is optional.%@CR:C6A00180042 @%%@CR:C6A00180043 @%%@NL@%
  14040.  
  14041. For example, if you create a topic that replaces the information in three
  14042. other topics, and you delete the three, you will have to search through your
  14043. files for invalid cross-references to the deleted topics. You can avoid this
  14044. problem by using the [Alias] section to assign the name of the new topic to
  14045. the deleted topics. The [Alias] section can also be used when your
  14046. application program has multiple context identifiers for which you have only
  14047. one topic. This can be the case with context-sensitive Help.  %@NL@%
  14048.  
  14049. Each expression in the [Alias] section has the following format:  %@NL@%
  14050.  
  14051. %@AI@%context_string%@AE@%=%@AI@%alias%@AE@%  %@NL@%
  14052.  
  14053. In the alias expression the %@AI@%alias%@AE@% parameter is the alternate string, or
  14054. alias name, and the %@AI@%context_string%@AE@% parameter is the context string
  14055. identifying a particular topic. An alias string has the same format and
  14056. follows the same conventions as the topic context string. That is, it is not
  14057. case-sensitive and may contain the alphabetic characters A-Z, numeric
  14058. characters 0-9, and the period and underscore characters.  %@NL@%
  14059.  
  14060. The following example illustrates an [Alias] section:  %@NL@%
  14061.  
  14062. %@AS@%  [ALIAS] 
  14063. %@AS@%  sm_key=key_shrtcuts 
  14064. %@AS@%  cc_key=key_shrtcuts 
  14065. %@AS@%  st_key=key_shrtcuts ;combined into keyboard shortcuts topic 
  14066. %@AS@%  clskey=us_dlog_bxs 
  14067. %@AS@%  maakey=us_dlog_bxs ;covered in using dialog boxes topic  
  14068. %@AS@%  chk_key=dlogprts 
  14069. %@AS@%  drp_key=dlogprts 
  14070. %@AS@%  lst_key=dlogprts 
  14071. %@AS@%  opt_key=dlogprts 
  14072. %@AS@%  tbx_key=dlogprts  ;combined into parts of dialog box topic 
  14073. %@AS@%  frmtxt=edittxt 
  14074. %@AS@%  wrptxt=edittxt 
  14075. %@AS@%  seltxt=edittxt  ;covered in editing text topic%@AE@%
  14076.  
  14077. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14078. NOTE
  14079.  
  14080. %@AI@%You can use alias names in the [Map] section of the Help project file. If
  14081. %@AI@%you do, however, the [Alias] section must precede the [Map] section.%@CR:C6A00180044 @%%@CR:C6A00180045 @%%@AE@%
  14082. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14083.  
  14084.  
  14085. %@2@%%@CR:C6A00180046 @%%@AB@%18.6  Mapping Context-Sensitive Topics: The Map Section%@AE@%%@EH@%%@NL@%
  14086.  
  14087. If your Help system supports context-sensitive Help, use the [Map] section
  14088. to associate either context strings or aliases to context numbers. The
  14089. context number corresponds to a value the parent application passes to the
  14090. Help application in order to display a particular topic. This section is
  14091. optional.%@CR:C6A00180047 @%%@CR:C6A00180048 @%%@NL@%
  14092.  
  14093. When writing the [Map] section, you can do the following:  %@NL@%
  14094.  
  14095.  
  14096.   ■   Use either decimal or hexadecimal numbers formatted in standard C
  14097.       notation to specify context numbers.%@NL@%
  14098.  
  14099.   ■   Assign no more than one context number to a context string or alias.%@NL@%
  14100.  
  14101. %@STUB@%      Assigning the same number to more than one context string will
  14102.       generate a compiler error. %@NL@%
  14103.  
  14104.   ■   Separate context numbers and context strings by an arbitrary amount of
  14105.       white space using either space characters or tabs.%@NL@%
  14106.  
  14107.  
  14108. You can use the C %@AB@%#include%@AE@% directive to include other files in the mapping.
  14109. In addition, the Map section supports an extended format that lets you
  14110. include C files with the .H extension directly. Entries using this format
  14111. must begin with the %@AB@%#define%@AE@% directive and may contain comments in C format,
  14112. as in this example:%@CR:C6A00180049 @%%@CR:C6A00180050 @%%@NL@%
  14113.  
  14114. %@AS@%  #define    context_string    context_number    /* comment */%@AE@%
  14115.  
  14116. The following example illustrates several formats you can use in the [Map]
  14117. section:  %@NL@%
  14118.  
  14119. %@AS@%  [MAP] 
  14120. %@AS@%  "
  14121. %@AS@%  Edit_Window  0x0001 
  14122. %@AS@%  Control_Menu  0x0002 
  14123. %@AS@%  Maximize_Icon  0x0003 
  14124. %@AS@%  Minimize_Icon  0x0004 
  14125. %@AS@%  Split_Bar  0x0005 
  14126. %@AS@%  Scroll_Bar  0x0006 
  14127. %@AS@%  Title_Bar  0x0007 
  14128. %@AS@%  Window_Border  0x0008 
  14129. %@AS@%  
  14130. %@AS@%  dcmb_scr  30 ; Document Control-menu Icon 
  14131. %@AS@%  dmxi_scr  31 ; Document Maximize Icon 
  14132. %@AS@%  dmni_scr  32 ; Document Minimize Icon 
  14133. %@AS@%  dri_scr   33 ; Document Restore Icon 
  14134. %@AS@%  dtb_scr   34 ; Document Title Bar 
  14135. %@AS@%   
  14136. %@AS@%  
  14137. %@AS@%  #define vscroll  0x010A /* Vertical Scroll Bar */ 
  14138. %@AS@%  #define hscroll  0x010E /* Horizontal Scroll Bar */ 
  14139. %@AS@%  #define scrollthm 0x0111 /* Scroll Thumb */ 
  14140. %@AS@%  #define upscroll 0x0112 /* Up Scroll Arrow */ 
  14141. %@AS@%  #define dnscroll 0x0113 /* Down Scroll Arrow */ 
  14142. %@AS@%   
  14143. %@AS@%  
  14144. %@AS@%  #include <sample.h>%@AE@%
  14145.  
  14146. In the example:%@CR:C6A00180051 @%%@CR:C6A00180052 @%%@NL@%
  14147.  
  14148. "
  14149.  
  14150. The first eight entries give hexadecimal equivalents for the context
  14151. numbers.%@NL@%
  14152.  
  14153.  
  14154.  
  14155. The next five entries show decimal context numbers.%@NL@%
  14156.  
  14157.  
  14158.  
  14159. The next five entries show how you might include topics defined in a C
  14160. include file.%@NL@%
  14161.  
  14162.  
  14163.  
  14164. This entry shows a C %@AB@%#include%@AE@% directive for some generic topics.%@NL@%
  14165.  
  14166. If context numbers use the %@AB@%#define%@AE@% directive, and the file containing the
  14167. %@AB@%#define%@AE@% statements is included in both the application code and the Help
  14168. file, then updates made to the context numbers by the application
  14169. programmers will automatically be reflected in the next Help build.  %@NL@%
  14170.  
  14171. You can define the context strings listed in the [Map] section either in a
  14172. Help topic or in the [Alias] section. The compiler generates a warning
  14173. message if a    context string appearing in the [Map] section is not defined
  14174. in any of the topic files or in the [Alias] section.  %@NL@%
  14175.  
  14176. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14177. NOTE
  14178.  
  14179. %@AI@%If you use an alias name, the [Alias] section must precede the [Map] section
  14180. %@AI@%in the Help project file. %@AE@%
  14181. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14182.  
  14183. For more information about context-sensitive Help, see Section 16.2.5,
  14184. "Displaying Context-Sensitive Help Topics."%@CR:C6A00180053 @%%@CR:C6A00180054 @%%@NL@%
  14185.  
  14186.  
  14187. %@2@%%@CR:C6A00180055 @%%@AB@%18.7  Including Bitmaps by Reference: The Bitmaps Section%@AE@%%@EH@%%@NL@%
  14188.  
  14189. If your Help system uses bitmaps by reference, the filenames of each of the
  14190. bitmaps must be listed in the [Bitmaps] section of the project file. The
  14191. following example illustrates the format of the [Bitmaps] section.%@CR:C6A00180056 @%%@CR:C6A00180057 @%%@NL@%
  14192.  
  14193. %@AS@%  [BITMAPS] 
  14194. %@AS@%  DUMP01.BMP 
  14195. %@AS@%  DUMP02.BMP
  14196. %@AS@%  DUMP03.BMP
  14197. %@AS@%  c:\PROJECT\HELP\BITMAPS\DUMP04.BMP%@AE@%
  14198.  
  14199. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14200. NOTE
  14201.  
  14202. %@AI@%The [Bitmaps] section uses the same rules as the [Files] section for
  14203. %@AI@%locating bitmap files. %@AE@%
  14204. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14205.  
  14206.  
  14207. %@2@%%@CR:C6A00180058 @%%@AB@%18.8  Compiling Help Files%@AE@%%@EH@%%@NL@%
  14208.  
  14209. After you have created a Help project file, you are ready to build a Help
  14210. file using the Help Compiler. The compiler generates the binary Help
  14211. resource file from the topic files listed in the Help project file. When the
  14212. build process is complete, your application can access the Help resource
  14213. file that results.%@CR:C6A00180059 @%%@CR:C6A00180060 @%%@NL@%
  14214.  
  14215. Before initiating a build operation to create the Help file, consider the
  14216. locations of the following files:  %@NL@%
  14217.  
  14218.  
  14219.   ■   The Help Compiler, HC.EXE. The compiler must be in a directory from
  14220.       which it can be executed. This could be the current working directory,
  14221.       on the path set with the PATH environment variable, or a directory
  14222.       specified by a full pathname, as follows:
  14223.  
  14224. %@AS@%      C:\BIN\HC HELPEX.HPJ%@AE@%
  14225. %@NL@%
  14226.  
  14227.   ■   The Help project file, %@AI@%filename%@AE@%.HPJ. The project file can be located
  14228.       either in the current directory or specified by a path, as follows:%@CR:C6A00180061 @%%@CR:C6A00180062 @%
  14229.  
  14230. %@AS@%      C:\BIN\HC D:\MYPROJ\HELPEX.HPJ%@AE@%
  14231. %@NL@%
  14232.  
  14233.   ■   The topic files named in the Help project file, saved as RTF. The
  14234.       topic files may be located in the current working directory, a
  14235.       subdirectory of the current working directory specified in the [Files]
  14236.       section, or the location specified in the Root option.%@NL@%
  14237.  
  14238.   ■   Files included with the %@AB@%#include%@AE@% directive in the Help project file.
  14239.       Since the %@AB@%#include%@AE@% directive can take pathnames, then any number of
  14240.       places will work for these files.%@NL@%
  14241.  
  14242.   ■   All bitmap files listed by reference in the topic files.%@NL@%
  14243.  
  14244.  
  14245. You must also place any files named in an %@AB@%#include%@AE@% directive in the path of
  14246. the project root directory or specify their path using the %@AB@%ROOT %@AE@%option. The
  14247. compiler searches only the directories specified in the Help project file.
  14248. For information about the %@AB@%ROOT%@AE@% option, see Section 18.4.3, "Specifying the
  14249. Root Directory: The Root Option."  %@NL@%
  14250.  
  14251. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14252. NOTE
  14253.  
  14254. %@AI@%If you use a RAM drive for temporary files (set with the DOS environment
  14255. %@AI@%variable TMP), it must be large enough to hold the compiled Help resource
  14256. %@AI@%file. If your Help file is larger than the size of the available RAM drive,
  14257. %@AI@%the compiler will generate an error message and the compilation will be
  14258. %@AI@%aborted. %@AE@%
  14259.  
  14260. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14261.  
  14262.  
  14263. %@3@%%@CR:C6A00180063 @%%@AB@%18.8.1  Using the Help Compiler%@AE@%%@EH@%%@NL@%
  14264.  
  14265. To run the Help Compiler, use the %@AB@%HC%@AE@% command. There are no options for %@AB@%HC%@AE@%.
  14266. All options are specified in the Help project file.%@CR:C6A00180064 @%%@CR:C6A00180065 @%%@NL@%
  14267.  
  14268. The %@AB@%HC%@AE@% command uses the following syntax:  %@NL@%
  14269.  
  14270. %@AS@%  HC filename.HPJ%@AE@%
  14271.  
  14272. As the compiler program runs, it displays sequential periods on the screen,
  14273. indicating its progress in the process. Error messages are displayed when
  14274. each error condition is encountered. When the Help Compiler has finished
  14275. compiling, it writes a Help resource file with an .HLP extension in the
  14276. current directory and returns to the DOS prompt. The Help resource file that
  14277. results from the build has the same name as does the Help project file.  %@NL@%
  14278.  
  14279. Compiler errors and status messages can be redirected to a file using
  14280. standard DOS redirection syntax. This is useful for a lengthy build where
  14281. you may not be monitoring the entire process. The redirected file is saved
  14282. as a text file that can be viewed with any ASCII editor.%@CR:C6A00180066 @%%@CR:C6A00180067 @%%@NL@%
  14283.  
  14284.  
  14285. %@2@%%@CR:C6A00180068 @%%@AB@%18.9  Programming the Application to Access Help%@AE@%%@EH@%%@NL@%
  14286.  
  14287. The application-development team must program the application so that the
  14288. user can access the Windows Help application and your Help file. The Help
  14289. application is a stand-alone Windows application, and your application can
  14290. ask Windows to run the Help application and specify the topic that Help is
  14291. to show the user. To the user, Help appears to be part of your application,
  14292. but it acts like any other Windows application.%@CR:C6A00180069 @%%@NL@%
  14293.  
  14294.  
  14295. %@3@%%@CR:C6A00180070 @%%@AB@%18.9.1  Calling WinHelp from an Application%@AE@%%@EH@%%@NL@%
  14296.  
  14297. An application makes a Help system available to the user by calling the %@AB@%
  14298. %@AB@%WinHelp%@AE@% function.%@CR:C6A00180071 @%%@NL@%
  14299.  
  14300. The %@AB@%WinHelp%@AE@% function uses the following syntax:  %@NL@%
  14301.  
  14302. %@AS@%  BOOL WinHelp (hWnd, lpHelpFile, wCommand, dwData)%@AE@%
  14303.  
  14304. The %@AI@%hWnd%@AE@% parameter identifies the window requesting Help. The Windows Help
  14305. application uses this identifier to keep track of which applications have
  14306. requested Help.  %@NL@%
  14307.  
  14308. The %@AI@%lpHelpFile%@AE@% parameter specifies the name (with optional directory path)
  14309. of the Help file containing the desired topic.  %@NL@%
  14310.  
  14311. The %@AI@%wCommand%@AE@% parameter specifies either the type of search that the Windows
  14312. Help application is to use to locate the specified topic, or that the
  14313. application no longer requires Help. It may be set to any one of the
  14314. following values:%@CR:C6A00180072 @%%@NL@%
  14315.  
  14316. %@TH:  23  1116 02 34 42 @%Value                             Meaning%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%HELP_CONTEXT                      Displays Help for a particular topic                                   identified by a context number.HELP_HELPONHELP                   Displays the Using Help index topic.HELP_INDEX                        Displays the main Help index topic.HELP_KEY                          Displays Help for a topic identified by                                   a key word.HELP_MULTIKEY                     Displays Help for a topic identified by                                   a key word in an alternate key-word                                   table.HELP_QUIT                         Informs the Help application that Help                                   is no longer needed. If no other                                   applications have asked for Help,                                   Windows closes the Help application.HELP_SETINDEX                     Displays a designated Help index topic. %@TE:  23  1116 02 34 42 @%
  14317.  
  14318. The %@AI@%dwData%@AE@% parameter specifies the topic for which the application is
  14319. requesting Help. The format of %@AI@%dwData%@AE@% depends upon the value of %@AI@%wCommand%@AE@%
  14320. passed when your application calls %@AB@%WinHelp%@AE@%. The following list describes the
  14321. format of %@AI@%dwData%@AE@% for each value of %@AI@%wCommand%@AE@%.%@CR:C6A00180073 @%%@NL@%
  14322.  
  14323. %@TH:  25  1192 02 34 42 @%wCommand Value                    dwData Format%@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%HELP_CONTEXT                      An unsigned long integer containing the                                   context number for the topic. Instead of                                  using HELP_INDEX, HELP_CONTEXT can use                                   the value -1.HELP_HELPONHELP                   Ignored.HELP_INDEX                        Ignored.HELP_KEY                          A long pointer to a string which                                   contains a key word for the desired                                   topic.HELP_MULTIKEY                     A long pointer to the %@AB@%MULTIKEYHELP%@AE@%                                   structure, as defined in WINDOWS.H. This                                  structure specifies the table footnote                                   character and the key word.HELP_QUIT                         Ignored.HELP_SETINDEX                     An unsigned long integer containing the                                   context number for the topic. %@TE:  25  1192 02 34 42 @%
  14324.  
  14325. Because it can specify either a context number or a key word, %@AB@%WinHelp%@AE@%
  14326. supports both context-sensitive and topical searches of the Help file.  %@NL@%
  14327.  
  14328. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14329. NOTE 
  14330.  
  14331. %@AI@%To ensure that the correct index remains set, the application should call
  14332. %@AB@%WinHelp%@AE@%%@AI@% with wCommand%@AE@%%@AI@% set to HELP_SETINDEX (with dwData%@AE@%%@AI@% specifying the
  14333. %@AI@%corresponding context identifier) following each call to %@AE@%%@AI@%%@AB@%WinHelp%@AE@%%@AE@%%@AI@% with a
  14334. %@AI@%command set to HELP_CONTEXT. HELP_INDEX should never be used with
  14335. %@AI@%HELP_SETINDEX.%@CR:C6A00180074 @%%@AE@%%@AE@%
  14336. ────────────────────────────────────────────────────────────────────────────%@NL@%
  14337.  
  14338.  
  14339. %@3@%%@CR:C6A00180075 @%%@AB@%18.9.2  Getting Context-Sensitive Help%@AE@%%@EH@%%@NL@%
  14340.  
  14341. Context-sensitive Help should be made available when a user wants to learn
  14342. about the purpose of a particular window or control. For example, the user
  14343. might pull down the File menu, select the Open command (by using the
  14344. DIRECTION keys), and then press F1 to get Help for the command.%@CR:C6A00180076 @%%@CR:C6A00180077 @%%@NL@%
  14345.  
  14346. Implementing certain types of context-sensitive help requires advanced
  14347. programming techniques. The Helpex sample application illustrates the use of
  14348. two techniques. These techniques are described in the following sections.  %@NL@%
  14349.  
  14350.  
  14351. %@4@%%@AB@%Shift+F1 Support%@AE@%%@EH@%%@NL@%
  14352.  
  14353. To implement a SHIFT+F1 mode, such as in Microsoft Excel or Microsoft Word
  14354. for Windows, Helpex responds to the SHIFT+F1 accelerator key by calling
  14355. %@AB@%SetCursor%@AE@% to change the shape of the cursor to an arrow pointer supplemented
  14356. by a question mark.%@CR:C6A00180078 @%%@CR:C6A00180079 @%%@NL@%
  14357.  
  14358. %@AS@%  case WM_KEYDOWN:
  14359. %@AS@%        if (wParam == VK_F1) {
  14360. %@AS@%  
  14361. %@AS@%            /* If Shift-F1, turn help mode on and set help cursor */ 
  14362. %@AS@%  
  14363. %@AS@%            if (GetKeyState(VK_SHIFT)) { 
  14364. %@AS@%                bHelp = TRUE;
  14365. %@AS@%                SetCursor(hHelpCursor);
  14366. %@AS@%                return (DefWindowProc(hWnd, message, wParam, lParam));
  14367. %@AS@%            }
  14368. %@AS@%  
  14369. %@AS@%            /* If F1 without shift, then call up help main index topic */
  14370. %@AS@%            else {
  14371. %@AS@%                WinHelp(hWnd,szHelpFileName,HELP_INDEX,0L);
  14372. %@AS@%            }
  14373. %@AS@%        }
  14374. %@AS@%  
  14375. %@AS@%        else if (wParam == VK_ESCAPE && bHelp) {
  14376. %@AS@%  
  14377. %@AS@%            /* Escape during help mode: turn help mode off */
  14378. %@AS@%            bHelp = FALSE;
  14379. %@AS@%            SetCursor((HCURSOR)GetClassWord(hWnd,GCW_HCURSOR));
  14380. %@AS@%        }
  14381. %@AS@%  
  14382. %@AS@%        break;%@AE@%
  14383.  
  14384. As long as the user is in Help mode (that is, until he clicks the mouse or
  14385. hits Escape), Helpex responds to WM_SETCURSOR messages by resetting the
  14386. cursor to the arrow and question mark combination.  %@NL@%
  14387.  
  14388. %@AS@%  
  14389. %@AS@%    case WM_SETCURSOR:
  14390. %@AS@%        /* In help mode it is necessary to reset the cursor in response */
  14391. %@AS@%        /* to every WM_SETCURSOR message.Otherwise, by default, Windows */
  14392. %@AS@%        /* will reset the cursor to that of the window class. */
  14393. %@AS@%  
  14394. %@AS@%        if (bHelp) {
  14395. %@AS@%            SetCursor(hHelpCursor);
  14396. %@AS@%            break;
  14397. %@AS@%        }
  14398. %@AS@%        return (DefWindowProc(hWnd, message, wParam, lParam));
  14399. %@AS@%        break;
  14400. %@AS@%  
  14401. %@AS@%    case WM_INITMENU:
  14402. %@AS@%        if (bHelp) {
  14403. %@AS@%            SetCursor(hHelpCursor);
  14404. %@AS@%        } 
  14405. %@AS@%        return (TRUE);%@AE@%
  14406.  
  14407. When the user is in SHIFT+F1 Help mode and clicks the mouse button, Helpex
  14408. will receive a WM_NCLBUTTONDOWN message if the click is in a nonclient area
  14409. of the application window. By examining the %@AI@%wParam%@AE@% value of this message,
  14410. the program can determine which context ID to pass to %@AB@%WinHelp%@AE@%.%@CR:C6A00180080 @%%@CR:C6A00180081 @%%@NL@%
  14411.  
  14412. %@AS@%  
  14413. %@AS@%    case WM_NCLBUTTONDOWN:
  14414. %@AS@%        /* If we are in help mode (Shift+F1) then display context- */
  14415. %@AS@%        /* sensitive help for nonclient area. */
  14416. %@AS@%  
  14417. %@AS@%        if (bHelp) {
  14418. %@AS@%            dwHelpContextId =
  14419. %@AS@%                (wParam == HTCAPTION)?(DWORD)HELPID_TITLE_BAR:
  14420. %@AS@%                (wParam == HTSIZE)? (DWORD)HELPID_SIZE_BOX:
  14421. %@AS@%                (wParam == HTREDUCE)? (DWORD)HELPID_MINIMIZE_ICON:
  14422. %@AS@%                (wParam == HTZOOM)? (DWORD)HELPID_MAXIMIZE_ICON:
  14423. %@AS@%                (wParam == HTSYSMENU)?(DWORD)HELPID_SYSTEM_MENU:
  14424. %@AS@%                (wParam == HTBOTTOM)? (DWORD)HELPID_SIZING_BORDER:
  14425. %@AS@%                (wParam == HTBOTTOMLEFT)? (DWORD)HELPID_SIZING_BORDER:
  14426. %@AS@%                (wParam == HTBOTTOMRIGHT)?(DWORD)HELPID_SIZING_BORDER:
  14427. %@AS@%                (wParam == HTTOP)?(DWORD)HELPID_SIZING_BORDER:
  14428. %@AS@%                (wParam == HTLEFT)?(DWORD)HELPID_SIZING_BORDER:
  14429. %@AS@%                (wParam == HTRIGHT)?(DWORD)HELPID_SIZING_BORDER:
  14430. %@AS@%                (wParam == HTTOPLEFT)?(DWORD)HELPID_SIZING_BORDER:
  14431. %@AS@%                (wParam == HTTOPRIGHT)? (DWORD)HELPID_SIZING_BORDER:
  14432. %@AS@%                (DWORD)0L;
  14433. %@AS@%  
  14434. %@AS@%            if (!((BOOL)dwHelpContextId))
  14435. %@AS@%                return (DefWindowProc(hWnd, message, wParam, lParam));
  14436. %@AS@%            bHelp = FALSE;
  14437. %@AS@%            WinHelp(hWnd,szHelpFileName,HELP_CONTEXT,dwHelpContextId);
  14438. %@AS@%            break;
  14439. %@AS@%        }
  14440. %@AS@%  
  14441. %@AS@%        return (DefWindowProc(hWnd, message, wParam, lParam));%@AE@%
  14442.  
  14443.  
  14444. %@4@%%@AB@%F1 Support%@AE@%%@EH@%%@NL@%
  14445.  
  14446. Context-sensitive F1 support for menus is relatively easy to implement in
  14447. your application. If a menu is open and the user presses F1 while one of the
  14448. menu items is highlighted, Windows sends a WM_ENTERIDLE message to the
  14449. application to indicate that the system is going back into an idle state
  14450. after having determined that F1 was not a valid key stroke for choosing a
  14451. menu item. You can take advantage of this idle state by looking at the
  14452. keyboard state at the time of the WM_ENTERIDLE message.%@CR:C6A00180082 @%%@CR:C6A00180083 @%%@NL@%
  14453.  
  14454. If the F1 key is down, then you can simulate the user's pressing the ENTER
  14455. key by posting a WM_KEYDOWN message using VK_RETURN. You don't really want
  14456. your application to execute the menu command. What you do is set a flag
  14457. (bHelp=TRUE) so that when you get the WM_COMMAND message for the menu item,
  14458. you don't execute the command. Instead, the topic for the menu item is
  14459. displayed by Windows Help.  %@NL@%
  14460.  
  14461. The following code samples illustrate F1 sensing for menu items.%@CR:C6A00180084 @%%@CR:C6A00180085 @%%@CR:C6A00180086 @%%@CR:C6A00180087 @%%@NL@%
  14462.  
  14463. %@AS@%  
  14464. %@AS@%    case WM_ENTERIDLE:
  14465. %@AS@%        if ((wParam == MSGF_MENU) && (GetKeyState(VK_F1) & 0x8000)) {
  14466. %@AS@%            bHelp = TRUE;
  14467. %@AS@%            PostMessage(hWnd, WM_KEYDOWN, VK_RETURN, 0L);
  14468. %@AS@%        }
  14469. %@AS@%        break;%@AE@%
  14470.  
  14471. %@AS@%  
  14472. %@AS@%    case WM_COMMAND:
  14473. %@AS@%        /* Was F1 just pressed in a menu, or are we in help mode */
  14474. %@AS@%        /* (Shift+F1)? */
  14475. %@AS@%  
  14476. %@AS@%        if (bHelp) {
  14477. %@AS@%            dwHelpContextId =
  14478. %@AS@%                (wParam == IDM_NEW)?(DWORD)HELPID_FILE_NEW:
  14479. %@AS@%                (wParam == IDM_OPEN)? (DWORD)HELPID_FILE_OPEN:
  14480. %@AS@%                (wParam == IDM_SAVE)? (DWORD)HELPID_FILE_SAVE:
  14481. %@AS@%                (wParam == IDM_SAVEAS)? (DWORD)HELPID_FILE_SAVE_AS:
  14482. %@AS@%                (wParam == IDM_PRINT)?(DWORD)HELPID_FILE_PRINT:
  14483. %@AS@%                (wParam == IDM_EXIT)? (DWORD)HELPID_FILE_EXIT:
  14484. %@AS@%                (wParam == IDM_UNDO)? (DWORD)HELPID_EDIT_UNDO:
  14485. %@AS@%                (wParam == IDM_CUT)?(DWORD)HELPID_EDIT_CUT:
  14486. %@AS@%                (wParam == IDM_CLEAR)?(DWORD)HELPID_EDIT_CLEAR:
  14487. %@AS@%                (wParam == IDM_COPY)? (DWORD)HELPID_EDIT_COPY:
  14488. %@AS@%                (wParam == IDM_PASTE)?(DWORD)HELPID_EDIT_PASTE:
  14489. %@AS@%                (DWORD)0L;
  14490. %@AS@%  
  14491. %@AS@%            if (!dwHelpContextId)
  14492. %@AS@%            {              Messagebox( hWnd, "Help not available for Help
  14493. %@AS@%Menu item",                          "Help Example", MB_OK
  14494. %@AS@%return (DefWindowProc(hWnd, message, wParam, lParam));
  14495. %@AS@%            }%@AE@%
  14496.  
  14497. %@AS@%  bHelp = FALSE;
  14498. %@AS@%            WinHelp(hWnd,szHelpFileName,HELP_CONTEXT,dwHelpContextId);
  14499. %@AS@%            break;
  14500. %@AS@%        }%@AE@%
  14501.  
  14502. Detecting F1 in dialog boxes is somewhat more difficult than in menus. You
  14503. must install a message filter, using the WH_MSGFILTER option of the
  14504. %@AB@%SetWindowsHook%@AE@% function. Your message filter function responds to WM_KEYDOWN
  14505. and WM_KEYUP messages for VK_F1 when they are sent to a dialog box, as
  14506. indicated by the MSGF_DIALOGBOX code. By examining the message structure
  14507. passed to the filter, you can determine the context of the F1 help─what the
  14508. dialog box is, and the specific option or item. You should not call %@AB@%WinHelp%@AE@%
  14509. while processing the filtered message, but rather post an
  14510. application-defined message to your application to call %@AB@%WinHelp%@AE@% at the first
  14511. available opportunity.%@CR:C6A00180088 @%%@CR:C6A00180089 @%%@CR:C6A00180090 @%%@CR:C6A00180091 @%%@NL@%
  14512.  
  14513.  
  14514. %@3@%%@CR:C6A00180092 @%%@AB@%18.9.3  Getting Help on an Item Listed on the Help Menu%@AE@%%@EH@%%@NL@%
  14515.  
  14516. Sometimes users may want information about a general concept in the
  14517. application rather than about a particular control or window. In these
  14518. cases, the application should provide Help for a particular topic that is
  14519. identified by a key word rather than a context identifier.%@CR:C6A00180093 @%%@CR:C6A00180094 @%%@NL@%
  14520.  
  14521. For example, if the Help file for your application contains a topic that
  14522. describes how the keyboard is used, you could place a "Keyboard" item in
  14523. your Help menu. Then, when the user selects that item, your application
  14524. would call %@AB@%WinHelp%@AE@% and request that topic:  %@NL@%
  14525.  
  14526. %@AS@%  case IDM_HELP_KEYBOARD:
  14527. %@AS@%     WinHelp (hWnd, lpHelpFile, HELP_KEY, (LPSTR) "Keyboard");
  14528. %@AS@%     break;%@AE@%
  14529.  
  14530.  
  14531. %@3@%%@CR:C6A00180095 @%%@AB@%18.9.4  Accessing Additional Key-Word Tables%@AE@%%@EH@%%@NL@%
  14532.  
  14533. Your application may have commands or terms that correspond to terms in a
  14534. similar, but different, application. Given a key word, the application can
  14535. call %@AB@%WinHelp%@AE@% and look up topics defined in an alternate key-word table. This
  14536. Multikey functionality is accessed through the %@AB@%WinHelp%@AE@% hook with the
  14537. %@AI@%wCommand%@AE@% parameter set to HELP_MULTIKEY.%@CR:C6A00180096 @%%@CR:C6A00180097 @%%@NL@%
  14538.  
  14539. You specify the footnote character for the alternate key-word table, and the
  14540. key word or phrase, via a %@AB@%MULTIKEYHELP%@AE@% structure which is passed as the
  14541. %@AI@%dwData%@AE@% parameter in the call to %@AB@%WinHelp%@AE@%. This structure is defined in
  14542. WINDOWS.H as:  %@NL@%
  14543.  
  14544. %@AS@%  typedef struct tag MULTIKEYHELP {
  14545. %@AS@%   WORD mdSize;
  14546. %@AS@%   BYTE mkKeyList;
  14547. %@AS@%   BYTE szKeyPhrase[1];
  14548. %@AS@%  } MULTIKEYHELP;%@AE@%
  14549.  
  14550. The following table lists the format of the fields of the %@AB@%MULTIKEYHELP%@AE@%
  14551. structure:  %@NL@%
  14552.  
  14553. %@AB@%Parameter%@AE@%                         %@AB@%Format%@AE@%
  14554. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14555. %@AB@%mkSize%@AE@%                            The size of the structure, including the
  14556.                                   key word (or phrase) and the associated 
  14557.                                   key-table letter.
  14558.  
  14559. %@AB@%mkKeyList%@AE@%                         A single character which defines the 
  14560.                                   footnote character for the alternate 
  14561.                                   key-word table to be searched.
  14562.  
  14563. %@AB@%szKeyPhrase%@AE@%                       A null-terminated key word or phrase to 
  14564.                                   be looked up in the alternate key-word 
  14565.                                   table.
  14566.  
  14567. The following example illustrates a key-word search for the word "frame" in
  14568. the alternate key-word table designated with the footnote character "L":  %@NL@%
  14569.  
  14570. %@AS@%  MULTIKEYHELP mk;
  14571. %@AS@%  char szKeyword[]="frame";
  14572. %@AS@%  mk.mkSize=sizeof(MULTIKEYHELP)+(WORD)lstrlen(szKeyword);
  14573. %@AS@%  mk.mkKeylist="L";
  14574. %@AS@%  mk.szKeyphrase=szKeyword;
  14575. %@AS@%  WinHelp(hWnd,lpHelpfile,HELP_MULTIKEY,(LPSTR)&mk);%@AE@%
  14576.  
  14577.  
  14578. %@3@%%@CR:C6A00180098 @%%@AB@%18.9.5  Canceling Help%@AE@%%@EH@%%@NL@%
  14579.  
  14580. The Windows Help application is a shared resource that is available to all
  14581. Windows applications. In addition, since it is a stand-alone application,
  14582. the user can execute it like any other application. As a result, your
  14583. application has limited control over the Help application. While your
  14584. application cannot directly close the Help application window, your
  14585. application can inform the Help application that Help is no longer needed.
  14586. Before closing its main window, your application should call %@AB@%WinHelp%@AE@% with
  14587. the %@AI@%wCommand%@AE@% parameter set to HELP_QUIT, as shown in the following example,
  14588. to inform the Help application that your application will not need it again.%@CR:C6A00180099 @%%@NL@%
  14589.  
  14590. %@AS@%  case WM_DESTROY:
  14591. %@AS@%     WinHelp (hWnd, lpHelpFile, HELP_QUIT, NULL);   %@AE@%
  14592.  
  14593. An application that has called %@AB@%WinHelp%@AE@% at some point during its execution
  14594. must call %@AB@%WinHelp%@AE@% with the %@AI@%wCommand%@AE@% parameter set to HELP_QUIT before the
  14595. application exits from WinMain (typically during the WM_DESTROY message
  14596. processing).  %@NL@%
  14597.  
  14598. If an application opens more than one Help file, then it must call %@AB@%WinHelp%@AE@%
  14599. to quit help for each file.  %@NL@%
  14600.  
  14601. If an application or DLL has opened a Help file but no longer wants the
  14602. associated instance of the Help engine (WINHELP.EXE) to remain active, then
  14603. the application or DLL should call %@AB@%WinHelp%@AE@% with the %@AI@%wCommand%@AE@% parameter set
  14604. to HELP_QUIT to destroy the instance of the Help engine.  %@NL@%
  14605.  
  14606. Under no circumstances should an application or DLL terminate without
  14607. calling %@AB@%WinHelp%@AE@% for any of the opened Help files. A Help file is opened if
  14608. any other %@AB@%WinHelp%@AE@% call has been previously made using the Help filename.  %@NL@%
  14609.  
  14610. The Windows Help application does not exit until all windows that have
  14611. called %@AB@%WinHelp%@AE@% have called it with %@AI@%wCommand%@AE@% set to HELP_QUIT. If an
  14612. application fails to do so, then the Help application will continue running
  14613. after all applications that requested Help have terminated.%@CR:C6A00180100 @%%@NL@%
  14614.  
  14615.  
  14616. %@2@%%@CR:C6A00180101 @%%@AB@%18.10  Summary%@AE@%%@EH@%%@NL@%
  14617.  
  14618. This chapter described how to create a Help project file, build the Help
  14619. resource file, and program your application to access Help. For more
  14620. information, see the following:  %@NL@%
  14621.  
  14622. %@AB@%Topic%@AE@%                             %@AB@%Reference%@AE@%
  14623. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14624. Planning a Help system            %@AI@%Tools%@AE@%: Chapter 16, "Planning the Help 
  14625.                                   System"
  14626.  
  14627. Writing Help topics               %@AI@%Tools%@AE@%: Chapter 17, "Creating the Help 
  14628.                                   Topic Files"
  14629.  
  14630.  
  14631.  
  14632.  
  14633.  
  14634.  
  14635. %@CR:C6A00190001 @%%@1@%%@AB@%Chapter 19  Help Examples and Compiler Error Messages%@AE@%%@EH@%%@NL@%
  14636. %@AB@%────────────────────────────────────────────────────────────────────────────%@AE@%%@NL@%
  14637.  
  14638. The first part of this chapter contains several examples of Help source
  14639. files and their corresponding topics as displayed in Help. Each example
  14640. shows a topic (or part of a topic) as it appears to the Help writer in the
  14641. RTF-capable word processor and as it appears to the user in the Help window.
  14642. You can use these examples as guides when creating your own topic files. The
  14643. examples should help you predict how a particular topic file created in a
  14644. word processor will appear to the user.  %@NL@%
  14645.  
  14646. The second part of this chapter contains a list of Help Compiler error
  14647. messages. Each message is shown as it appears when the compiler encounters
  14648. the specific error. A short explanation accompanies each message to aid you
  14649. in solving the problem in your Help system. Preceding the error message
  14650. listing is a short description of the error reporting behavior of the Help
  14651. Compiler. Understanding how the compiler reports and reacts to errors will
  14652. help you to debug your Help files.%@CR:C6A00190002 @%%@NL@%
  14653.  
  14654.  
  14655. %@2@%%@CR:C6A00190003 @%%@AB@%19.1  Help Topic Examples%@AE@%%@EH@%%@NL@%
  14656.  
  14657. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14658.  
  14659. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14660.  
  14661. <$R>  %@NL@%
  14662.  
  14663. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14664.  
  14665. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14666.  
  14667. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14668.  
  14669. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14670.  
  14671. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14672.  
  14673. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14674.  
  14675. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14676.  
  14677. %@AU@%(This figure may be found in the printed book).%@AE@%%@NL@%
  14678.  
  14679. The following is the Helpex (sample Help) project file:  %@NL@%
  14680.  
  14681. %@AS@%  [OPTIONS]
  14682. %@AS@%  ROOT=c:\help
  14683. %@AS@%  INDEX=main_index
  14684. %@AS@%  TITLE=Help Example
  14685. %@AS@%  COMPRESS=true
  14686. %@AS@%   
  14687. %@AS@%  [FILES]
  14688. %@AS@%  helpex.rtf  ; jump topics
  14689. %@AS@%  terms.rtf   ; look-up terms
  14690. %@AS@%   
  14691. %@AS@%  [MAP]
  14692. %@AS@%  main_index 0xFFFF
  14693. %@AS@%  #define HELPID_EDIT_CLEAR     100
  14694. %@AS@%  #define HELPID_EDIT_COPY      101
  14695. %@AS@%  #define HELPID_EDIT_CUT       102
  14696. %@AS@%  #define HELPID_EDIT_PASTE     103
  14697. %@AS@%  #define HELPID_EDIT_UNDO      104
  14698. %@AS@%  #define HELPID_FILE_EXIT      200
  14699. %@AS@%  #define HELPID_FILE_NEW       201
  14700. %@AS@%  #define HELPID_FILE_OPEN      202
  14701. %@AS@%  #define HELPID_FILE_PRINT     203
  14702. %@AS@%  #define HELPID_FILE_SAVE      204
  14703. %@AS@%  #define HELPID_FILE_SAVE_AS   205
  14704. %@AS@%  #define HELPID_EDIT_WINDOW    300
  14705. %@AS@%  #define HELPID_MAXIMIZE_ICON  301
  14706. %@AS@%  #define HELPID_MINIMIZE_ICON  302
  14707. %@AS@%  #define HELPID_SPLIT_BAR      303
  14708. %@AS@%  #define HELPID_SIZE_BOX       304
  14709. %@AS@%  #define HELPID_SYSTEM_MENU    305
  14710. %@AS@%  #define HELPID_TITLE_BAR      306
  14711. %@AS@%  #define HELPID_SIZING_BORDER  307%@AE@%
  14712.  
  14713.  
  14714. %@2@%%@CR:C6A00190004 @%%@AB@%19.2  Help Compiler Error Messages%@AE@%%@EH@%%@NL@%
  14715.  
  14716. The Help Compiler displays messages when it encounters errors in building
  14717. the Help resource file. Errors during processing of the project file are
  14718. numbered beginning with the letter P and appear as in the following
  14719. examples:%@CR:C6A00190005 @%%@CR:C6A00190006 @%%@NL@%
  14720.  
  14721. %@AS@%  Error P1025: line...7 of filename.HPJ : Section heading sectionname
  14722. %@AS@%unrecognized.%@AE@%
  14723.  
  14724. %@AS@%  Warning P1039: line...38 of filename.HPJ : [BUILDTAGS] section missing.%@AE@%
  14725.  
  14726. Errors which occur during processing of the RTF topic file(s) are numbered
  14727. beginning with the letter R and appear as in the following examples:  %@NL@%
  14728.  
  14729. %@AS@%  Error R2025: File environment error.%@AE@%
  14730.  
  14731. %@AS@%  Warning R2501: Using old key-phrase table.%@AE@%
  14732.  
  14733. Whenever possible, the compiler will display the topic number and/or
  14734. filename that contains the error. Though topics are not numbered, the topic
  14735. number given with an error message refers to that topic's sequential
  14736. position in your RTF file (first, second, etc.). These numbers may be
  14737. identical to the page number shown by your word processor, depending on the
  14738. number of lines you have assigned to the hypothetical printed page. Remember
  14739. that topics are separated by hard page breaks, even though there is no such
  14740. thing as a "page" in the Help system.  %@NL@%
  14741.  
  14742. Messages beginning with the word "Error" are fatal errors. Errors are always
  14743. reported, and no usable Help resource file will result from the build.
  14744. Messages beginning with the word "Warning" are less serious in nature. A
  14745. build with warnings will produce a valid Help resource file which will load
  14746. under Windows, but the file may contain operational errors. You can specify
  14747. the amount of warning information to be reported by the compiler. See
  14748. section 17.4.1, "Specifying Error Reporting: The Warning Option," for more
  14749. information on choosing warning levels to be displayed.%@CR:C6A00190007 @%%@CR:C6A00190008 @%%@NL@%
  14750.  
  14751. The compiler's reaction to an error is described for each error in the
  14752. listing that follows. During processing of the project file, the compiler
  14753. ignores lines that contain errors and attempts to continue with the build.
  14754. This means that errors encountered early in a build may result in many more
  14755. errors being reported as the build continues. Similarly, errors during
  14756. processing of the RTF topic files will be reported and if not serious, the
  14757. compiler will continue with the build. A single error condition in the topic
  14758. file may result in more than one error message being reported by the
  14759. compiler. For instance, a misidentified topic will cause an error to be
  14760. reported every time jump terms refer to the correct topic identifier. Such a
  14761. mistake is easily rectified by simply correcting the footnote containing the
  14762. wrong context string.  %@NL@%
  14763.  
  14764.  
  14765. %@3@%%@CR:C6A00190009 @%%@AB@%19.2.1  Errors During Processing of Project File%@AE@%%@EH@%%@NL@%
  14766.  
  14767. %@AB@%P1001%@AE@%                             Unable to read file %@AI@%filename%@AE@%.
  14768.  
  14769.                                   The file specified in the project file 
  14770.                                   is unreadable. This is a DOS file error.
  14771.  
  14772. %@AB@%P1003%@AE@%                             Invalid path specified in Root option.
  14773.  
  14774.                                   The path specified by the Root option 
  14775.                                   cannot be found. The compiler uses the 
  14776.                                   current working directory.  
  14777.  
  14778. %@AB@%P1005%@AE@%                             Path and filename exceed limit of 79 
  14779.                                   characters.
  14780.  
  14781.                                   The absolute pathname, or the combined 
  14782.                                   root and relative pathname, exceed the 
  14783.                                   DOS limit of 79 characters. The file is 
  14784.                                   skipped.  
  14785.  
  14786. %@AB@%P1007%@AE@%                             Root path exceeds maximum limit of 66 
  14787.                                   characters.
  14788.  
  14789.                                   The specified root pathname exceeds the 
  14790.                                   DOS limit of 66 characters. The pathname
  14791.                                   is ignored and the compiler uses the 
  14792.                                   current working directory.  
  14793.  
  14794. %@AB@%P1009%@AE@%                             [FILES] section missing.
  14795.  
  14796.                                   The [Files] section is required. The 
  14797.                                   compilation is aborted.  
  14798.  
  14799. %@AB@%P1011%@AE@%                             Option %@AI@%optionname%@AE@% previously defined.
  14800.  
  14801.                                   The specified option was defined 
  14802.                                   previously. The compiler ignores the 
  14803.                                   attempted redefinition.%@CR:C6A00190010 @%%@CR:C6A00190011 @%  
  14804.  
  14805. %@AB@%P1013%@AE@%                             Project file extension cannot be .HLP.
  14806.  
  14807.                                   You cannot specify that the compiler use
  14808.                                   a project file with the .HLP extension. 
  14809.                                   Normally, project files are given the 
  14810.                                   .HPJ extension.  
  14811.  
  14812. %@AB@%P1015%@AE@%                             Unexpected end-of-file.
  14813.  
  14814.                                   The compiler has unexpectedly come to 
  14815.                                   the end of the project file. There might
  14816.                                   be an open comment in the project file 
  14817.                                   or an included file.  
  14818.  
  14819. %@AB@%P1017%@AE@%                             Parameter exceeds maximum length of 128 
  14820.                                   characters.
  14821.  
  14822.                                   An option, context name or number, build
  14823.                                   tag, or other parameter on the specified
  14824.                                   line exceeds the limit of 128 characters.
  14825.                                   The line is ignored.  
  14826.  
  14827. %@AB@%P1021%@AE@%                             Context number already used in [MAP] 
  14828.                                   section.
  14829.  
  14830.                                   The context number on the specified line
  14831.                                   in the project file was previously 
  14832.                                   mapped to a different context string. 
  14833.                                   The line is ignored.  
  14834.  
  14835. %@AB@%P1023%@AE@%                             Include statements nested too deeply.
  14836.  
  14837.                                   The %@AB@%#include%@AE@% statement on the specified 
  14838.                                   line has exceeded the maximum of five 
  14839.                                   include levels.  
  14840.  
  14841. %@AB@%P1025%@AE@%                             Section heading %@AI@%sectionname%@AE@% 
  14842.                                   unrecognized.
  14843.  
  14844.                                   A section heading that is not supported 
  14845.                                   by the compiler has been used. The line 
  14846.                                   is skipped.  
  14847.  
  14848. %@AB@%P1027%@AE@%                             Bracket missing from section heading %@AI@%%@AE@%
  14849.                                   %@AI@%sectionname%@AE@%.
  14850.  
  14851.                                   The right bracket (]) is missing from 
  14852.                                   the specified section heading. Insert 
  14853.                                   the bracket and compile again.  
  14854.  
  14855. %@AB@%P1029%@AE@%                             Section heading missing.
  14856.  
  14857.                                   The section heading on the specified 
  14858.                                   line is not complete. This error is also
  14859.                                   reported if the first entry in the 
  14860.                                   project file is not a section heading. 
  14861.                                   The compiler continues with the next 
  14862.                                   line.  
  14863.  
  14864. %@AB@%P1030%@AE@%                             Section %@AI@%sectionname%@AE@% previously defined.%@CR:C6A00190012 @%%@CR:C6A00190013 @%
  14865.  
  14866.                                   A duplicate section has been found in 
  14867.                                   the project file. The lines under the 
  14868.                                   duplicated section heading are ignored 
  14869.                                   and the compiler continues from the next
  14870.                                   valid section heading.  
  14871.  
  14872. %@AB@%P1031%@AE@%                             Maximum number of build tags exceeded.
  14873.  
  14874.                                   The maximum number of build tags that 
  14875.                                   can be defined is 30. The excess tags 
  14876.                                   are ignored.  
  14877.  
  14878. %@AB@%P1033%@AE@%                             Duplicate build tag in [BUILDTAGS] 
  14879.                                   section.
  14880.  
  14881.                                   A build tag in the [BuildTags] section 
  14882.                                   has been repeated unnecessarily  
  14883.  
  14884. %@AB@%P1035%@AE@%                             Build tag length exceeds maximum.
  14885.  
  14886.                                   The build tag on the specified line 
  14887.                                   exceeds the maximum of 32 characters. 
  14888.                                   The compiler skips this entry.  
  14889.  
  14890. %@AB@%P1037%@AE@%                             Build tag %@AI@%tagname%@AE@% contains invalid 
  14891.                                   characters.
  14892.  
  14893.                                   Build tags can contain only alphanumeric
  14894.                                   characters or the underscore (_) 
  14895.                                   character. The line is skipped.  
  14896.  
  14897. %@AB@%P1039%@AE@%                             [BUILDTAGS] section missing.
  14898.  
  14899.                                   The %@AB@%BUILD%@AE@% option declared a conditional 
  14900.                                   build, but there is no [BuildTags] 
  14901.                                   section in the project file. All topics 
  14902.                                   are included in the build.  
  14903.  
  14904. %@AB@%P1043%@AE@%                             Too many tags in Build expression.
  14905.  
  14906.                                   The Build expression on the specified 
  14907.                                   line has used more than the maximum of 
  14908.                                   20 build tags. The compiler ignores the 
  14909.                                   line.  
  14910.  
  14911. %@AB@%P1045%@AE@%                             [ALIAS] section found after [MAP] 
  14912.                                   section.
  14913.  
  14914.                                   When used, the [Alias] section must 
  14915.                                   precede the [Map] section in the project
  14916.                                   file. The [Alias] section is skipped 
  14917.                                   otherwise.  
  14918.  
  14919. %@AB@%P1047%@AE@%                             Context string %@AI@%contextname%@AE@% already 
  14920.                                   assigned an alias.
  14921.  
  14922.                                   You cannot do: a=b then a=c (A context 
  14923.                                   string can only have one alias.)  
  14924.  
  14925.                                   The specified context string has 
  14926.                                   previously been aliased in the [Alias] 
  14927.                                   section. The attempted reassignment on 
  14928.                                   this line is ignored.%@CR:C6A00190014 @%%@CR:C6A00190015 @%  
  14929.  
  14930. %@AB@%P1049%@AE@%                             Alias string aliasname already assigned.
  14931.  
  14932.                                   You cannot do: a=b then b=c (You can't 
  14933.                                   alias an alias.)  
  14934.  
  14935.                                   An alias string cannot, in turn, be 
  14936.                                   assigned another alias.  
  14937.  
  14938. %@AB@%P1051%@AE@%                             Context string %@AI@%contextname%@AE@% cannot be 
  14939.                                   used as alias string.
  14940.  
  14941.                                   You cannot do: a=b then c=a  
  14942.  
  14943.                                   A context string that has been assigned 
  14944.                                   an alias cannot be used later as an 
  14945.                                   alias for another context string.  
  14946.  
  14947. %@AB@%P1053%@AE@%                             Maximum number of font ranges exceeded.
  14948.  
  14949.                                   The maximum number of font ranges that 
  14950.                                   can be specified is five. The rest are 
  14951.                                   ignored.  
  14952.  
  14953. %@AB@%P1055%@AE@%                             Current font range overlaps previously 
  14954.                                   defined range.
  14955.  
  14956.                                   A font size range overlaps a previously 
  14957.                                   defined mapping. Adjust either font 
  14958.                                   range to remove any overlaps. The second
  14959.                                   mapping is ignored.  
  14960.  
  14961. %@AB@%P1056%@AE@%                             Unrecognized font name in Forcefont 
  14962.                                   option.
  14963.  
  14964.                                   A font name not supported by the 
  14965.                                   compiler has been encountered. The font 
  14966.                                   name is ignored and the compiler uses 
  14967.                                   the default Helv font.  
  14968.  
  14969. %@AB@%P1057%@AE@%                             Font name too long.
  14970.  
  14971.                                   Font names cannot exceed 20 characters. 
  14972.                                   The font is ignored.  
  14973.  
  14974. %@AB@%P1059%@AE@%                             Invalid multiple-key syntax.
  14975.  
  14976.                                   The syntax used with a %@AB@%MULTIKEY%@AE@% option 
  14977.                                   is unrecognized. See Chapter 18, 
  14978.                                   "Building the Help File," for the proper
  14979.                                   syntax.  
  14980.  
  14981. %@AB@%P1061%@AE@%                             Character already used.
  14982.  
  14983.                                   The specified key word-table identifier 
  14984.                                   is already in use. Choose another 
  14985.                                   character.%@CR:C6A00190016 @%%@CR:C6A00190017 @%  
  14986.  
  14987. %@AB@%P1063%@AE@%                             Characters 'K' and 'k' cannot be used.
  14988.  
  14989.                                   These characters are reserved for Help's
  14990.                                   normal key-word table. Choose another 
  14991.                                   character.  
  14992.  
  14993. %@AB@%P1065%@AE@%                             Maximum number of keyword tables 
  14994.                                   exceeded.
  14995.  
  14996.                                   The limit of five key-word tables has 
  14997.                                   been exceeded. Reduce the number. The 
  14998.                                   excess tables are ignored.  
  14999.  
  15000. %@AB@%P1067%@AE@%                             Equal sign missing.
  15001.  
  15002.                                   An option is missing its required equal 
  15003.                                   sign on the specified line. Check the 
  15004.                                   syntax for the option.  
  15005.  
  15006. %@AB@%P1069%@AE@%                             Context string missing.
  15007.  
  15008.                                   The line specified is missing a context 
  15009.                                   string before an equal sign.  
  15010.  
  15011. %@AB@%P1071%@AE@%                             Incomplete line in %@AI@%sectionname%@AE@% section.
  15012.  
  15013.                                   The entry on the specified line is not 
  15014.                                   complete. The line is skipped.  
  15015.  
  15016. %@AB@%P1073%@AE@%                             Unrecognized option in [OPTIONS] 
  15017.                                   section.
  15018.  
  15019.                                   An option has been used that is not 
  15020.                                   supported by the compiler. The line is 
  15021.                                   skipped.  
  15022.  
  15023. %@AB@%P1075%@AE@%                             Invalid build expression.
  15024.  
  15025.                                   The syntax used in the build expression 
  15026.                                   on the specified line contains one or 
  15027.                                   more logical or syntax errors.  
  15028.  
  15029. %@AB@%P1077%@AE@%                             Warning level must be 1, 2, or 3.
  15030.  
  15031.                                   The %@AB@%WARNING%@AE@% reporting level can only be 
  15032.                                   set to 1, 2, or 3. The compiler will 
  15033.                                   default to full reporting (level 3).  
  15034.  
  15035. %@AB@%P1079%@AE@%                             Invalid compression option.
  15036.  
  15037.                                   The %@AB@%COMPRESS%@AE@% option can only be set to 
  15038.                                   TRUE or FALSE. The compilation continues
  15039.                                   without compression.  
  15040.  
  15041. %@AB@%P1081%@AE@%                             Invalid title string.
  15042.  
  15043.                                   The %@AB@%TITLE%@AE@% option defines a string that 
  15044.                                   is null or contains more than 32 
  15045.                                   characters. The title is truncated.%@CR:C6A00190018 @%%@CR:C6A00190019 @%  
  15046.  
  15047. %@AB@%P1083%@AE@%                             Invalid context identification number.
  15048.  
  15049.                                   The context number on the specified line
  15050.                                   is null or contains invalid characters. 
  15051.  
  15052. %@AB@%P1085%@AE@%                             Unrecognized text.
  15053.  
  15054.                                   The unrecognizable text that follows 
  15055.                                   valid text in the specified line is 
  15056.                                   ignored.  
  15057.  
  15058. %@AB@%P1086%@AE@%                             Invalid font-range syntax.
  15059.  
  15060.                                   The font-range definition on the 
  15061.                                   specified line contains invalid syntax. 
  15062.                                   The compiler ignores the line. Check the
  15063.                                   syntax for the %@AB@%MAPFONTSIZE%@AE@% option.  
  15064.  
  15065. %@AB@%P1089%@AE@%                             Unrecognized sort ordering.
  15066.  
  15067.                                   You have specified an ordering that is 
  15068.                                   not supported by the compiler. Contact 
  15069.                                   Microsoft Product Support Services for 
  15070.                                   clarification of the error.  
  15071.  
  15072.  
  15073. %@3@%%@CR:C6A00190020 @%%@AB@%19.2.2  Errors During Processing of RTF Topic Files%@AE@%%@EH@%%@NL@%
  15074.  
  15075. %@AB@%R2001%@AE@%                             Unable to open bitmap file %@AI@%filename%@AE@%.
  15076.  
  15077.                                   The specified bitmap file is unreadable.
  15078.                                   This is a DOS file error.%@CR:C6A00190021 @%%@CR:C6A00190022 @%  
  15079.  
  15080. %@AB@%R2003%@AE@%                             Unable to include bitmap file %@AI@%filename%@AE@%.
  15081.  
  15082.                                   The specified bitmap file could not be 
  15083.                                   found or is unreadable. This is a DOS 
  15084.                                   file error or an out-of-memory condition.
  15085.  
  15086. %@AB@%R2005%@AE@%                             Disk full.
  15087.  
  15088.                                   The Help resource file could not be 
  15089.                                   written to disk. Create more space on 
  15090.                                   the destination drive.  
  15091.  
  15092. %@AB@%R2009%@AE@%                             Cannot use reserved DOS device name for 
  15093.                                   file %@AI@%filename%@AE@%.
  15094.  
  15095.                                   A file has been referred to as COM1, 
  15096.                                   LPT2, PRN, etc. Rename the file.  
  15097.  
  15098. %@AB@%R2013%@AE@%                             Output file %@AI@%filename%@AE@% already exists as a
  15099.                                   directory.
  15100.  
  15101.                                   There is a subdirectory in the Help 
  15102.                                   project root with the same name as the 
  15103.                                   desired Help resource file. Move or 
  15104.                                   rename the subdirectory.  
  15105.  
  15106. %@AB@%R2015%@AE@%                             Output file %@AI@%filename%@AE@% already exists as 
  15107.                                   read-only.
  15108.  
  15109.                                   The specified filename cannot be 
  15110.                                   overwritten by the Help resource file 
  15111.                                   because the file has a read-only 
  15112.                                   attribute. Rename the project file or 
  15113.                                   change the file's attribute.  
  15114.  
  15115. %@AB@%R2017%@AE@%                             Path for file %@AI@%filename%@AE@% exceeds limit of 
  15116.                                   79 characters.
  15117.  
  15118.                                   The absolute pathname, or the combined 
  15119.                                   root and relative pathname, to the 
  15120.                                   specified file exceed the DOS limit of 
  15121.                                   79 characters. The file is ignored.  
  15122.  
  15123. %@AB@%R2019%@AE@%                             Cannot open file %@AI@%filename%@AE@%.
  15124.  
  15125.                                   The specified file is unreadable. This 
  15126.                                   is a DOS file error.  
  15127.  
  15128. %@AB@%R2021%@AE@%                             Cannot find file %@AI@%filename%@AE@%.
  15129.  
  15130.                                   The specified file could not be found or
  15131.                                   is unreadable. This is a DOS file error 
  15132.                                   or an out-of-memory condition.  
  15133.  
  15134. %@AB@%R2023%@AE@%                             Not enough memory to build Help file.
  15135.  
  15136.                                   To free up memory, unload any unneeded 
  15137.                                   applications, device drivers, and 
  15138.                                   memory-resident programs.%@CR:C6A00190023 @%%@CR:C6A00190024 @%  
  15139.  
  15140. %@AB@%R2025%@AE@%                             File environment error.
  15141.  
  15142.                                   The compiler has insufficient available 
  15143.                                   file handles to continue. Increase the 
  15144.                                   values for FILES= and BUFFERS= in your 
  15145.                                   CONFIG.SYS file and reboot.  
  15146.  
  15147. %@AB@%R2027%@AE@%                             Build tag %@AI@%tagname%@AE@% not defined in 
  15148.                                   [BUILDTAGS] section of project file. 
  15149.  
  15150.                                   The specified build tag has been 
  15151.                                   assigned to a topic, but not declared in
  15152.                                   the project file. The tag is ignored for
  15153.                                   the topic.  
  15154.  
  15155. %@AB@%R2033%@AE@%                             Context string in Map section not 
  15156.                                   defined in any topic.
  15157.  
  15158.                                   There are one or more context strings 
  15159.                                   defined in the project file that the 
  15160.                                   compiler could not find topics for.  
  15161.  
  15162. %@AB@%R2035%@AE@%                             Build expression missing from project 
  15163.                                   file.
  15164.  
  15165.                                   The topics have build tags, but there is
  15166.                                   no Build= expression in the project file.
  15167.                                   The compiler includes all topics in the 
  15168.                                   build.  
  15169.  
  15170. %@AB@%R2037%@AE@%                             File %@AI@%filename%@AE@% cannot be created, due to 
  15171.                                   previous error(s).
  15172.  
  15173.                                   The Help resource file could not be 
  15174.                                   created because the compiler has no 
  15175.                                   topics remaining to be processed. 
  15176.                                   Correct the errors that preceded this 
  15177.                                   error and recompile.  
  15178.  
  15179. %@AB@%R2039%@AE@%                             Unrecognized table formatting in topic %@AI@%%@AE@%
  15180.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15181.  
  15182.                                   The compiler ignores table formatting 
  15183.                                   that is unsupported in Help.  Reformat 
  15184.                                   the entries as linear text if possible. 
  15185.  
  15186. %@AB@%R2041%@AE@%                             Jump %@AI@%context_string%@AE@% unresolved in topic %@AI@%%@AE@%
  15187.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15188.  
  15189.                                   The specified topic contains a context 
  15190.                                   string that identifies a nonexistent 
  15191.                                   topic. Check spelling, and that the 
  15192.                                   desired topic is included in the build. 
  15193.  
  15194. %@AB@%R2043%@AE@%                             Hotspot text cannot spread over 
  15195.                                   paragraphs.
  15196.  
  15197.                                   A jump term spans two paragraphs. Remove
  15198.                                   the formatting from the paragraph mark.%@CR:C6A00190025 @%%@CR:C6A00190026 @% 
  15199.  
  15200. %@AB@%R2045%@AE@%                             Maximum number of tab stops reached in 
  15201.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15202.  
  15203.                                   The limit of 32 tab stops has been 
  15204.                                   exceeded in the specified topic. The 
  15205.                                   default stops are used after the 32nd 
  15206.                                   tab.  
  15207.  
  15208. %@AB@%R2047%@AE@%                             File %@AI@%filename%@AE@% not created.
  15209.  
  15210.                                   There are no topics to compile, or the 
  15211.                                   build expression is false for all topics.
  15212.                                   There is no Help resource file created. 
  15213.  
  15214. %@AB@%R2049%@AE@%                             Context string text too long in topic %@AI@%%@AE@%
  15215.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15216.  
  15217.                                   Context string hidden text cannot exceed
  15218.                                   64 characters. The string is ignored.  
  15219.  
  15220. %@AB@%R2051%@AE@%                             File %@AI@%filename%@AE@% is not a valid RTF topic 
  15221.                                   file.
  15222.  
  15223.                                   The specified file is not an RTF file. 
  15224.                                   Check that you have saved the topic as 
  15225.                                   RTF from your word processor.  
  15226.  
  15227. %@AB@%R2053%@AE@%                             Font %@AI@%fontname%@AE@% in file %@AI@%filename%@AE@% not in 
  15228.                                   RTF font table.
  15229.  
  15230.                                   A font not defined in the RTF header has
  15231.                                   been entered into the topic. The 
  15232.                                   compiler uses the default system font.  
  15233.  
  15234. %@AB@%R2055%@AE@%                             File %@AI@%filename%@AE@% is not a usable RTF topic 
  15235.                                   file.
  15236.  
  15237.                                   The specified file contains a valid RTF 
  15238.                                   header, but the content is not RTF or is
  15239.                                   corrupted.  
  15240.  
  15241. %@AB@%R2057%@AE@%                             Unrecognized graphic format in topic %@AI@%%@AE@%
  15242.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15243.  
  15244.                                   The compiler supports only Windows 
  15245.                                   bitmaps. Check that metafiles or  
  15246.                                   Macintosh formats have not been used. 
  15247.                                   The graphic is ignored.  
  15248.  
  15249. %@AB@%R2059%@AE@%                             Context string identifier already 
  15250.                                   defined in topic %@AI@%topicnumber%@AE@% of file %@AI@%%@AE@%
  15251.                                   %@AI@%filename%@AE@%.
  15252.  
  15253.                                   There is more than one context-string 
  15254.                                   identifier footnote for the specified 
  15255.                                   topic. The compiler uses the identifier 
  15256.                                   defined in the first # footnote.%@CR:C6A00190027 @%%@CR:C6A00190028 @%  
  15257.  
  15258. %@AB@%R2061%@AE@%                             Context string %@AI@%contextname%@AE@% already used 
  15259.                                   in file %@AI@%filename%@AE@%.
  15260.  
  15261.                                   The specified context string was 
  15262.                                   previously assigned to another topic. 
  15263.                                   The compiler ignores the latter string 
  15264.                                   and the topic has no identifier.  
  15265.  
  15266. %@AB@%R2063%@AE@%                             Invalid context-string identifier for 
  15267.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15268.  
  15269.                                   The context-string footnote contains 
  15270.                                   nonalphanumeric characters or is null. 
  15271.                                   The topic is not assigned an identifier.
  15272.  
  15273. %@AB@%R2065%@AE@%                             Context string defined for index topic 
  15274.                                   is unresolved.
  15275.  
  15276.                                   The index topic defined in the project 
  15277.                                   file could not be found. The compiler 
  15278.                                   uses the first topic in the build as the
  15279.                                   index.  
  15280.  
  15281. %@AB@%R2067%@AE@%                             Footnote text too long in topic %@AI@%%@AE@%
  15282.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15283.  
  15284.                                   Footnote text cannot exceed the limit of
  15285.                                   1000 characters. The footnote is ignored.
  15286.  
  15287. %@AB@%R2069%@AE@%                             Build tag footnote not at beginning of 
  15288.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15289.  
  15290.                                   The specified topic contains a buildtag 
  15291.                                   footnote that is not the first character
  15292.                                   in the topic. The topic is not assigned 
  15293.                                   a build tag.  
  15294.  
  15295. %@AB@%R2071%@AE@%                             Footnote text missing in topic %@AI@%%@AE@%
  15296.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15297.  
  15298.                                   The specified topic contains a footnote 
  15299.                                   that has no characters.  
  15300.  
  15301. %@AB@%R2073%@AE@%                             Keyword string is null in topic %@AI@%%@AE@%
  15302.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15303.  
  15304.                                   A key-word footnote exists for the 
  15305.                                   specified topic, but contains no 
  15306.                                   characters.  
  15307.  
  15308. %@AB@%R2075%@AE@%                             Keyword string too long in topic %@AI@%%@AE@%
  15309.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15310.  
  15311.                                   The text in the key-word footnote in the
  15312.                                   specified topic exceeds the limit of 255
  15313.                                   characters. The excess characters are 
  15314.                                   ignored.  
  15315.  
  15316. %@AB@%R2077%@AE@%                             Keyword(s) defined without title in 
  15317.                                   topic %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15318.  
  15319.                                   Key word(s) have been defined for the 
  15320.                                   specified topic, but the topic has no 
  15321.                                   title assigned. Search Topics Found 
  15322.                                   displays Untitled Topic< for the topic.%@CR:C6A00190029 @%%@CR:C6A00190030 @% 
  15323.  
  15324. %@AB@%R2079%@AE@%                             Browse sequence string is null in topic %@AI@%%@AE@%
  15325.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15326.  
  15327.                                   The browse-sequence footnote for the 
  15328.                                   specified topic contains no sequence 
  15329.                                   characters.  
  15330.  
  15331. %@AB@%R2081%@AE@%                             Browse sequence string too long in topic
  15332.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15333.  
  15334.                                   The browse-sequence footnote for the 
  15335.                                   specified topic exceeds the limit of 128
  15336.                                   characters. The sequence is ignored.  
  15337.  
  15338. %@AB@%R2083%@AE@%                             Missing sequence number in topic %@AI@%%@AE@%
  15339.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15340.  
  15341.                                   A browse-sequence number ends in a colon
  15342.                                   (:) for the specified topic. Remove the 
  15343.                                   colon, or enter a "minor" sequence 
  15344.                                   number.  
  15345.  
  15346. %@AB@%R2085%@AE@%                             Sequence number already defined in topic
  15347.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15348.  
  15349.                                   There is already a browse-sequence 
  15350.                                   footnote for the specified topic. The 
  15351.                                   latter sequence is ignored.  
  15352.  
  15353. %@AB@%R2087%@AE@%                             Build tag too long.
  15354.  
  15355.                                   A build tag for the specified topic 
  15356.                                   exceeds the maximum of 32 characters. 
  15357.                                   The tag is ignored for the topic.  
  15358.  
  15359. %@AB@%R2089%@AE@%                             Title string null in topic %@AI@%topicnumber%@AE@% 
  15360.                                   of file %@AI@%filename%@AE@%.
  15361.  
  15362.                                   The title footnote for the specified 
  15363.                                   topic contains no characters. The topic 
  15364.                                   is not assigned a title.  
  15365.  
  15366. %@AB@%R2091%@AE@%                             Title too long in topic %@AI@%topicnumber%@AE@% of 
  15367.                                   file %@AI@%filename%@AE@%.
  15368.  
  15369.                                   The title for the specified topic 
  15370.                                   exceeds the limit of 128 characters. The
  15371.                                   excess characters are ignored.  
  15372.  
  15373. %@AB@%R2093%@AE@%                             Title titlename in topic %@AI@%topicnumber%@AE@% of 
  15374.                                   file %@AI@%filename%@AE@% used previously.
  15375.  
  15376.                                   The specified title has previously been 
  15377.                                   assigned to another topic. %@CR:C6A00190031 @%%@CR:C6A00190032 @%  
  15378.  
  15379. %@AB@%R2095%@AE@%                             Title defined more than once in topic %@AI@%%@AE@%
  15380.                                   %@AI@%topicnumber%@AE@% of file %@AI@%filename%@AE@%.
  15381.  
  15382.                                   There is more than one title footnote in
  15383.                                   the specified topic. The compiler uses 
  15384.                                   the first title string.  
  15385.  
  15386. %@AB@%R2501%@AE@%                             Using old key-phrase table.
  15387.  
  15388.                                   Maximum compression can only result by 
  15389.                                   deleting the .PH file before each 
  15390.                                   recompilation of the Help topics.  
  15391.  
  15392. %@AB@%R2503%@AE@%                             Out of memory during text compression.
  15393.  
  15394.                                   The compiler encountered a memory 
  15395.                                   limitation during compression. 
  15396.                                   Compilation continues with the Help 
  15397.                                   resource file not compressed. Unload any
  15398.                                   unneeded applications, device drivers, 
  15399.                                   and memory-resident programs.  
  15400.  
  15401. %@AB@%R2505%@AE@%                             File environment error during text 
  15402.                                   compression. 
  15403.  
  15404.                                   The compiler has insufficient available 
  15405.                                   file handles for compression. 
  15406.                                   Compilation continues with the Help 
  15407.                                   resource file not compressed. Increase 
  15408.                                   the values for FILES= and BUFFERS= in 
  15409.                                   your CONFIG.SYS file and reboot.  
  15410.  
  15411. %@AB@%R2507%@AE@%                             DOS file error during text compression.
  15412.  
  15413.                                   The compiler encountered a problem 
  15414.                                   accessing a disk file during compression.
  15415.                                   Compilation continues with the Help 
  15416.                                   resource file not compressed.  
  15417.  
  15418. %@AB@%R2509%@AE@%                             Error during text compression.
  15419.  
  15420.                                   One of the three compression 
  15421.                                   errors─R2503, R2505, or R2507─has 
  15422.                                   occurred. Compilation continues with the
  15423.                                   Help resource file not compressed.  
  15424.  
  15425. %@AB@%R2701%@AE@%                             Internal error.
  15426.  
  15427.                                   Contact Microsoft Product Support 
  15428.                                   Services for clarification of the error.
  15429.  
  15430. %@AB@%R2703%@AE@%                             Internal error.
  15431.  
  15432.                                   Contact Microsoft Product Support 
  15433.                                   Services for clarification of the error.
  15434.  
  15435. %@AB@%R2705%@AE@%                             Internal error.
  15436.  
  15437.                                   Contact Microsoft Product Support 
  15438.                                   Services for clarification of the error.%@CR:C6A00190033 @%
  15439.                                   %@CR:C6A00190034 @%  
  15440.  
  15441. %@AB@%R2707%@AE@%                             Internal error.
  15442.  
  15443.                                   Contact Microsoft Product Support 
  15444.                                   Services for clarification of the error.
  15445.  
  15446. %@AB@%R2709%@AE@%                             Internal error.
  15447.  
  15448.                                   Contact Microsoft Product Support 
  15449.                                   Services for clarification of the error.%@CR:C6A00190035 @%
  15450.                                   %@CR:C6A00190036 @%  
  15451.  
  15452.  
  15453.  
  15454. %@CR:GeneralIndex@%
  15455. %@1@%%@AB@%INDEX%@AE@%%@EH@%%@NL@%
  15456. %@AB@%──────────────────────────────────────────────────────────────────────────
  15457.  
  15458.  
  15459.  
  15460. { } (brackets), in symbol map display%@BO:       5dffd@%
  15461. { } (curly braces), as document convention%@BO:        acc7@%
  15462. ( ) (parentheses), as document convention%@BO:        9ea9@%
  15463. " " (quotation marks), as document convention%@BO:        ac17@%
  15464. -? option%@BO:       1cab1@%
  15465. * (asterisk)
  15466.   wildcard character%@BO:       5ebd4@%%@BO:       64f19@%%@BO:       7225b@%
  15467.   with commands%@BO:       71e51@%
  15468. @ (at symbol), with commands%@BO:       65002@%
  15469. : (colon), use of with doubleword values%@BO:       6d471@%
  15470. , (comma), as parameter separator%@BO:       13eba@%
  15471. $ (dollar sign), as symbol with commands%@BO:       65002@%
  15472. - (hyphen), as SYMDEB option designator%@BO:       5c450@%
  15473. . (period), as ASCII value%@BO:       69bfd@%
  15474. + (plus sign), as filename separator%@BO:       13bd5@%
  15475. ? (question mark), with commands%@BO:       64f19@%%@BO:       71e51@%
  15476. ; (semicolon), in SYMDEB command list%@BO:       5c31d@%%@BO:       6914b@%
  15477. / (slash), as SYMDEB option designator%@BO:       5c450@%
  15478. _ (underscore), with commands%@BO:       64f19@%
  15479. | (vertical bar), as document convention%@BO:        a9f4@%
  15480. . . . (ellipses), as document convention%@BO:        a57c@%
  15481. {{ }} (double brackets), as document convention%@BO:        a7d9@%
  15482.  
  15483. %@2@%%@AB@%    A%@AE@%%@EH@%%@NL@%
  15484. Address arguments, SYMDEB%@BO:       65577@%%@BO:       66362@%
  15485. Allocating memory%@BO:       96391@%%@BO:       980b4@%
  15486. Allocation granularity%@BO:       980b4@%
  15487. ANSI character set%@BO:       39526@%
  15488. Applications
  15489.   and creating import libraries%@BO:       12f54@%
  15490.   and linking files%@BO:        f836@%%@BO:       1383a@%
  15491.   and starting SYMDEB%@BO:       5ee16@%
  15492.   building%@BO:        8d63@%
  15493.   C language%@BO:        c0a9@%
  15494.   compiling options for%@BO:        d47a@%
  15495.   development options for%@BO:        e4df@%
  15496.   executable%@BO:        f836@%
  15497.   memory model for%@BO:        dab7@%
  15498.   memory movement in%@BO:       97ad6@%
  15499.   module-definition (.DEF) files for%@BO:       11818@%
  15500.   optimizing performance of%@BO:       9eeca@%
  15501.   passing to Windows%@BO:       5cee3@%
  15502.   resource script (.RC) file%@BO:       27307@%
  15503.   startup routines for%@BO:       165fc@%
  15504. Arguments
  15505.   address%@BO:       65577@%%@BO:       66362@%
  15506.   SYMDEB command%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  15507. ASCII
  15508.   byte values, displaying%@BO:       697a5@%
  15509.   characters, displaying%@BO:       697a5@%
  15510.   strings, entering into memory%@BO:       6cd6d@%
  15511. Assembling instruction mnemonics%@BO:       6714f@%
  15512. Assembly-language symbol files%@BO:       58c05@%
  15513. Asterisk (*)
  15514.   wildcard character%@BO:       5ebd4@%%@BO:       639de@%%@BO:       7225b@%
  15515.   with commands%@BO:       71e51@%
  15516. At symbol (@), with commands%@BO:       65002@%
  15517.  
  15518. %@2@%%@AB@%    B%@AE@%%@EH@%%@NL@%
  15519. Binary resource file%@BO:        913a@%
  15520. Bitmap (.BMP) files
  15521.    %@AI@%see also%@AE@% Bitmaps%@NL@%
  15522.   and File menu%@BO:       20b17@%
  15523.   and Image menu%@BO:       20e65@%
  15524.   and SDKPAINT process%@BO:       1f5b2@%
  15525.   creating%@BO:       21bce@%
  15526.   described%@BO:       1f93b@%
  15527.   working with colors%@BO:       249c2@%
  15528. BITMAP resource statement%@BO:       18971@%
  15529. Bitmaps
  15530.    %@AI@%see also%@AE@% Bitmap (.BMP) files%@NL@%
  15531.   creating%@BO:       21a67@%
  15532.   described%@BO:       1f93b@%
  15533.   editing colors for%@BO:       2549c@%
  15534.   editing%@BO:       216c6@%%@BO:       23ddc@%
  15535.   opaque color options%@BO:       249c2@%
  15536.   using colors with%@BO:       21bce@%%@BO:       23a83@%
  15537. %@AB@%Bold text%@AE@%, as document convention%@BO:        9d83@%
  15538. Braces, curly ({ }), as document convention%@BO:        acc7@%
  15539. Brackets ({ }), in symbol map display%@BO:       5dffd@%
  15540. Brackets, double ({{ }}), as document convention%@BO:        a75c@%
  15541. Breakpoints
  15542.   "sticky", defined%@BO:       68cca@%
  15543.   clearing%@BO:       68318@%
  15544.   disabling%@BO:       686b1@%
  15545.   immediate%@BO:       5d55c@%
  15546.   interrupt key%@BO:       5fd0f@%
  15547.   restoring disabled%@BO:       687bb@%
  15548.   setting%@BO:       5fa48@%%@BO:       68cca@%
  15549.   virtual%@BO:       5fa48@%
  15550. Byte values
  15551.   displaying 4-byte values as hexadecimal%@BO:       69cf0@%
  15552.   displaying hexadecimal and ASCII values%@BO:       69a02@%
  15553.   searching for%@BO:       70981@%
  15554.  
  15555. %@2@%%@AB@%    C%@AE@%%@EH@%%@NL@%
  15556. C Compiler
  15557.   default option%@BO:        e94e@%
  15558.   options (table)%@BO:        d2ab@%%@BO:        d47a@%
  15559.   versions supported by Windows%@BO:        c0a9@%
  15560. C language
  15561.   applications%@BO:        c0a9@%
  15562.   libraries%@BO:        f19b@%%@BO:       165fc@%
  15563. C run-time libraries%@BO:       165fc@%%@BO:       16c58@%
  15564. Callback function%@BO:        f19b@%
  15565. CAPITAL LETTERS, SMALL, as document convention%@BO:        adf2@%
  15566. Character information%@BO:       34b21@%
  15567. Character mapping%@BO:       374f5@%
  15568. Character window
  15569.   clearing%@BO:       3649b@%
  15570.   described%@BO:       347ee@%
  15571. Character-viewing window%@BO:       34a3b@%
  15572. Characters
  15573.   adding columns to%@BO:       3545c@%
  15574.   adding rows to%@BO:       3545c@%
  15575.   canceling changes to%@BO:       3703e@%
  15576.   changing character pixels%@BO:       351b8@%
  15577.   changing width of%@BO:       366c8@%
  15578.   deleting columns from%@BO:       35ae1@%
  15579.   deleting rows from%@BO:       35ae1@%
  15580.   displayed in Font Editor window%@BO:       345ed@%
  15581.   editing blocks of pixels%@BO:       35d6a@%
  15582.   editing%@BO:       34ddc@%%@BO:       3562a@%
  15583.   first of font%@BO:       37a44@%
  15584.   last of font%@BO:       37cd0@%
  15585.   pasting to and from Clipboard%@BO:       36418@%
  15586.   width restriction of%@BO:       36c7b@%
  15587. Check box control%@BO:       2ce85@%
  15588. Choosing messages%@BO:       9173f@%
  15589. CL command%@BO:        d47a@%
  15590. CL Compiler
  15591.    %@AI@%see%@AE@% C Compiler%@NL@%
  15592. Clearing breakpoints%@BO:       68318@%
  15593. CODE statement%@BO:       10443@%
  15594. Code, instruction%@BO:       70d58@%
  15595. CodeView for Windows (CVW)
  15596.   application development option for%@BO:        e4df@%
  15597.   breakpoints
  15598.     examples of%@BO:       4eb51@%
  15599.     on lines, functions, and addresses%@BO:       4d518@%
  15600.     on values%@BO:       4dc9d@%
  15601.     on Windows messages%@BO:       4e3dd@%
  15602.     removing%@BO:       4db7b@%
  15603.   calling functions%@BO:       53033@%
  15604.   commands
  15605.     Help on CVW commands%@BO:       45dd2@%
  15606.     new, in CVW%@BO:       3c634@%
  15607.   compared with
  15608.     CodeView for DOS%@BO:       3bd6d@%
  15609.     SYMDEB%@BO:       3b583@%
  15610.   compiling source code for use with%@BO:       3dd3a@%
  15611.   continuous execution%@BO:       4cdbc@%
  15612.   controlling program execution%@BO:       4c7c3@%
  15613.   customizing%@BO:       5429c@%
  15614.   debugging multiple instances of an application%@BO:       3efa6@%
  15615.   described%@BO:       3a59b@%%@BO:       3a7d8@%
  15616.   display windows
  15617.     adjusting%@BO:       43926@%
  15618.     described%@BO:       428e6@%
  15619.     opening%@BO:       42f6b@%
  15620.     selecting%@BO:       431d7@%
  15621.     using multiple Source windows%@BO:       52e05@%
  15622.     using the mouse with%@BO:       43547@%
  15623.   displaying memory
  15624.     dereferencing memory handles%@BO:       4b27a@%
  15625.     in the Memory window%@BO:       49285@%
  15626.     live expressions%@BO:       4a975@%
  15627.     local and global memory objects%@BO:       4991d@%
  15628.     register contents%@BO:       4b92f@%
  15629.   displaying variables
  15630.     arrays and structures%@BO:       47303@%%@BO:       47989@%%@BO:       47b10@%%@BO:       484a7@%
  15631.     expressions%@BO:       46e5a@%
  15632.     single values%@BO:       462af@%%@BO:       46ce9@%
  15633.     summarized%@BO:       45f52@%
  15634.     using the Quick Watch command%@BO:       486ed@%
  15635.   ending%@BO:       5262a@%
  15636.   Help in CVW%@BO:       45e31@%
  15637.   interrupting a session%@BO:       5046b@%
  15638.   menus%@BO:       43dc6@%%@BO:       44911@%
  15639.   preparing Windows applications%@BO:       3e1c2@%
  15640.   recording session information%@BO:       4212e@%
  15641.   redirecting input and output%@BO:       53d9b@%
  15642.   register variables%@BO:       53a0a@%
  15643.   requirements for use%@BO:       3afe6@%
  15644.   restarting%@BO:       529f5@%
  15645.   secondary monitor, setting up%@BO:       3cb1a@%
  15646.   setting
  15647.     breakpoints%@BO:       4d037@%
  15648.   single-step execution
  15649.     described%@BO:       4ca33@%
  15650.     stepping%@BO:       4f8c0@%
  15651.     tracing%@BO:       4f9db@%
  15652.   starting a CVW session%@BO:       3e3ac@%
  15653.   tracing
  15654.     program execution. See single-step execution.%@BO:       4f9db@%
  15655.     Windows messages%@BO:       48bf9@%
  15656.   undefined pointers%@BO:       537a4@%
  15657.   values, changing
  15658.     for program data%@BO:       4c13d@%
  15659.     for variables, memory locations and registers%@BO:       4c6d5@%
  15660.   windows-specific features%@BO:       3c7a3@%
  15661. Colon (:), use of with doubleword values%@BO:       6d471@%
  15662. Colors
  15663.   and bitmaps%@BO:       23ddc@%
  15664.   dithered%@BO:       23a83@%
  15665.   inverse%@BO:       24532@%
  15666.   opaque%@BO:       24358@%
  15667.   screen%@BO:       24417@%
  15668.   true%@BO:       23d1a@%
  15669. Combo box control%@BO:       2d798@%
  15670. Comma (, ), as parameter separator%@BO:       13eba@%
  15671. Command arguments, SYMDEB%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  15672. Comparing bytes in memory locations%@BO:       69249@%
  15673. Compiler options
  15674.   memory-model%@BO:        d880@%
  15675.   recommended for
  15676.     dynamic-link libraries%@BO:        eff1@%
  15677.     Windows applications%@BO:        d2ab@%
  15678. CompilersC Compiler
  15679.    %@AI@%see%@AE@% Resource Compiler%@NL@%
  15680. CONTROL+C key%@BO:       5d71a@%
  15681. CONTROL+S%@AI@% key%@AE@%%@ACKC6A00080034 @%
  15682. Controls
  15683.   changing identifiers%@BO:       2eff5@%
  15684.   changing styles of%@BO:       2f18c@%
  15685.   changing text%@BO:       2f498@%
  15686.   custom%@BO:       29740@%%@BO:       29e79@%%@BO:       2dd86@%
  15687.   displaying information about%@BO:       2b6ca@%
  15688.   positions of%@BO:       2b6ca@%
  15689.   predefined identifiers%@BO:       29580@%
  15690.   symbolic names of%@BO:       28d60@%
  15691.   temporary%@BO:       29cc9@%
  15692. Copying
  15693.   dialog-box controls%@BO:       2f86d@%
  15694.   file or disk contents into memory%@BO:       6f07a@%
  15695. CPU registers, displaying contents of%@BO:       706ec@%
  15696. Creating
  15697.   cursor (.CUR) files%@BO:       227d7@%
  15698.   cursors%@BO:       227d7@%
  15699.   icon (.ICO) files%@BO:       2228f@%
  15700.   import libraries%@BO:       12f54@%
  15701.   map files%@BO:       57967@%
  15702.   module-definition (.DEF) files%@BO:        f971@%%@BO:       1020e@%%@BO:       11423@%%@BO:       116bc@%%@BO:       120e6@%%@BO:       12b53@%
  15703.   resource script (.RC) files%@BO:       17ccd@%%@BO:       18801@%
  15704.   symbol files%@BO:       57967@%
  15705.   Windows applications%@BO:        8d63@%
  15706. Curly braces ({ }), as document convention%@BO:        acc7@%
  15707. Cursor (.CUR) files
  15708.   and File menu%@BO:       20b17@%
  15709.   and Image menu%@BO:       20e65@%
  15710.   and SDKPAINT process%@BO:       1f5b2@%
  15711.   creating%@BO:       227d7@%
  15712.   described%@BO:       1fb2e@%
  15713.   working with colors%@BO:       24ae5@%
  15714. CURSOR resource statement%@BO:       18971@%
  15715. Cursor
  15716.    %@AI@%see also%@AE@% Cursor (.CUR) files%@NL@%
  15717.   creating%@BO:       2202a@%%@BO:       227d7@%
  15718.   cursor images, and creating icons%@BO:       25fdc@%
  15719.   defining%@BO:       24126@%
  15720.   displaying%@BO:       1fcfd@%%@BO:       2066e@%
  15721.   editing%@BO:       2400c@%
  15722.   hotspot%@BO:       215a1@%%@BO:       25ce4@%
  15723.   inverse colors with%@BO:       25061@%
  15724.   opaque color options%@BO:       24ae5@%
  15725.   screen colors with%@BO:       24c5c@%
  15726.   with clipboard%@BO:       262db@%
  15727.   with color%@BO:       24358@%
  15728. Custom control%@BO:       2dd86@%
  15729. Custom controls%@BO:       298e6@%%@BO:       29a0d@%
  15730.  
  15731. %@2@%%@AB@%    D%@AE@%%@EH@%%@NL@%
  15732. -D option%@BO:       1b3ff@%
  15733. DATA statement%@BO:       1057f@%
  15734. Debugging toolsCodeView for Windows (CVW) Spy
  15735.    %@AI@%see%@AE@% Symbolic Debugger (SYMDEB) %@NL@%
  15736. Debugging
  15737.   adding line-number information%@BO:        e4df@%
  15738.   entering into memory;ASCII strings%@BO:       6cd6d@%
  15739.   in protected mode. See CodeView for Windows(CVW)%@BO:       3a7d8@%
  15740.   in real mode. See Symbolic Debugger (SYMDEB)%@BO:       56efd@%
  15741. .DEF file
  15742.    %@AI@%see%@AE@% Module-definition (.DEF) files%@NL@%
  15743. Defining macros%@BO:       6f856@%
  15744. Deleting dialog-box controls%@BO:       2fae7@%
  15745. DESCRIPTION statement%@BO:       105dd@%
  15746. Dialog boxes
  15747.   adding group marker to%@BO:       3047c@%
  15748.   controls
  15749.     changing order of%@BO:       30bee@%
  15750.     editing%@BO:       2c648@%
  15751.     using custom%@BO:       29740@%%@BO:       29c08@%
  15752.   creating new%@BO:       27307@%%@BO:       2c648@%
  15753.   defining styles of%@BO:       312b9@%
  15754.   deleting group marker from%@BO:       3079f@%
  15755.   editing
  15756.     canceling edits%@BO:       31867@%
  15757.     include files%@BO:       31d78@%%@BO:       32622@%%@BO:       32b0a@%%@BO:       32e2b@%%@BO:       333e7@%%@BO:       336ec@%
  15758.     methods of%@BO:       2888a@%
  15759.   modifying%@BO:       27391@%
  15760.   moving between resources%@BO:       31976@%
  15761.   opening existing%@BO:       2c599@%
  15762.   renaming%@BO:       311b2@%
  15763.   resizing%@BO:       30fdb@%
  15764.   setting memory flags for%@BO:       3145b@%
  15765. Dialog Editor
  15766.   controls, groups of
  15767.     moving%@BO:       2eb4d@%%@BO:       2fdd3@%
  15768.     specifying%@BO:       3047c@%
  15769.   controls, order of%@BO:       30bee@%
  15770.   described%@BO:       27307@%
  15771.   dialog unit%@BO:       2bd04@%
  15772.   editing include files%@BO:       333e7@%
  15773.   group marker%@BO:       3047c@%
  15774.   mouse requirement for%@BO:       275d2@%
  15775.   opening
  15776.     dialog boxes%@BO:       2c486@%
  15777.     include files%@BO:       2c17f@%
  15778.     resource files%@BO:       2c027@%
  15779.   sizing handle%@BO:       2ec95@%
  15780.   tab stop for%@BO:       308aa@%
  15781.   toolbox
  15782.     described%@BO:       2b461@%
  15783.     enabling%@BO:       2e053@%
  15784.   using Clipboard format%@BO:       31c78@%
  15785.   window%@BO:       29fc4@%
  15786.   working with files
  15787.     dialog script%@BO:       276f4@%%@BO:       2824a@%
  15788.     include%@BO:       27baf@%%@BO:       28d60@%%@BO:       2c17f@%
  15789.     resource%@BO:       279d6@%%@BO:       2888a@%%@BO:       2bf48@%
  15790. Dialog script (.DLG) files%@BO:       276f4@%%@BO:       27d74@%
  15791. Dialog unit, described%@BO:       2bd04@%
  15792. Dialog-box controls
  15793.   adding
  15794.     custom%@BO:       2e4f4@%
  15795.     standard%@BO:       2df55@%
  15796.   custom%@BO:       2dd86@%
  15797.   defining symbolic names for%@BO:       32f69@%
  15798.   deleting%@BO:       2fae7@%
  15799.   duplicating%@BO:       2f86d@%
  15800.   identifiers for changing%@BO:       2eff5@%
  15801.   input focus
  15802.     specifying%@BO:       30125@%
  15803.     using tab stops%@BO:       308aa@%
  15804.   moving
  15805.     groups of%@BO:       2fdd3@%
  15806.     individual%@BO:       2e8fe@%
  15807.   resizing%@BO:       2ec95@%
  15808.   static text%@BO:       2d402@%
  15809.   styles, changing%@BO:       2f18c@%
  15810.   text, changing%@BO:       2f498@%
  15811.   types of
  15812.     check box%@BO:       2ce85@%
  15813.     combo box%@BO:       2d798@%
  15814.     edit%@BO:       2d2b0@%
  15815.     frame%@BO:       2d8de@%
  15816.     group box%@BO:       2d55b@%
  15817.     horizontal scroll bar%@BO:       2d0b0@%
  15818.     icon%@BO:       2db36@%
  15819.     list box%@BO:       2d67b@%
  15820.     push button%@BO:       2c94e@%
  15821.     radio button%@BO:       2cb88@%
  15822.     rectangle%@BO:       2dc2c@%
  15823.     vertical scroll bar%@BO:       2d0b0@%
  15824. Directives, resource%@BO:       18801@%
  15825. Disabling breakpoints%@BO:       6856c@%
  15826. Displaying
  15827.   ASCII characters within a given range%@BO:       697a5@%
  15828.   CPU registers, contents of%@BO:       7063f@%
  15829.   cursor hotspot%@BO:       215a1@%
  15830.   expression, value of%@BO:       72a06@%
  15831.   hexadecimal values
  15832.     of bytes in given range%@BO:       69a02@%
  15833.     of doublewords%@BO:       69cf0@%
  15834.     of words%@BO:       6c834@%
  15835.   instruction code%@BO:       70d58@%
  15836.   instructions, of program being debugged%@BO:       71320@%
  15837.   list of
  15838.     global free memory objects in global heap%@BO:       69f8b@%%@BO:       79d9d@%
  15839.     global memory objects in global heap%@BO:       6a1dc@%%@BO:       7a16b@%
  15840.     global modules in global heap%@BO:       6b378@%%@BO:       7b3aa@%
  15841.     local memory objects in local heap%@BO:       6acf2@%%@BO:       7af51@%
  15842.     LRU global memory objects%@BO:       6bf9f@%%@BO:       7bb7a@%
  15843.     SYMDEB commands and operators%@BO:       7277d@%
  15844.   long floating-point numbers%@BO:       6b124@%
  15845.   memory objects%@BO:       954b1@%
  15846.   memory, contents of%@BO:       694d4@%
  15847.   one byte from the input port%@BO:       6e67a@%
  15848.   short floating-point numbers%@BO:       6bb1f@%
  15849.   source line
  15850.     actual program%@BO:       711d9@%%@BO:       715cc@%
  15851.     current%@BO:       72b18@%
  15852.   stack frame
  15853.     current%@BO:       6e82d@%%@BO:       852ae@%%@BO:       85764@%
  15854.     for a specified task%@BO:       6eb8a@%%@BO:       85a9e@%
  15855.     stack location and frame-pointer values%@BO:       6eed8@%%@BO:       860a8@%
  15856.   statements, of program being debugged%@BO:       714f8@%
  15857.   sum and difference of two hexadecimal numbers%@BO:       6e50a@%
  15858.   symbol map information%@BO:       71bd1@%
  15859.   symbol maps%@BO:       5ddd1@%
  15860.   symbols%@BO:       5e808@%
  15861.   task-queue information%@BO:       6b6a7@%%@BO:       7b6ea@%
  15862.   ten-byte floating-point numbers%@BO:       6bd69@%
  15863.   variables%@BO:       5ffac@%
  15864. DLLs
  15865.    %@AI@%see%@AE@% Dynamic-link libraries%@NL@%
  15866. Document conventions%@BO:        9d83@%%@BO:        9ea9@%%@BO:        a149@%%@BO:        a21c@%%@BO:        a33c@%%@BO:        a57c@%%@BO:        a7d9@%%@BO:        a9f4@%%@BO:        ac17@%%@BO:        acc7@%%@BO:        adf2@%
  15867. Dollar sign ($), with commands%@BO:       65002@%
  15868. DOS commands
  15869.   CL%@BO:        d47a@%
  15870.   command processor%@BO:       733b5@%
  15871.   exit%@BO:       733b5@%
  15872.   mode%@BO:       59428@%
  15873.   RC%@BO:       1aa71@%
  15874. Double brackets ({{ }}), as document convention%@BO:        a75c@%
  15875. Doubleword values%@BO:       6d471@%
  15876. Dynamic-link Libraries (DLLs)
  15877.   custom control%@BO:       298e6@%
  15878. Dynamic-link libraries (DLLs)
  15879.   module-definition (.DEF) files, requirements%@BO:       120e6@%
  15880.   options for compiling%@BO:        eff1@%%@BO:        f4e1@%
  15881.   written in C language, requirements%@BO:        f19b@%
  15882.  
  15883. %@2@%%@AB@%    E%@AE@%%@EH@%%@NL@%
  15884. -E option%@BO:       1bc93@%
  15885. Echoing comment on output devices%@BO:       734c7@%
  15886. Edit control%@BO:       2d2b0@%
  15887. Editing
  15888.   canceling dialog box edits%@BO:       31867@%
  15889.   dialog box controls%@BO:       2c648@%
  15890.   dialog box%@BO:       27307@%
  15891.   include files%@BO:       333e7@%
  15892. Ellipses, as document convention
  15893.   horizontal%@BO:        a57c@%
  15894.   vertical%@BO:        a33c@%
  15895. EMS (Expanded Memory Specification)
  15896.   defined%@BO:       9350c@%
  15897.   walking%@BO:       94f7f@%
  15898. Enabling breakpoints%@BO:       687bb@%
  15899. Enabling toolbox%@BO:       2e053@%
  15900. Epilog (Windows)%@BO:        f19b@%
  15901. Executable files%@BO:       1740b@%
  15902. Executing
  15903.   instructions%@BO:       70163@%%@BO:       711d9@%
  15904.   macros%@BO:       6f856@%
  15905. Execution control%@BO:       6e423@%%@BO:       703e5@%%@BO:       711d9@%%@BO:       733b5@%
  15906. EXETYPE statement%@BO:       106b4@%
  15907. EXETYPE WINDOWS statement%@BO:       11818@%%@BO:       1245f@%
  15908. Expanded Memory Specification
  15909.    %@AI@%see%@AE@% EMS%@NL@%
  15910. Exported function%@BO:        f19b@%
  15911. EXPORTS statement%@BO:       1090d@%%@BO:       12363@%
  15912. Expressions
  15913.   displaying value of%@BO:       72a06@%
  15914.   SYMDEB commands%@BO:       665df@%
  15915.  
  15916. %@2@%%@AB@%    F%@AE@%%@EH@%%@NL@%
  15917. Fatal exit message%@BO:       60d2e@%
  15918. -Fe option%@BO:       1b499@%
  15919. File headers, executable%@BO:       1740b@%
  15920. Filenames, setting for load and write commands%@BO:       6fbd9@%
  15921. Files
  15922.   dialog script (.DLG)%@BO:       276f4@%%@BO:       27d74@%
  15923.   executable file headers%@BO:       1740b@%
  15924.   icon (.ICO)%@BO:       1f5b2@%%@BO:       1fb2e@%%@BO:       20b17@%%@BO:       20e65@%%@BO:       2228f@%%@BO:       24a7e@%
  15925.   include (.H)%@BO:       27baf@%%@BO:       28d60@%
  15926.   loading%@BO:       6f55b@%
  15927.   module-definition (.DEF)%@BO:       1027c@%
  15928.   resource (.R)%@BO:       279d6@%%@BO:       2888a@%
  15929.   resource script (.RC)%@BO:       17ccd@%%@BO:       27307@%
  15930.   symbol%@BO:       57720@%
  15931. Filling addresses in a given range%@BO:       6df29@%
  15932. Floating-point numbers%@BO:       6b25b@%%@BO:       6bc57@%%@BO:       6bd69@%
  15933. Floating-point values%@BO:       6d73d@%%@BO:       6d9b8@%
  15934. -Fo option%@BO:       1b440@%%@BO:       1dc08@%
  15935. Font Editor
  15936.   adding
  15937.     columns to a character%@BO:       3545c@%
  15938.     rows to a character%@BO:       3545c@%
  15939.   canceling changes%@BO:       370c8@%
  15940.   changing
  15941.     character pixels%@BO:       351b8@%
  15942.     character width%@BO:       366c8@%%@BO:       374f5@%
  15943.     font file header information%@BO:       3827f@%
  15944.   character information display%@BO:       34b21@%
  15945.   character window
  15946.     clearing%@BO:       3649b@%
  15947.     described%@BO:       347ee@%
  15948.   character-viewing window%@BO:       34a3b@%
  15949.   Clipboard characters, using%@BO:       36418@%
  15950.   deleting
  15951.     columns from characters%@BO:       35ae1@%
  15952.     rows from characters%@BO:       35ae1@%
  15953.   described%@BO:       33eeb@%
  15954.   editing
  15955.     blocks of pixels%@BO:       35d6a@%
  15956.     characters%@BO:       34ddc@%%@BO:       3562a@%%@BO:       35ae1@%
  15957.   fixed-pitch font%@BO:       37dcc@%
  15958.   Font Editor window%@BO:       345ed@%
  15959.   font family names%@BO:       39720@%
  15960.   font window%@BO:       34bfd@%
  15961.   mouse requirement for%@BO:       3420f@%
  15962.   opening fonts%@BO:       343a3@%
  15963.   resizing fonts%@BO:       374f5@%
  15964.   variable-pitch font%@BO:       37dcc@%
  15965.   window%@BO:       345ed@%
  15966. Font EditorFonts
  15967.    %@AI@%see also%@AE@% Pixels%@NL@%
  15968. Font file header, editing%@BO:       3827f@%
  15969. FONT resource statement%@BO:       18971@%
  15970. Fonts
  15971.   break character of%@BO:       391a6@%
  15972.   canceling changes to%@BO:       36dc2@%%@BO:       370c8@%
  15973.   copyright of%@BO:       385ce@%
  15974.   creating%@BO:       33f1e@%%@BO:       345ed@%%@BO:       34ddc@%%@BO:       351b8@%%@BO:       3545c@%%@BO:       3562a@%%@BO:       36418@%%@BO:       36814@%%@BO:       36c7b@%
  15975.   default character of%@BO:       38fda@%
  15976.   editing%@BO:       374f5@%%@BO:       37a44@%%@BO:       38136@%%@BO:       38fda@%
  15977.   face name of%@BO:       3847c@%
  15978.   filename of%@BO:       384d9@%
  15979.   first character of%@BO:       37a44@%
  15980.   font character set%@BO:       39526@%
  15981.   font face name %@AI@%vs%@AE@%. filename%@BO:       3827f@%
  15982.   font families%@BO:       39720@%
  15983.   font file header%@BO:       3827f@%%@BO:       38fda@%
  15984.   height of
  15985.     ascent%@BO:       387f8@%
  15986.     character pixel%@BO:       3768f@%
  15987.   height%@BO:       374f5@%
  15988.   last character of%@BO:       37cd0@%
  15989.   leading of
  15990.     external%@BO:       38bbe@%
  15991.     internal%@BO:       38e08@%
  15992.   nominal point size of%@BO:       386b1@%
  15993.   nominal resolution of
  15994.     horizontal%@BO:       38930@%
  15995.     vertical%@BO:       38894@%
  15996.   opening, in Font Editor%@BO:       343a3@%
  15997.   options
  15998.     strikeout%@BO:       39c2a@%
  15999.     underline%@BO:       39b41@%
  16000.   pitches of%@BO:       37dcc@%
  16001.   saving changes to%@BO:       36dc2@%
  16002.   types of
  16003.     fixed-pitch%@BO:       37dcc@%
  16004.     raster%@BO:       3412b@%
  16005.     variable-pitch%@BO:       36b2e@%%@BO:       37dcc@%
  16006.     vector%@BO:       3412b@%
  16007.   weights of%@BO:       38136@%
  16008.   width of
  16009.     fixed-pitch%@BO:       3788d@%
  16010.     variable-pitch%@BO:       37768@%
  16011. Frame control%@BO:       2d8de@%
  16012. Functions
  16013.   callback%@BO:        f19b@%
  16014.   exported%@BO:        f19b@%%@BO:       1740b@%
  16015.   imported%@BO:       1740b@%
  16016.   WinMain%@BO:       5fb2e@%
  16017.  
  16018. %@2@%%@AB@%    G%@AE@%%@EH@%%@NL@%
  16019. GDI library, symbol files%@BO:       5c8bb@%
  16020. Global heap
  16021.   allocating memory to examine%@BO:       96391@%
  16022.   defining displayed objects%@BO:       954b1@%
  16023.   displaying lists of
  16024.     free global memory objects in%@BO:       69f8b@%%@BO:       79d9d@%
  16025.     global memory objects in%@BO:       6a26e@%%@BO:       7a411@%
  16026.     global modules in%@BO:       6b40d@%%@BO:       7b44b@%
  16027.     LRU global memory objects in%@BO:       6bf9f@%%@BO:       7bb7a@%
  16028.   protected mode%@BO:       93249@%
  16029.   real mode%@BO:       9334b@%%@BO:       9350c@%
  16030.   saving lists of objects on%@BO:       93ca8@%
  16031.   sorting displayed objects%@BO:       9510c@%
  16032.   total size of examined objects%@BO:       96d66@%
  16033.   viewing%@BO:       92ee7@%
  16034.   walking EMS%@BO:       94f7f@%
  16035.   walking%@BO:       942e4@%
  16036. Group box control%@BO:       2d55b@%
  16037. Group marker
  16038.   adding%@BO:       3047c@%
  16039.   deleting%@BO:       3079f@%
  16040.  
  16041. %@2@%%@AB@%    H%@AE@%%@EH@%%@NL@%
  16042. .H file
  16043.    %@AI@%see%@AE@% Include (.H) files%@NL@%
  16044. -H option%@BO:       1cab1@%
  16045. Heap Walker
  16046.   allocating memory examined by%@BO:       96391@%
  16047.   defining objects displayed by%@BO:       954b1@%
  16048.   described%@BO:       92ee7@%
  16049.   displaying selected objects%@BO:       942e4@%
  16050.   file operation commands%@BO:       93ca8@%
  16051.   information displayed by%@BO:       937b4@%
  16052.   memory allocation commands%@BO:       96391@%
  16053.   memory object commands%@BO:       954b1@%
  16054.   saving object lists%@BO:       93ca8@%
  16055.   sorting displayed objects%@BO:       9510c@%
  16056.   total size of objects examined by%@BO:       96d66@%
  16057.   window%@BO:       935fc@%
  16058. HEAPSIZE statement%@BO:       10a02@%
  16059. Height, font%@BO:       374f5@%
  16060. Help compiler%@BO:       b925a@%%@BO:       b94a7@%%@BO:       b9bc7@%%@BO:       b9f26@%
  16061. Help graphics%@BO:       a7d98@%%@BO:       a80ed@%
  16062.   bitmaps
  16063.     creating, capturing%@BO:       afa51@%%@BO:       afef6@%
  16064.     placing%@BO:       b015f@%%@BO:       b07e0@%
  16065. Help Project file
  16066.   accessing from an application%@BO:       ba165@%
  16067.   Alias section%@BO:       b7686@%%@BO:       b7e0b@%
  16068.   Bitmaps section%@BO:       b8edd@%
  16069.   bitmaps, including by reference%@BO:       b8edd@%
  16070.   Build option%@BO:       b4374@%%@BO:       b4914@%%@BO:       b4d2b@%
  16071.   Build Tags section%@BO:       b30d8@%%@BO:       b33f2@%
  16072.   compiling%@BO:       b925a@%%@BO:       b94a7@%%@BO:       b9bc7@%%@BO:       b9f26@%
  16073.   Compress option%@BO:       b6fd6@%%@BO:       b749c@%
  16074.   context strings, alternate%@BO:       b7686@%%@BO:       b7e0b@%
  16075.   context-sensitive Help%@BO:       bb44e@%%@BO:       bb6be@%%@BO:       bbeba@%%@BO:       bc93d@%%@BO:       bd31c@%
  16076.   context-sensitive topics%@BO:       b8066@%%@BO:       b83f2@%%@BO:       b8838@%%@BO:       b8d83@%
  16077.   creating%@BO:       b2104@%%@BO:       b2789@%
  16078.   F1 support%@BO:       bc743@%%@BO:       bc93d@%%@BO:       bd31c@%
  16079.   Files section%@BO:       b2a9d@%
  16080.   Forcefont option%@BO:       b5be0@%%@BO:       b5fc4@%
  16081.   Index option%@BO:       b53c5@%%@BO:       b5728@%
  16082.   keyword table, accessing%@BO:       bd863@%
  16083.   Map section%@BO:       b8066@%%@BO:       b83f2@%%@BO:       b8838@%%@BO:       b8d83@%
  16084.   Mapfontsize option%@BO:       b6270@%%@BO:       b6860@%
  16085.   Multikey option%@BO:       b6943@%%@BO:       b6e5c@%
  16086.   on Help menu item%@BO:       bd4c5@%
  16087.   Options section%@BO:       b34d0@%%@BO:       b3afd@%
  16088.   Root option%@BO:       b4e46@%%@BO:       b51ec@%
  16089.   Title option%@BO:       b58b3@%
  16090.   Warning option%@BO:       b3c0e@%%@BO:       b41a1@%
  16091. Help system
  16092.    %@AI@%see also%@AE@% Help%@NL@%
  16093.   appearance to programmer%@BO:       a2f58@%
  16094.   appearance to user%@BO:       a25a6@%%@BO:       a28df@%
  16095.   appearance to writer%@BO:       a2b20@%%@BO:       a2dc6@%
  16096.   calling WinHelp%@BO:       ba25c@%%@BO:       ba546@%%@BO:       baaf7@%%@BO:       bb292@%
  16097.   development cycle described%@BO:       a1fa6@%%@BO:       a2528@%
  16098.   graphics. See Help graphics%@BO:       a7d98@%
  16099.   hypertext links summarized%@BO:       a30e9@%
  16100.   topics. See Help topics%@BO:       a3e4c@%
  16101. Help text
  16102.   fonts%@BO:       a789e@%%@BO:       a7b0c@%
  16103.   layout%@BO:       a62a3@%%@BO:       a6946@%%@BO:       a75c7@%
  16104. Help tools
  16105.    %@AI@%see%@AE@% Help%@NL@%
  16106. Help topic files
  16107.   authoring tool%@BO:       a8de2@%
  16108.   browse sequence numbers%@BO:       ad2cd@%%@BO:       ad76f@%%@BO:       adeac@%%@BO:       ae30f@%%@BO:       ae5a0@%
  16109.   build tags%@BO:       aa061@%%@BO:       aa40f@%%@BO:       aac72@%
  16110.   context strings%@BO:       aad89@%%@BO:       ab534@%
  16111.   control codes%@BO:       a9473@%
  16112.   cross references%@BO:       ae89a@%
  16113.   definitions%@BO:       aed21@%%@BO:       af31b@%
  16114.   graphics%@BO:       af875@%
  16115.   jumps%@BO:       ae89a@%
  16116.   key words%@BO:       abf56@%%@BO:       ac475@%%@BO:       ac8aa@%%@BO:       ad012@%
  16117.   managing%@BO:       b0f06@%
  16118.   title footnotes%@BO:       ab5a0@%%@BO:       ab7e6@%%@BO:       abd31@%
  16119.   tracking%@BO:       b0fa7@%%@BO:       b19a0@%
  16120. Help topics
  16121.   content%@BO:       a3e4c@%
  16122.   context-sensitivity%@BO:       a4eef@%%@BO:       a50dd@%%@BO:       a55c7@%%@BO:       a56e1@%
  16123.   cross-references%@BO:       ae7ad@%
  16124.   definitions%@BO:       aed21@%%@BO:       af31b@%
  16125.   file structure%@BO:       a5899@%%@BO:       a5b64@%%@BO:       a5e93@%
  16126.   files. See Help topic files%@BO:       a90b5@%
  16127.   jumps%@BO:       ae89a@%
  16128.   structure of%@BO:       a441b@%%@BO:       a4d25@%
  16129.   text. See Help text%@BO:       a62a3@%
  16130. Help Tracker%@BO:       b1409@%%@BO:       b19a0@%
  16131. Help
  16132.   audience definition%@BO:       a38dc@%%@BO:       a3d79@%
  16133.   cancelling%@BO:       be237@%%@BO:       be7ae@%
  16134.   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@%
  16135.   context-sensitive%@BO:       a4eef@%%@BO:       a50dd@%%@BO:       a55c7@%%@BO:       a56e1@%%@BO:       bb44e@%%@BO:       bb6be@%%@BO:       bbeba@%%@BO:       bc93d@%%@BO:       bd31c@%
  16136.   control codes%@BO:       a9473@%
  16137.   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@%
  16138.   F1 support%@BO:       bc743@%%@BO:       bc93d@%%@BO:       bd31c@%
  16139.   file structure%@BO:       a5899@%%@BO:       a5b64@%%@BO:       a5e93@%
  16140.   file. See Help Project file%@BO:       b1d92@%
  16141.   key words%@BO:       abf56@%%@BO:       ac475@%%@BO:       ac8aa@%%@BO:       ad012@%
  16142.   keyword table, accessing%@BO:       bd863@%
  16143.   on Help menu item%@BO:       bd4c5@%
  16144.   planning
  16145.     overview%@BO:       a3601@%
  16146.   topic files
  16147.     examples%@BO:       bef1b@%
  16148.     links summarized%@BO:       a3284@%
  16149. Hexadecimal values
  16150.   of bytes in the given range%@BO:       69a02@%
  16151.   of double words%@BO:       69cf0@%
  16152.   of floating-point numbers in the given range%@BO:       6b25b@%%@BO:       6bc57@%
  16153.   of words in the given range%@BO:       6c929@%
  16154. Hits, defined%@BO:       9e0b0@%
  16155. Hotspot, cursor
  16156.   defining%@BO:       25ce4@%
  16157.   displaying%@BO:       215a1@%
  16158. Hyphen (-), as SYMDEB option designator%@BO:       5c450@%
  16159.  
  16160. %@2@%%@AB@%    I%@AE@%%@EH@%%@NL@%
  16161. -I option%@BO:       1b593@%%@BO:       1df17@%%@BO:       1e3bf@%
  16162. Icon (.ICO) files
  16163.   and File menu%@BO:       20b17@%
  16164.   and Image menu%@BO:       20e65@%
  16165.   and SDKPAINT process%@BO:       1f5b2@%
  16166.   creating%@BO:       2228f@%
  16167.   described%@BO:       1fb2e@%
  16168.   working with colors%@BO:       24a7e@%
  16169. Icon control%@BO:       2db94@%
  16170. ICON resource statement%@BO:       18971@%
  16171. Icons
  16172.    %@AI@%see also%@AE@% Icon (.ICO) files%@NL@%
  16173.   colors with%@BO:       23a83@%
  16174.   creating, with cursor images%@BO:       25fdc@%
  16175.   editing colors for%@BO:       2549c@%
  16176.   editing%@BO:       23f19@%
  16177.   inverse colors with%@BO:       25061@%
  16178.   opaque color options%@BO:       24a7e@%
  16179.   screen colors with%@BO:       24c5c@%
  16180. Identifiers, dialog-box control%@BO:       2eff5@%
  16181. Immediate breakpoint%@BO:       5d4d8@%
  16182. IMPLIB utility%@BO:       12b53@%
  16183. IMPORTS statement%@BO:       10cba@%%@BO:       12b53@%
  16184. Include (.H) files
  16185.   creating%@BO:       32622@%
  16186.   editing%@BO:       32e2b@%%@BO:       333e7@%
  16187.   loading%@BO:       32b0a@%
  16188.   saving%@BO:       336ec@%
  16189.   working with%@BO:       28c34@%
  16190. Input focus, dialog-box control%@BO:       30125@%
  16191. Input port%@BO:       6e67a@%
  16192. Input, redirecting input commands%@BO:       72c3a@%
  16193. Instruction code, displaying%@BO:       70d58@%
  16194. Interrupt key%@BO:       5fd0f@%
  16195. %@AI@%Italic text%@AE@%, as document convention%@BO:        a149@%
  16196.  
  16197. %@2@%%@AB@%    K%@AE@%%@EH@%%@NL@%
  16198. -K option%@BO:       1c1c9@%
  16199. Kernel library, symbol files%@BO:       5c8bb@%
  16200. Keys
  16201.   CONTROL+C%@BO:       5d71a@%
  16202.   CONTROL+S%@AI@%%@AE@%%@ACKC6A00080033 @%
  16203.   SCROLL LOCK%@BO:       5d36a@%
  16204.   SYS REQ%@BO:       5d4d8@%
  16205.  
  16206. %@2@%%@AB@%    L%@AE@%%@EH@%%@NL@%
  16207. -L option%@BO:       1b8a2@%
  16208. Leading%@BO:       38bbe@%%@BO:       38e08@%
  16209. LIBRARY statement%@BO:       10d94@%%@BO:       121cc@%
  16210. Library symbol files%@BO:       5c8b9@%%@BO:       5c8ba@%%@BO:       5c8bb@%
  16211. -LIM 32 option%@BO:       1b900@%
  16212. Linker
  16213.   command options
  16214.     described%@BO:       143a0@%%@BO:       14f7a@%%@BO:       159eb@%%@BO:       15f3f@%
  16215.     not allowed%@BO:       1622b@%
  16216.     not recommended%@BO:       1622b@%
  16217.   creating import libraries%@BO:       12f54@%
  16218.   LINK command, using%@BO:       1388e@%
  16219.   linking
  16220.     applications files%@BO:       1383a@%
  16221.     dynamic-link libraries%@BO:        f836@%%@BO:       120e6@%%@BO:       1253d@%%@BO:       1274b@%%@BO:       12f54@%
  16222.     module-definition (.DEF) files%@BO:        f836@%
  16223.     source files%@BO:        f836@%
  16224.     Windows applications%@BO:       13611@%
  16225.   module-definition (.DEF) files
  16226.     creating for applications%@BO:       11423@%%@BO:       116bc@%
  16227.     creating for libraries%@BO:       116bc@%%@BO:       120e6@%%@BO:       12b53@%
  16228.     importing dynamic-link libraries%@BO:       12cf6@%
  16229.     module statements%@BO:       1027c@%%@BO:       116bc@%
  16230.     requirements for creating%@BO:        f971@%
  16231. Linking
  16232.    %@AI@%see%@AE@% Linker%@NL@%
  16233. List box control%@BO:       2d67b@%
  16234. Listing breakpoint information%@BO:       68a2d@%
  16235. Loading
  16236.   files%@BO:       6f55b@%
  16237.   logical records%@BO:       6f55b@%
  16238. Local heap%@BO:       6ae1e@%%@BO:       7b087@%
  16239. Logical records, loading%@BO:       6f55b@%
  16240.  
  16241. %@2@%%@AB@%    M%@AE@%%@EH@%%@NL@%
  16242. -M option%@BO:       1bb66@%
  16243. Macro
  16244.   defining%@BO:       6f856@%
  16245.   executing%@BO:       6f856@%
  16246. Managing output%@BO:       9b123@%
  16247. Map files%@BO:       13d33@%%@BO:       57967@%%@BO:       57d29@%
  16248. Maps
  16249.    %@AI@%see%@AE@% Symbol maps%@NL@%
  16250. MAPSYM program
  16251.   creating symbol files%@BO:       57967@%
  16252.   sample symbol file%@BO:       58a25@%%@BO:       58f4a@%
  16253. MASM assembler%@BO:        923d@%
  16254. Math coprocessor/emulator, with Windows%@BO:       170d8@%
  16255. Memory flags, setting dialog box%@BO:       3145b@%
  16256. Memory models%@BO:        dab7@%%@BO:       16751@%
  16257. Memory
  16258.   comparing bytes in memory locations%@BO:       69249@%
  16259.   copying file or disk contents into%@BO:       6f07a@%
  16260.   determining size%@BO:       96d66@%
  16261.   displaying contents of within a given range%@BO:       694d4@%
  16262.   entering
  16263.     ASCII strings into%@BO:       6cd6d@%
  16264.     byte values into%@BO:       6cfce@%
  16265.     doubleword values into%@BO:       6d2ca@%
  16266.     long floating-point values into%@BO:       6d596@%
  16267.     short floating-point values into%@BO:       6d80d@%
  16268.     ten-byte real values into%@BO:       6da8b@%
  16269.     values into%@BO:       6ca11@%
  16270.     word values into%@BO:       6dcf7@%
  16271.   moving blocks of%@BO:       6f67b@%
  16272.   testing movable%@BO:       97ad6@%
  16273. Menu bar%@BO:       2a027@%
  16274. Messages
  16275.   choosing%@BO:       9173f@%
  16276.   fatal-exit%@BO:       60d2e@%
  16277.   information Spy monitors%@BO:       9173f@%
  16278.   memory-allocation%@BO:       5f1e5@%
  16279.   monitoring%@BO:       908ec@%%@BO:       9173f@%
  16280. Microsoft QuickC%@BO:        c0a9@%%@BO:        f971@%
  16281. Mnemonics, instruction%@BO:       67323@%
  16282. Mode display%@BO:       2b2e1@%
  16283. Module statements
  16284.    %@AI@%see%@AE@% Module-definition (.DEF) files%@NL@%
  16285. Module-definition ( DEF) files
  16286.   for applications
  16287.     described%@BO:       11818@%
  16288. Module-definition (.DEF) files
  16289.   creating%@BO:       1020e@%%@BO:       11423@%%@BO:       120e6@%%@BO:       12b53@%
  16290.   described%@BO:        9191@%%@BO:       1020e@%
  16291.   for applications
  16292.     described%@BO:       11423@%
  16293.     sample file%@BO:       11817@%%@BO:       11818@%%@BO:       12013@%
  16294.   for dynamic-link libraries
  16295.     described%@BO:       120e6@%
  16296.     sample file%@BO:       1253d@%
  16297.   linking applications%@BO:       13e65@%
  16298.   module statements
  16299.     list%@BO:       1027c@%
  16300.     required%@BO:       116bc@%
  16301. Monitor, secondary, for debugging%@BO:       5975f@%
  16302. %@AS@%Monospaced type%@AE@%, as document convention%@BO:        a21c@%
  16303. Moving blocks of memory%@BO:       6f67b@%
  16304. MS-DOS
  16305.    %@AI@%see%@AE@% DOS commands%@NL@%
  16306.  
  16307. %@2@%%@AB@%    N%@AE@%%@EH@%%@NL@%
  16308. NAME statement%@BO:       10e36@%%@BO:       11818@%
  16309. Naming
  16310.   modules%@BO:       11818@%
  16311.   symbol files%@BO:       5ca2f@%%@BO:       5db90@%
  16312. Non-maskable interrupts%@BO:       5b5ec@%
  16313. Notational conventions%@BO:        98c4@%%@BO:        adf2@%
  16314.  
  16315. %@2@%%@AB@%    O%@AE@%%@EH@%%@NL@%
  16316. OEM character set%@BO:       39526@%
  16317. Oil can%@BO:       22c80@%
  16318. Optimization toolsHeap Walker Profiler Shaker
  16319.    %@AI@%see%@AE@% Swap%@NL@%
  16320. Options
  16321.   compiler
  16322.     application development%@BO:        e2b2@%%@BO:        eab9@%
  16323.     dynamic-link library%@BO:        eb88@%%@BO:        f4e1@%
  16324.     memory-model%@BO:        d880@%%@BO:        e148@%
  16325.   LINK command
  16326.     described%@BO:       143a0@%%@BO:       14f7a@%%@BO:       159eb@%%@BO:       15f3f@%
  16327.     options not allowed%@BO:       1622b@%
  16328.     options not recommended%@BO:       16333@%
  16329.   option designator%@BO:       5c450@%
  16330.   RC command line%@BO:       1d234@%
  16331.   Resource Compiler (table)%@BO:       1b0fa@%
  16332.   SYMDEB%@BO:       5a414@%%@BO:       5ab08@%%@BO:       5ba4a@%
  16333. Output device, choosing (Spy)%@BO:       9173f@%
  16334. Output port
  16335.   sending bytes to%@BO:       6ffbd@%
  16336. Output
  16337.   redirecting output commands%@BO:       72e3c@%
  16338.   suspending and restoring%@BO:       5d36a@%
  16339.  
  16340. %@2@%%@AB@%    P%@AE@%%@EH@%%@NL@%
  16341. -P option%@BO:       1bf68@%
  16342. Packed structure%@BO:        d2ab@%
  16343. Paintbrush%@BO:       22c80@%
  16344. Parentheses ( ), as document convention%@BO:        9ea9@%
  16345. PC-DOS
  16346.    %@AI@%see%@AE@% DOS commands%@NL@%
  16347. Period (.), as ASCII value%@BO:       69bfd@%
  16348. Pixels
  16349.   adding rows or columns of%@BO:       3562a@%
  16350.   changing character%@BO:       351b8@%
  16351.   copying to Clipboard%@BO:       36418@%
  16352.   deleting rows or columns of%@BO:       35ae1@%
  16353.   pasting from Clipboard%@BO:       36418@%
  16354.   selecting and changing blocks of%@BO:       35d6a@%
  16355. Plus sign (+), as filename separator%@BO:       13bd5@%
  16356. Preprocessor, defining names for%@BO:       1d44f@%
  16357. PROF.COM program%@BO:       9c31d@%
  16358. Profiler
  16359.   checking if installed%@BO:       9a5ec@%
  16360.   described%@BO:       988c3@%%@BO:       99128@%
  16361.   displaying samples%@BO:       9e0b0@%
  16362.   ensuring compatibility with your system%@BO:       99839@%
  16363.   functions%@BO:       99a5d@%%@BO:       99f55@%%@BO:       9a5ec@%%@BO:       9b123@%%@BO:       9bd38@%
  16364.   managing output (example)%@BO:       9baa9@%
  16365.   sampling
  16366.     real-mode Windows applications%@BO:       9c31d@%%@BO:       9cf0e@%
  16367.     setting rate of%@BO:       9a7eb@%
  16368.     starting and stopping%@BO:       99f55@%
  16369.     Windows 386 enhanced mode applications%@BO:       9c433@%%@BO:       9d187@%
  16370.   starting and stopping%@BO:       9bd38@%
  16371. Program descriptor block (pdb)%@BO:       6a852@%%@BO:       6b878@%%@BO:       6c631@%%@BO:       6eb8a@%%@BO:       7aaa9@%%@BO:       7b8cb@%%@BO:       7c2d6@%%@BO:       85a9e@%
  16372. Program execution%@BO:       703e5@%%@BO:       711d9@%%@BO:       733b5@%
  16373. Program input and output, redirecting%@BO:       72c3a@%
  16374. Programming tools
  16375.    %@AI@%see%@AE@% Tools%@NL@%
  16376. Programs
  16377.   CL%@BO:        c0a9@%
  16378.   RC%@BO:       1a75b@%
  16379.   setting arguments for program execution%@BO:       6fbd9@%
  16380. Prolog (Windows)%@BO:        f19b@%
  16381. Protected mode
  16382.   debugging in. See CodeView for Windows(CVW)%@BO:       3a7d8@%
  16383. Public symbols%@BO:       58d23@%
  16384. Push button control%@BO:       2c94e@%
  16385.  
  16386. %@2@%%@AB@%    Q%@AE@%%@EH@%%@NL@%
  16387. Question mark (?), with commands%@BO:       64f19@%%@BO:       71e51@%
  16388. Quitting SYMDEB%@BO:       60a35@%
  16389. Quotation marks (" "), as document convention%@BO:        ac17@%
  16390.  
  16391. %@2@%%@AB@%    R%@AE@%%@EH@%%@NL@%
  16392. -R option%@BO:       1b18c@%%@BO:       1d352@%
  16393. Radio button control%@BO:       2cb88@%
  16394. Raster fonts%@BO:       3412b@%
  16395. RC command%@BO:       1cdc6@%
  16396. RC Compiler
  16397.   described%@BO:       1a75b@%
  16398. RC compiler
  16399.   options (table)%@BO:       1b0fa@%
  16400. .RC file
  16401.    %@AI@%see%@AE@% Resource script (.RC) files%@NL@%
  16402. Real mode
  16403.   debugging in. See Symbolic Debugger (SYMDEB)%@BO:       56efd@%
  16404. Real-mode Windows applications%@BO:       99128@%%@BO:       99500@%%@BO:       99c88@%%@BO:       9aed0@%%@BO:       9c31d@%
  16405. REC command%@BO:       1aa71@%
  16406. Rectangle control%@BO:       2dc2c@%
  16407. Redirecting program input and output%@BO:       72c3a@%%@BO:       73023@%
  16408. Registers, CPU, displaying contents of%@BO:       706ec@%
  16409. Reporting utility%@BO:       991f6@%%@BO:       9d56d@%
  16410. .RES file
  16411.    %@AI@%see%@AE@% Resource (.RES) files%@NL@%
  16412. Resource (.RES) files%@BO:       1f5b2@%%@BO:       2864e@%
  16413. Resource Compiler
  16414.   described%@BO:       1a75b@%
  16415.   RC command line options%@BO:       1d234@%
  16416. Resource directives%@BO:       18801@%
  16417. Resource editorsDialog Editor Font Editor
  16418.    %@AI@%see%@AE@% SDKPaint%@NL@%
  16419. Resource script (.RC) files
  16420.   .RC extension%@BO:       183d6@%
  16421.   and Dialog Editor%@BO:       2824a@%
  16422.   creating%@BO:       17ccd@%%@BO:       18801@%
  16423.   described%@BO:        908f@%%@BO:       17ccd@%%@BO:       18801@%
  16424.   for applications%@BO:       1a4b3@%
  16425.   resource statements%@BO:       18801@%%@BO:       18971@%
  16426. Resource statements
  16427.    %@AI@%see%@AE@% Resource script (.RC) files%@NL@%
  16428. Resources
  16429.   defining%@BO:       17ccd@%
  16430.   dialog box%@BO:       27307@%
  16431.  
  16432. %@2@%%@AB@%    S%@AE@%%@EH@%%@NL@%
  16433. Sampling
  16434.   buffer%@BO:       99f55@%
  16435.   displaying samples%@BO:       9d56d@%%@BO:       9e0b0@%
  16436.   minimizing loss when sampling buffer fills%@BO:       9c31d@%
  16437.   real-mode Windows applications%@BO:       9c31d@%%@BO:       9cf0e@%
  16438.   setting rate of code%@BO:       9a7eb@%
  16439.   standard-mode Windows applications%@BO:       9cf0e@%
  16440.   starting and stopping%@BO:       99f55@%
  16441.   utilities for%@BO:       99128@%%@BO:       9c31d@%%@BO:       9d187@%
  16442.   Windows 386 enhanced mode applications%@BO:       9c433@%%@BO:       9d116@%
  16443. Scroll bar control%@BO:       2d0b0@%
  16444. SCROLL LOCK key%@BO:       5d36a@%
  16445. SDKPaint
  16446.   .DAT file, described%@BO:       1fcfd@%
  16447.   color palette, described%@BO:       23ddc@%%@BO:       2400c@%
  16448.   converting files%@BO:       217cf@%
  16449.   cursor hotspot
  16450.     defining%@BO:       25ce4@%
  16451.     showing the current%@BO:       25ce4@%
  16452.   described%@BO:       1f1f6@%
  16453.   loading images into%@BO:       229f2@%
  16454.   menu commands (list)%@BO:       20847@%%@BO:       20e65@%
  16455.   tools, described (table)%@BO:       22c80@%
  16456.   transferring images to and from clipboard%@BO:       25f18@%
  16457.   window, described%@BO:       2075c@%
  16458.   working with colors
  16459.     customizing the color palette%@BO:       252ba@%
  16460.     editing colors%@BO:       2549c@%
  16461.     inverse colors%@BO:       25061@%
  16462.     loading a customized palette%@BO:       25a14@%
  16463.     opaque colors%@BO:       248c0@%
  16464.     saving a palette%@BO:       25850@%
  16465.     screen colors%@BO:       24c5c@%
  16466.     true colors%@BO:       23d1a@%
  16467.     types of%@BO:       23a83@%%@BO:       24358@%
  16468. Secondary monitor, setting up for debugging%@BO:       5975f@%
  16469. SEGMENTS statement%@BO:       10ee4@%
  16470. Selected Item Status window%@BO:       2b6ca@%
  16471. Semicolon (
  16472.   ), in SYMDEB command list%@BO:       5c31d@%
  16473. Serial port%@BO:       59210@%
  16474. Setting
  16475.   active symbol maps and/or segments%@BO:       72360@%
  16476.   breakpoint address%@BO:       678e5@%
  16477.   breakpoints%@BO:       5fa48@%%@BO:       68cca@%
  16478.   display mode%@BO:       70bc1@%
  16479.   filenames for load and write commands%@BO:       6fbd9@%
  16480.   program arguments for program execution%@BO:       6fbd9@%
  16481. Shaker
  16482.   allocation granularity%@BO:       980b4@%
  16483.   commands (list)%@BO:       985d7@%
  16484.   described%@BO:       97ad6@%
  16485. SHOWHITS.EXE utility
  16486.   described%@BO:       9d56d@%%@BO:       9e0b0@%
  16487.   sample display%@BO:       9e8db@%
  16488. SKERNEL.EXE file%@BO:       9f376@%
  16489. SKERNEL.SYM file%@BO:       9f58b@%
  16490. Slash (/), as SYMDEB option designator%@BO:       5c450@%
  16491. SMALL CAPTIAL LETTERS, as document convention%@BO:        adf2@%
  16492. Sorting memory objects%@BO:       9510c@%
  16493. Source file, compiling%@BO:        e148@%
  16494. Source lines, displaying%@BO:       711d9@%
  16495. Spy
  16496.   choosing a window%@BO:       91ef5@%
  16497.   choosing options
  16498.     message type%@BO:       91116@%%@BO:       9173f@%
  16499.     output device%@BO:       91834@%
  16500.     output frequency%@BO:       91c4e@%%@BO:       91e07@%
  16501.   described%@BO:       908ec@%
  16502.   starting%@BO:       90c10@%
  16503.   turning on and off%@BO:       92730@%
  16504. Stack frame%@BO:       6eaa0@%%@BO:       6edb8@%%@BO:       8551c@%%@BO:       85f9f@%
  16505. Stack probes%@BO:        e4df@%
  16506. STACK statement%@BO:       12b53@%
  16507. STACKSIZE statement%@BO:       10fe8@%
  16508. Starting applications with Windows%@BO:       5ee16@%
  16509. Statements
  16510.   CODE%@BO:       10443@%
  16511.   DATA%@BO:       1057f@%
  16512.   DESCRIPTION%@BO:       105dd@%
  16513.   EXETYPE WINDOWS%@BO:       11818@%%@BO:       1245f@%
  16514.   EXETYPE%@BO:       106b4@%
  16515.   EXPORTS%@BO:       1090d@%%@BO:       12363@%
  16516.   HEAPSIZE%@BO:       10a02@%
  16517.   IMPORTS%@BO:       10cba@%%@BO:       12b53@%
  16518.   LIBRARY%@BO:       10d94@%%@BO:       121cc@%
  16519.   NAME%@BO:       10e36@%%@BO:       11818@%
  16520.   SEGMENTS%@BO:       10ee4@%
  16521.   STACK%@BO:       12b53@%
  16522.   STACKSIZE%@BO:       10fe8@%
  16523.   STUB%@BO:       11150@%
  16524. Static text control%@BO:       2d402@%
  16525. Static variables%@BO:       5ffac@%
  16526. STUB statement%@BO:       11150@%
  16527. Styles
  16528.   dialog box%@BO:       312b9@%
  16529.   dialog-box control%@BO:       2f18c@%
  16530. SWAP.EXE file%@BO:       9f50c@%
  16531. Swap
  16532.   command line options%@BO:       9fcfe@%
  16533.   described%@BO:       9eeca@%
  16534.   output format%@BO:       a08d5@%%@BO:       a0dd2@%
  16535.   reducing processing time%@BO:       a0582@%
  16536.   starting and stopping%@BO:       9f6bd@%
  16537. .SYM files%@BO:       9f499@%
  16538. Symbol files
  16539.   for assembly-language applications%@BO:       58c05@%
  16540.   for C-language applications%@BO:       5872e@%
  16541.   library%@BO:       5c8b9@%%@BO:       5c8ba@%%@BO:       5c8bb@%
  16542.   loading%@BO:       5c6e6@%
  16543.   naming%@BO:       5ca2f@%%@BO:       5db90@%
  16544.   setting up%@BO:       57720@%
  16545. Symbol maps
  16546.   defined%@BO:       5d8da@%
  16547.   displaying symbols%@BO:       5e808@%
  16548.   listing%@BO:       5ddd1@%
  16549.   opening%@BO:       5dffd@%%@BO:       5e5db@%
  16550.   using symbols from%@BO:       5e67d@%
  16551. Symbolic Debugger (SYMDEB)
  16552.   and IBM-compatible computers%@BO:       5bf81@%
  16553.   application development option for%@BO:        e4df@%
  16554.   arguments
  16555.     address (list)%@BO:       65577@%%@BO:       66362@%
  16556.     command (list)%@BO:       62ce9@%%@BO:       6448f@%%@BO:       64f19@%
  16557.   commands
  16558.     canceling current%@BO:       5d71a@%
  16559.     command options%@BO:       59ded@%%@BO:       5b2a3@%%@BO:       5c31d@%
  16560.     executing at startup%@BO:       5c31d@%
  16561.     list of%@BO:       60f40@%%@BO:       62ac5@%
  16562.     redirect input and output%@BO:       73023@%
  16563.     set source mode%@BO:       70bc1@%
  16564.   debugging terminal
  16565.     remote%@BO:       59210@%
  16566.     secondary%@BO:       59bc7@%
  16567.   described%@BO:       57275@%
  16568.   displaying
  16569.     application source statements%@BO:       6069c@%
  16570.     variables%@BO:       5ffac@%
  16571.   expressions (list)%@BO:       665df@%
  16572.   for Assembly-language applications%@BO:       58c05@%
  16573.   for C-language applications%@BO:       5872e@%
  16574.   loading macro definitions%@BO:       5b2a3@%
  16575.   messages
  16576.     fatal exit%@BO:       60d2e@%
  16577.     memory-allocation%@BO:       5f1e5@%
  16578.   option designator%@BO:       5c450@%
  16579.   option%@BO:       5a414@%%@BO:       5ab08@%%@BO:       5ba4a@%
  16580.   passing control to command.com%@BO:       733b5@%
  16581.   preparing symbol files for%@BO:       57720@%
  16582.   quitting%@BO:       60a35@%
  16583.   redirecting output from%@BO:       5a6e4@%
  16584.   returning control to DOS%@BO:       704d6@%
  16585.   setting
  16586.     breakpoints%@BO:       5fa48@%
  16587.     memory-allocation reporting level%@BO:       5b071@%
  16588.   special keys%@BO:       5d177@%
  16589.   specifying symbol files%@BO:       5c6e6@%
  16590.   starting applications%@BO:       5ee16@%
  16591.   starting%@BO:       59ca2@%
  16592.   suspending and restoring output%@BO:       5d36a@%
  16593.   symbol maps
  16594.     opening%@BO:       5e5db@%
  16595.     using symbols from%@BO:       5e67d@%
  16596.     working with%@BO:       5d8da@%%@BO:       5ddd1@%%@BO:       5dffd@%
  16597.   terminating%@BO:       704d6@%
  16598.   use of, with Windows%@BO:       59ded@%%@BO:       5a39a@%%@BO:       5ba4a@%%@BO:       5c8bb@%%@BO:       5cee3@%%@BO:       5d71a@%
  16599. Symbolic Debugger(SYMDEB)
  16600.   debugging terminal
  16601.     secondary%@BO:       5975f@%
  16602. Symbols
  16603.   declaring public%@BO:       58d23@%
  16604.   displaying%@BO:       5e808@%
  16605. SYS REQ key%@BO:       5d4d8@%
  16606.  
  16607. %@2@%%@AB@%    T%@AE@%%@EH@%%@NL@%
  16608. Tab stop, setting for dialog-box control%@BO:       308aa@%
  16609. Task descriptor block%@BO:       6b878@%%@BO:       7b8cb@%
  16610. Task queue, displaying information about%@BO:       6b6a7@%%@BO:       7b6ea@%
  16611. Terminal
  16612.    remote, for debugging%@BO:       5929c@%
  16613.    secondary, for debugging%@BO:       5975f@%
  16614. Terminating SYMDEB%@BO:       704d6@%
  16615. Text editors
  16616.   creating applications%@BO:        8e6a@%
  16617.   creating resource script files%@BO:       18600@%
  16618. Text, changing%@BO:       2f498@%
  16619. Toolbox
  16620.   described%@BO:       2b461@%
  16621.   enabling%@BO:       2e053@%
  16622. Tools
  16623.    %@AI@%see%@AE@% Help.%@NL@%
  16624.   compilers. See C Compiler; Resource Compiler%@BO:        7be6@%
  16625.   debugging tools. See CodeView for Windows ; Spy; Symbolic Debugger%@BO:        7be6@%
  16626.   linkers. See Linker%@BO:        7be6@%
  16627.   optimization tools. See Heap Walker; Profiler; Shaker; Swap%@BO:        7be6@%
  16628.   resource editors. See Dialog Editor; Font Editor; SDKPaint%@BO:        7be6@%
  16629. Turning off stack probes%@BO:        eab9@%
  16630.  
  16631. %@2@%%@AB@%    U%@AE@%%@EH@%%@NL@%
  16632. Underscore (_), with commands%@BO:       64f19@%
  16633. User library, symbol files%@BO:       5c8bb@%
  16634. User-defined resource statement%@BO:       18971@%
  16635. Utilities
  16636.    %@AI@%see%@AE@% Tools%@NL@%
  16637.  
  16638. %@2@%%@AB@%    V%@AE@%%@EH@%%@NL@%
  16639. -V option%@BO:       1e677@%
  16640. Variable-pitch fonts%@BO:       34e91@%%@BO:       37dcc@%
  16641. Variables
  16642.   displaying%@BO:       5ffac@%
  16643.   static%@BO:       5ffac@%
  16644. Vector fonts%@BO:       3412b@%
  16645. Vertical bar (|), as document convention%@BO:        a9f4@%
  16646. Virtual breakpoint, defined%@BO:       68bec@%
  16647. VPROD.386 device driver%@BO:       9d187@%
  16648.  
  16649. %@2@%%@AB@%    W%@AE@%%@EH@%%@NL@%
  16650. Walking the heap%@BO:       942e4@%
  16651. Width, font%@BO:       36814@%%@BO:       374f5@%
  16652. Wildcard character (*), with SYMDEB commands%@BO:       64f19@%%@BO:       7225b@%
  16653. Window, monitoring messages to%@BO:       91ef5@%
  16654. Windows 386 enhanced mode applications
  16655.   using PROFILER with%@BO:       99128@%%@BO:       99500@%%@BO:       99c88@%
  16656.   Using PROFILER with%@BO:       9a6dc@%
  16657.   using PROFILER with%@BO:       9d187@%
  16658. Windows 386 mode applications
  16659.   using PROFILER with%@BO:       9aed0@%
  16660. Windows applications
  16661.   compiler option, example%@BO:        d712@%
  16662.   creating%@BO:        8d63@%
  16663. Windows enhanced mode applications
  16664.   using PROFILER with%@BO:       9c433@%
  16665. Windows version stamp%@BO:       1a929@%
  16666. Windows
  16667.   epilog%@BO:        f19b@%
  16668.   fatal exit message%@BO:       60d2e@%
  16669.   import libraries%@BO:       12f54@%
  16670.   prolog%@BO:        f19b@%
  16671. WinMain function%@BO:       5fb2e@%
  16672. Writing
  16673.   to logical records on disk%@BO:       7173b@%
  16674.   to named files%@BO:       7173b@%
  16675.  
  16676. %@2@%%@AB@%    X%@AE@%%@EH@%%@NL@%
  16677. -X option%@BO:       1b75a@%%@BO:       1e3bf@%
  16678.  
  16679.