Microsoft KB Archive/186907

= How to set up Visual C++ to use the HTML Help API in Visual C++ =

Article ID: 186907

Article Last Modified on 7/2/2007

-

APPLIES TO


 * Microsoft Visual C++ 4.2 Enterprise Edition
 * Microsoft Visual C++ 6.0 Enterprise Edition
 * Microsoft Visual C++ 4.2 Enterprise Edition
 * Microsoft Visual C++ 5.0 Enterprise Edition
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 4.2 Professional Edition
 * Microsoft Visual C++ 5.0 Professional Edition
 * Microsoft Visual C++ 6.0 Professional Edition
 * Microsoft Visual C++ 6.0 Standard Edition
 * 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
 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. Show Visual C++ where to find Htmlhelp.h; it is installed with the HTML Help Workshop in the \Include directory. Specify this location for Visual C++ as follows:  On the Tools menu, click Options. In the Options dialog box, click the Directories tab. In the Show directories for list, click Include files. Type the location of the HTML Help Workshop's include directory in the Directories box.</li></ol> </li> Make sure you use Htmlhelp.lib when linking.</li> 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: <ol style="list-style-type: lower-alpha;"> In the Show directories for list, click Library files.</li> Type the location of the HTML Help Workshop's library directory in the Directories box.</li></ol> </li> Next, add the chosen library to the Visual C++ project settings, as follows: <ol style="list-style-type: lower-alpha;"> On the Project menu, click Settings.</li> After the Settings dialog box appears, click the Link tab.</li> Select General in the Category list, and then type the name of the Html Help library in the Object/Library Modules box.</li></ol> </li> 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: <ol style="list-style-type: lower-alpha;"> In the Category list, click Input.</li> Then type LIBCMT in the Ignore libraries box.</li></ol>

This method disables the default library search, so if any of the default libraries are being used, they must now be explicitly listed.</li></ol>

The Visual C++ project can now call the HTML Help API successfully.

<div class="references_section">