- Table of Contents
- Copyright
- About the Authors
- About the Contributors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- How to Use This Book
- What You Need to Use This Book
- What's New in Visual C++ 6.0
- Contacting the Main Author
- Part I: Introduction
- Chapter 1. The Visual C++ 6.0 Environment
- Part II: MFC Programming
- Chapter 2. MFC Class Library Overview
- Chapter 3. MFC Message Handling Mechanism
- Chapter 4. The Document View Architecture
- Chapter 5. Creating and Using Dialog Boxes
- Chapter 6. Working with Device Contexts and GDI Objects
- Chapter 7. Creating and Using Property Sheets
- Chapter 8. Working with the File System
- Chapter 9. Using Serialization with File and Archive Objects
- Part III: Internet Programming with MFC
- Chapter 10. MFC and the Internet Server API (ISAPI)
- Chapter 11. The WinInet API
- Chapter 12. MFC HTML Support
- Part IV: Advanced Programming Topics
- Chapter 13. Using the Standard C++ Library
- Chapter 14. Error Detection and Exception Handling Techniques
- Chapter 15. Debugging and Profiling Strategies
- Chapter 16. Multithreading
- Chapter 17. Using Scripting and Other Tools to Automate the Visual C++ IDE
- Part V: Database Programming
- Chapter 18. Creating Custom AppWizards
- Chapter 19. Database Overview
- Chapter 20. ODBC Programming
- Chapter 21. MFC Database Classes
- Chapter 22. Using OLE DB
- Chapter 23. Programming with ADO
- Part VI: MFC Support for COM and ActiveX
- Chapter 24. Overview of COM and Active Technologies
- Chapter 25. Active Documents
- Chapter 26. Active Containers
- Chapter 27. Active Servers
- Chapter 28. ActiveX Controls
- Part VII: Using the Active Template Library
- Chapter 29. ATL Architecture
- Chapter 30. Creating COM Objects Using ATL
- Chapter 31. Creating ActiveX Controls Using ATL
- Chapter 32. Using ATL to Create MTS and COM+ Components
- Part VIII: Finishing Touches
- Chapter 33. Adding Windows Help
- Part IX: Appendix
Authoring Help Topics Using WinHelp
The actual text of all of your WinHelp help topics is created in rich-text format (RTF) files. Rich-text format allows you to create files that use only the ASCII character set, but can also include additional formatting information, as well as special information about links.
For some reason, Microsoft has never felt that it needed to include the ability to edit RTF files from within Developer Studio. Their recommendation is to use an additional editor, such as Microsoft Word, which can save files in an RTF format. However, because RTF files only use the standard ASCII character set, you may use any plain ASCII editor to work with the .rtf files, although the files are much more difficult to work with in plain ASCII.
For example, see Figure 33.9 for the simple .rtf file as shown in Microsoft Word.
Figure 33.9 RTF in Microsoft Word.
The same file would look like the one in Figure 33.10 in a native ASCII text editor, such as Notepad.
Figure 33.10 RTF in Notepad.
Creating Help Topics
Individual topics in your RTF files are separated by a hard page break. These are used to separate the RTF text into the individual pages that will be displayed by WinHelp. In addition, each topic may contain several special footnotes.
To start with, most of your topics should include a footnote using the special character (#), which is used to assign a context name to the topic. This context name given in the footnote text is used for referencing this topic as the destination of a hypertext link or directly from your application.
Secondly, you might want to add a footnote using the special character (K). The text for this footnote lists keywords that may be used in searches to find this particular topic. These keywords appear to the user in the Index tab of the WinHelp dialog.
In addition, you may specify a footnote with the ($) character, which assigns a topic name. Topic names assigned with this footnote will appear to the user in the Find tab of the WinHelp dialog.
Adding Hot Spots
I'm sure that by now you are familiar with using help files that allow you to click certain keywords or phrases to move to a new topic. These are known as hot spots, or hypertext links. To implement these hot spots in your help files, you will need to add a few special things to your RTF file.
The displayed text that you want to make a hot spot should be formatted with double underlining. Immediately following the double underlined text, add a context name, which should be formatted as hidden text. This hidden text gives the context name for a topic somewhere in your help file. Remember that the context name for a topic is assigned using the # footnote.
This is all you need to do to add hypertext links to your help files. However, you might also want to use tables to format groups of links, as you will see in the .rtf files gener ated by AppWizard.
Including Graphics in Help Files
As you will see in the .rtf files that are created by AppWizard, you can also add graph ics to your help files. You can include bitmap files anywhere in your help file by adding a directive to your .rtf file in the location where you intend to display the bitmap. The format of the directive looks like this:
{bmc MyPic.bmp}
The directive is enclosed in curly braces and uses the bmc command to indicate that the filename of a bitmap file will follow.
Managing Help Projects | Next Section

Account Sign In
View your cart