📄 vcg23.htm
字号:
<HTML>
<HEAD>
<TITLE>vcg23.htm </TITLE>
<LINK REL="ToC" HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/index.htm">
<LINK REL="Index" HREF="htindex.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/htindex.htm">
<LINK REL="Next" HREF="vcg24.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg24.htm">
<LINK REL="Previous" HREF="vcg22.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg22.htm"></HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080">
<A NAME="I0"></A><P ALIGN=CENTER>
<A HREF="vcg22.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg22.htm" TARGET="_self"><IMG SRC="blanprev.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blanprev.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Previous Page"></A>
<A HREF="index-1.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/index.htm" TARGET="_self"><IMG SRC="blantoc.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blantoc.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="TOC"></A>
<A HREF="vcg24.htm" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/vcg24.htm" TARGET="_self"><IMG SRC="blannext.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/blannext.gif" WIDTH = 37 HEIGHT = 37 BORDER = 0 ALT="Next Page"></A>
<HR ALIGN=CENTER>
<P>
<UL>
<UL>
<UL>
<LI>
<A HREF="#E68E116" >Understanding How Visual C++ and WinHelp Interact</A>
<UL>
<LI>
<A HREF="#E69E279" >Using AppWizard's Automatic Help Facility</A>
<LI>
<A HREF="#E69E280" >Creating Rich Text Format Files for Help Systems</A>
<LI>
<A HREF="#E69E281" >Adding Instructions to the WinHelp Engine</A>
<LI>
<A HREF="#E69E282" >Including Graphic Objects in Your WinHelp File</A>
<LI>
<A HREF="#E69E283" >Compiling .RTF Files to Create WinHelp .HLP Files</A>
<UL>
<LI>
<A HREF="#E70E126" >Creating a Project File</A>
<LI>
<A HREF="#E70E127" >Using Microsoft Help Workshop to Compile Your WinHelp .RTF File</A></UL></UL>
<LI>
<A HREF="#E68E117" >Using WinHelp Office 95 and RoboHELP 95</A>
<UL>
<LI>
<A HREF="#E69E284" >RoboHELP 95</A>
<LI>
<A HREF="#E69E285" >SmartHelp OLE Control</A>
<LI>
<A HREF="#E69E286" >WinHelp Video Kit</A>
<LI>
<A HREF="#E69E287" >Moving to WinHelp '95 Kit</A>
<LI>
<A HREF="#E69E288" >WinHelp HyperViewer</A>
<LI>
<A HREF="#E69E289" >WinHelp Tool Kit</A>
<LI>
<A HREF="#E69E290" >Mastering WinHelp</A></UL>
<LI>
<A HREF="#E68E118" >Creating Help Files from Your Application Manual</A>
<UL>
<LI>
<A HREF="#E69E291" >Using Doc-To-Help to Create Help Files for Database Applications</A>
<UL>
<LI>
<A HREF="#E70E128" >Organizing Your Manual to Optimize Help File Conversion</A>
<LI>
<A HREF="#E70E129" >Creating the Help File from the Source Document</A>
<LI>
<A HREF="#E70E130" >Help Project Files and the Compilation Process</A></UL></UL>
<LI>
<A HREF="#E68E119" >Including Graphic Images in Help Files</A>
<LI>
<A HREF="#E68E120" >Assigning Help File and Context ID Numbers to Objects</A>
<LI>
<A HREF="#E68E121" >Calling the WinHelp() Function with Visual C++ Code</A>
<LI>
<A HREF="#E68E122" >Summary</A></UL></UL></UL>
<HR ALIGN=CENTER>
<A NAME="E66E57"></A>
<H1 ALIGN=CENTER>
<CENTER>
<FONT SIZE=6 COLOR="#FF0000"><B>- 23 -</B>
<BR><B>Creating Help Files for Database Applications</B></FONT></CENTER></H1>
<BR>
<P>Users of Windows expect and deserve context-sensitive online help for all their Windows applications. All but the simplest Visual C++ applications need a custom Windows help file that lets users press F1 to obtain context-sensitive help for field entries, click a toolbar button to obtain help for a specific button, or choose Help | Contents to select a topic from the help system's opening window.
<BR>
<P>No matter how much or how little written documentation you supply with your database application, few users will take the time to read the documentation before they begin to use the application. This is especially true for decision-support applications that you design for supervisory and management personnel.
<BR>
<P>Your Visual C++ applications should be sufficiently intuitive in their operation such that all but the Windows neophyte can take full advantage of their features without employing online help. In reality, however, few Windows applications of any significance are fully comprehensible to the first-time user. Therefore, you need to create Windows help files to make sure that users employ all the features of your application and use the features in the way you intended. If you develop a database application to a written specification, the contract undoubtedly stipulates that comprehensive printed documentation is to accompany the production version of the application. Therefore, this chapter is oriented toward converting the text and graphics of your printed documentation to a help file for the application. Making your documentation do "double duty" as a help file saves time and expense.
<BR>
<P>This chapter is designed to supplement, not replace, the "Creating Help Files: Help Compiler" chapter in the <I>Programming Tools for Windows</I> manual that comes with Visual C++ 1.5x, the <I>Help Compiler Guide</I> included with Visual C++ 2.x, or the <I>Help Author's Guide</I> included with Visual C++ 4's Help Workshop program. In addition, programmers who have access to the Office Developer's Kit can refer to the Help Compiler Guide supplied with that product. Chapter 22, "Documenting Your Database Applications," taught you how to document the objects in your database application and prepare a data dictionary. This chapter shows you how to use several commercial software products. The non-Microsoft products described are Blue Sky Software's WinHelp Office 95, which is a number of useful products packaged together, and WexTech Systems, Inc.'s Doc-To-Help, which is used to convert your Word for Windows documentation files into a full-fledged, professional Windows help system.
<BR>
<P>Often help files are developed by people other than the programmer. This usually means that the programmer will be required to set up a system to assist the help file writers in creating the final help file. Visual C++ 4 automatically generates shell help files. This is fine if the programmer is the person who is developing the help files. If not, you might need to set up a system such as the one discussed in the following sections.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>It's usually better that someone other than the programmer write the documentation for an application. For example, I have a major Windows GIS application on the market for which I didn't write the documentation. Often the programmer isn't the best person to write the manuals and online help. Programmers often make too many assumptions about the user's ability. Furthermore, good programmers aren't always good writers.
<BR>
<BR>In some organizations, the responsibility for documentation is assigned to the customer support department. They work with the product and the customers and often know which areas are the weakest and need improvement.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E68E116"></A>
<H3 ALIGN=CENTER>
<CENTER>
<FONT SIZE=5 COLOR="#FF0000"><B>Understanding How Visual C++ and WinHelp Interact</B></FONT></CENTER></H3>
<BR>
<P>The help file display features of Windows are commonly referred to as the <I>WinHelp engine</I>. The Windows 95 help engine is quite powerful.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>Windows 95 has a very powerful and flexible help engine. This help engine has been migrated to other Windows platforms (Windows NT, for example) and will continue to be expanded upon in the future.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>WINHELP.EXE is the Windows application in your \WINDOWS directory that implements the help system. Under the 32-bit versions of Windows (Windows 95 and Windows NT), the file is named WINHLP32.EXE. Under Windows 95, WINHELP.EXE is a stub program that calls WINHLP32.EXE.
<BR>
<P>Visual C++ includes features that let you assign individual help windows to forms and controls to create context-sensitive help. The interface between your Visual C++ application and your WinHelp .HLP file(s) is comprised of the following two basic elements:
<BR>
<UL>
<LI>The <I>APPNAME</I>.HLP file is the master WinHelp file for your application. Most applications use a single help file, but you can specify different help files if necessary by calling the WinHelp engine directly.
<BR>
<BR>
<LI>The context ID number (long) corresponds to a help context string embedded in your WinHelp file. You add entries to the [MAP] section of your help project (.HPJ) file to assign context ID numbers to the help context strings. Context ID numbers are the key to creating context-sensitive help. You assign context ID numbers as the HelpContextID property of forms and controls. You also can set the current context ID value with a [<I>FormName</I>]![<I>ControlName</I>].HelpContextID = <I>lngContextID</I> statement.
<BR>
<BR>
</UL>
<P>The following sections describe how to create WinHelp files and how to assign context IDs to topics in order to create context-sensitive help.
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>Making use of all the features that the WinHelp engine offers is beyond the scope of this book. Microsoft's <I>Help </I><I>Authoring Guide </I>is available for downloading as HAG.ZIP in .HLP format from the Windows Users Group forum (GO WUGNET). The <I>Help Authoring Guide </I>also is included on the Microsoft Developer Network (MSDN) CD-ROMs.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BR>
<A NAME="E69E279"></A>
<H4 ALIGN=CENTER>
<CENTER>
<FONT SIZE=4 COLOR="#FF0000"><B>Using AppWizard's Automatic Help Facility</B></FONT></CENTER></H4>
<BR>
<P>Programmers who use AppWizard to create their applications have the option of including basic context-sensitive help. Figure 23.1 shows AppWizard's graphical programmer interface, which shows that when you add context-sensitive help, the Help menu is added automatically.
<BR>
<P><B><A HREF="23vcg01.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/23vcg01.gif">Figure 23.1. Visual C++ 4's AppWizard, including context-sensitive help.</A></B>
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>Figure 23.1 shows Visual C++ 4's AppWizard, which is virtually identical to the one in Visual C++ 2.x. The programmer interface of Visual C++ 1.5x is different from the one in Visual C++ 2.x, but the help files that AppWizard creates are virtually identical to those created using later versions of Visual C++.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>It's easy to convert an application's help file that was created with the 16-bit versions of Visual C++ (1.5x in particular) to 32-bit versions of Visual C++ (2.x and 4.x in particular). The final help file is actually created as a separate step outside of Visual Workbench using a batch file supplied with Visual C++ when using versions prior to Visual C++ 4.0. With Visual C++ 4's Developer Studio, when a help file is added to the project, Developer Studio correctly calls the help compiler and creates the desired help file.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>When Visual C++ creates the shell for your application's help file, this shell resides in a subdirectory located in the project's directory. This subdirectory is called HLP and contains one or two .RTF files and a number of bitmap files (usually about 20 to 25) for such objects as toolbar buttons. Figure 23.2 shows a typical HLP directory.
<BR>
<P><B><A HREF="23vcg02.gif" tppabs="http://202.113.16.101/%7eeb%7e/Database%20Developer's%20Guide%20with%20Visual%20C++%204,%20Second%20Edition/23vcg02.gif">Figure 23.2. The files created by AppWizard in the HLP subdirectory.</A></B>
<BR>
<BLOCKQUOTE>
<BLOCKQUOTE>
<HR ALIGN=CENTER>
<BR>
<NOTE><B>NOTE</B>
<BR>
<BR>Visual C++ 4 automatically creates help files (by executing the MakeHelp.Bat file) as part of the project build. You don't need to manually execute MakeHelp.Bat if you're using Visual C++ 4 and have used AppWizard to create your application with help features. Of course, if you want to manually compile the help files using MakeHelp.Bat, you can do so.</NOTE>
<BR>
<HR ALIGN=CENTER>
</BLOCKQUOTE></BLOCKQUOTE>
<P>The two .RTF files are
<BR>
<UL>
<LI>AfxCore.rtf, which contains the main help for the application. This file is always present and is the main file from which the application's .HLP file will be created.
<BR>
<BR>
<LI>AfxPrint.rtf, which contains help that is specific to printing. If you don't include printing support (see Figure 23.1), AppWizard doesn't create this file.
<BR>
<BR>
</UL>
<P><I>PROJECT</I>.HPJ is the help project file. .HPJ files are discussed later in this chapter.
<BR>
<P>Not all the help support is located in the HLP subdirectory. The project's main directory contains the batch file used to generate WinHelp files. MakeHelp.Bat, shown in Listing 23.1, actually calls the help compiler and generates the help file. This batch file is usually executed from a command-line prompt (in a DOS window), but you can create an icon or a menu shortcut from Visual C++'s Tools menu for MakeHelp.Bat. This filename never changes, so making a shortcut for Visual C++'s Tools menu would be effective for all AppWizard-created projects.
<BR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -