How to set up Visual C++ to use the HTML Help API in Visual C++ (186907)



The information in this article applies to:

  • Microsoft Visual C++, 32-bit Enterprise Edition 4.2
  • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
  • Microsoft Visual C++, 32-bit Enterprise Edition 4.2b
  • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 4.2
  • Microsoft Visual C++, 32-bit Professional Edition 4.2b
  • Microsoft Visual C++, 32-bit Professional Edition 5.0
  • Microsoft Visual C++, 32-bit Professional Edition 6.0
  • Microsoft Visual C++, 32-bit Learning Edition 6.0
  • Microsoft HTML Help 1.3
  • Microsoft HTML Help 1.21

This article was previously published under Q186907

SUMMARY

This article describes the steps that must be performed in order to use the HTML Help API with Visual C++.

MORE INFORMATION

  1. Include Htmlhelp.h in any source file that uses the HTML Help API. Add Htmlhelp.h to the .cpp file where the HTML Help API is invoked or in the include file for that .cpp file.
  2. Show Visual C++ where to find Htmlhelp.h; it is installed with the HTML Help Workshop in the <HTML Help Workshop Path>\Include directory. Specify this location for Visual C++ as follows:
    1. On the Tools menu, click Options.
    2. In the Options dialog box, click the Directories tab.
    3. In the Show directories for list, click Include files.
    4. Type the location of the HTML Help Workshop's include directory in the Directories box.
  3. Make sure you use Htmlhelp.lib when linking.
  4. Show Visual C++ where to find the HTML Help library, located in the <HTML Help Workshop Path>\lib. Specify this location in Visual C++ by returning to the Directories tab described in step 2:
    1. In the Show directories for list, click Library files.
    2. Type the location of the HTML Help Workshop's library directory in the Directories box.
  5. Next, add the chosen library to the Visual C++ project settings, as follows:
    1. On the Project menu, click Settings.
    2. After the Settings dialog box appears, click the Link tab.
    3. Select General in the Category list, and then type the name of the Html Help library in the Object/Library Modules box.
  6. When building the project, the following warning message may appear:
    ..default lib LIBCMT conflicts with use of other libs; use /NODEFAULTLIB:library.
    Follow the procedure in step 5 to return to the Link tab in the Settings dialog box:
    1. In the Category list, click Input.
    2. Then type LIBCMT in the Ignore libraries box.
    This method disables the default library search, so if any of the default libraries are being used, they must now be explicitly listed.
The Visual C++ project can now call the HTML Help API successfully.

REFERENCES

HTML Help Workshop: Online Help HTML Help Web Site: "Official Microsoft HTML Help Authoring Kit" by Steve Wexler, Microsoft Press

Modification Type:MajorLast Reviewed:4/21/2006
Keywords:kbinfo kbhowto kbide KB186907 kbAudDeveloper