Tools and Utilities Guide
Total Page:16
File Type:pdf, Size:1020Kb
3.1 TOOLS AND UTILITIES GUIDE • ERROR MESSAGES • WINSIGHT'" • MAKE • HELP/RESOURCE COMPILERS • TLiNK BORLAND Borlanct c++ Version 3.1 Tools and Utilities Guide BORLAND INTERNATIONAL INC. 1800 GREEN HILLS ROAD P.O. BOX 660001, scons VALLEY, CA 95067-0001 Copyright © 1991, 1992 by Borland International. All rights reserved. All Borland products are trademarks or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered trademarks of their respective holders. Windows, as used in this manual, refers to Microsoft's implementation of a windows system. PRINTED IN THE USA. Rl 10 9 8 7 6 5 4 c o N T E N T s Introduction 1 Examples ....................... 24 Automatic dependency checking ... 25 Chapter 1 Import library tools 3 Implicit rules . .. 25 IMPDEF: The module definitions Macros' ........................... 28 manager ............................. 3 Defining macros ................. 29 Classes in a DLL .................... 4 U sing macros. .. 29 Functions in a DLL . .. 5 Using environment variables as IMPLIB: The import librarian ........... 6 macros ......................... 29 Re-creating IMPORT. LIB ............. 7 Substitution within macros ........ 30 IMPLIBW: The import librarian for Special considerations ............ 30 Windows ............................ 7 Predefined macros ............... 30 Select an import library .............. 7 Defined Test Macro ($d) ........ 31 From a DLL ...................... 7 File name macros ................ 32 From a module definition file ....... 7 Base file name macro ($*) ....... 32 Creating the import library . .. 8 Full file name macro ($<) . .. 32 Chapter 2 Make: The program File name path macro ($:) ....... 33 manager 9 File name and extension macro How MAKE works . .. 10 ($.) . .. 33 Starting MAKE ...................... 10 File name only macro ($&) ...... 33 Command-line options ............. 11 Full target name with path macro The BUlL TINS.MAK file ............ 13 ($@) .......................... 33 A simple use of MAKE ............... 13 All dependents macro ($**) . .. 34 Crea ting makefiles ................... 16 All out of date dependents macro Components of a makefile . .. 16 ($?) .......................... 34 Comments ........................ 17 Macro modifiers ................. 34 Command lists for implicit and explicit Directives . .. 35 rules ............................. 17 Dot directives ..................... 36 Prefixes ........................ 18 .precious ........................ 36 Command body and operators ..... 18 .path.ext ........................ 36 Compatibility option .......... 19 .suffixes ........................ 37 Batching programs .............. 20 File-inclusion directive ............. 38 Executing commands ............ 21 Conditional execution directives ..... 38 Explicit rules ..................... 22 Expressions allowed in conditional Special considerations ........... 23 directives ....................... 40 Multiple explicit rules for a single Error directive . .. 41 target ........................... 24 Macro undefinition directive ........ 42 The compatibility option -N . .. 42 /0 (overlays) ..................... 68 IP (pack code segments) ........... 69 Chapter 3 TLlB: The Turbo librarian 45 It (tiny model.COM file) .......... 69 Why use object module libraries? ...... 46 lTd and ITw (target options) ...... 70 The TLIB command line .............. 46 I v (debugging information) ........ 70 The operation list .................. 47 lye (expanded memory) ........... 71 , File and module names ........... 48 I yx (extended memory) ........... 71 TLIB operations. .. 48 The module definition file ............ 72 U sing response files ................... 49 Module definition file defaults ...... 72 Creating an extended dictionary: The IE A quick example .................. 73 option .............................. 49 Module definition reference .......... 74 Setting the page size: The IP option .... 50 CODE ........................... 74 Advanced operation: The IC option. ,... 50 DATA ........................... 75 Examples ........................... 51 DESCRIPTION ................ ,... 76 Chapter 4 TLlNK: The T~Jrbo linker 53 EXETYPE ........................ 76 Invoking TLINK .. .. 53 EXPORTS ........................ 76 An example of linking for DOS ...... 54 HEAPSIZE ....................... 77 An example of linking for Windows .. 55 IMPORTS ........................ 78 File names on the TLINK command LIBRARy ........................ 78 line .............................. 55 NAME .......................... 79 Using response files ................ 56 SEGMENTS ...................... 79 The TLINK configuration file ........ 57 STACKSIZE ...................... 80 Using TLINK with Borland C++ STUB ............................ 80 modules ......................... 58 Chapter 5 USing WinSight 83 Startup code .................... 59 Getting started ..................... 83 Libraries ....................... 59 Getting out ....................... 84 BGI graphics library .......... : . 60 Choosing a view .................... 84 Ma th libraries ................ 60 Picking a pane .................... 84 Run-time libraries ............. 61 Arranging the panes ............... 85 Using TLINK with BCC ............ 62 Getting more detail ............... 85 TLINK options ..................... 62 Class detail .................... 85 The TLINK configuration file ....... 62 Window detail .................. 85 (32-bit code) ................... 13 63 Using the window tree .............. 85 A (align segments) ............... I 63 Pruning the tree .................. 86 (case sensitivity) ............. ~ .. Ic 63 Showing child windows ......... 86 ./C (case sensitive exports) ......... 64 Hiding child windows ........... 86 I d (duplicate symbols) ............ 64 Finding a window ................ 86 I e (no extended dictionary) ........ 65 Leaving Find Window mode ..... 86 (uninitialized trailing segments) .. Ii 65 Spying on windows ............... 87 (line numbers) .................. II 65 Working with classes ................ 87 IL (library search paths) ........... 65 U sing the Class List pane .......... 87 1m, Is, and Ix (map options) ....... 66 Spying on classes ................. 87 (ignore default libraries) ........ In 68 Taking time out ..................... 88 Turning off tracing . .. 88 Layout of the Help text .......... 110 Suspending screen updates .......... 88 Type fonts and sizes . .. 111 Choosing messages to trace ........... 88 Graphic images ................... 112 Filtering out messages .............. 89 Creating the Help topic files .......... 113 Message tracing options ............ 89 Choosing an authoring tool ........ 113 Formatting message parameters ... 89 Structuring Help topic files . .. 113 Logging traced messages .......... 89 Coding Help topic files ............ 114 WinSight windows . .. 93 Assigning build tags ............ 115 Class List pane ............. "....... 93 Assigning context strings ........ 116 Display format .................. 93 Assigning titles ................ 117 Window Tree pane . .. 94 Assigning keywords ............ 118 Display format .................. 94 Creating multiple keyword Message Trace pane ................ 94 tables ........................ 119 Format ......................... 95 Assigning browse sequence numbers . .. 120 Chapter 6 RC: The Windows resource Organizing browse sequences .. 120 compiler 97 Coding browse sequences . .. 122 Creating resources ................... 97 Creating cross-references between Adding resources fo an executable ..... 98 topics ......................... 122 Resource compiling from the IDE .... 98 Defining terms ................. 123 Resource compiling from the command Creating definition topics ...... 123 line .. "............................ 99 Coding definitions ............ 124 Resource compiling from a makefile .. 99 Inserting graphic images . .. 124 Resource Compiler syntax. .. 99 Creating and capturing bitmaps .. 124 Chapter 7 HC: The Windows Help Placing bitmaps using a graphical compiler 101 word processor.................. 125 Creating a Help system: The development Placing bitmaps by reference ..... 125 cycle .............................. 101 Managing topic files . .. 126 How Help appears to the user ...... 102 Keeping track of files and topics .. 127 How Help appears to the help writer. 103 Creating a help tracker .......... 127 How Help appears to the help Building the Help file . .. 129 programmer ..................... 104 Creating the Help project file ....... 129 Planning the Help system ............ 104 Specifying topic files .............. 130 Developing a plan ................ 104 Specifying build tags .............. 131 Defining the audience ........... 104 Specifying options ................ 131 Planning the contents ............ 105 Specifying error reporting . .. 132 Planning the structure ........... 106 Specifying build topics .......... 132 Displaying context-sensitive Help Specifying the root directory ..... 133 topics ......................... 107 Specifying the index . .. 134 Determining the topic file structure .. 108 Assigning a title to the Help Choosing a file structure for your system ........................ 134 application . .. 108 Converting fonts . .. 134 Designing Help topics ............. 110 Changing font sizes ............. 135 Multiple keyword tables ......... 136 iii Compressing the file ............ 136 Canceling Help ................. 148 Specifying alternate context strings .. 137