Microsoft KB Archive/195613

= How To Create a Simple Context-Sensitive HTML Help File =

Article ID: 195613

Article Last Modified on 6/29/2004

-

APPLIES TO


 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q195613



SUMMARY
Visual Foxpro 6.0 includes HTML HELP Workshop that you can use to design help systems for your applications. This article describes how to create a simple context-sensitive help system.



MORE INFORMATION
HTML Help Workshop is a Help authoring tool with an easy-to-use graphical interface for creating help project files, topic files, contents files, index files, and everything else you need to put together an online help system or Web site.

NOTE: You can install HTML Help Workshop by running HTMLHelp.exe from the HtmlHelp directory on Disc 1 of the Microsoft Visual FoxPro version 6.0 or Microsoft Visual Studio version 6.0 CDs.

 Add relevant numbers to the HELPCONTEXTID property of each of the controls in your Visual FoxPro project that you would like to associate with a help topic. For example, if you want to associate help with three controls in a form, set the HELPCONTEXTID property for each of them to 1, 2, and 3 respectively. Create the topic files for your help system. These are common HTML files. You can create them in any HTML editor or HTML Help Workshop. Each of the HELPCONTEXTID numbers for the controls represents a topic. Create a file for each of the topics that you want to include in your help system.  Create a map file. You can use a Text Editor, such as NotePad, to create this file. A map file is a C Header file that maps the HelpContextId sent by the calling application to constants used in the Help Compiler. A map file is a text file and might contain information similar to the following: #Define TOPIC1 1 #Define TOPIC2 2  Open the HTML Help Workshop and create a new help project. A wizard guides you through how to add the HTML files to the project. Using HTML Help Workshop, open the project created in step 4. Click HtmlHelp API information. Click the Map tab, and click Header File. Select the header file created in step 3. In the HtmlHelp API information dialog box, click the Alias tab. Click Add, and type the constant or the number passed to the HtmlHelp API (for example, TOPIC1) in the box under "Whenever This Constant or number is passed to the HTMLHelp API." In the "Use it to Refer to This HTML File" box, select a topic file (created in step 2) that you want the constant to refer to.</li> Repeat steps 6 and 7 to associate all of the HTML topic files to the appropriate constants.</li> Click Save all project files and compile. This creates a help file with the same name as the Help project and a .chm extension.</li> To set help to the Help file that you created in step 9, use the following command:

Set Help to MyHelpFile.chm

Where MyHelpFile.chm is the name of the help file created in HTML Help Workshop.</li></ol>

<div class="references_section">