This documentation is archived and is not being maintained.

MAKEHM Sample: Utility for Associating Resources with Help Contexts

Visual Studio 2008

The MAKEHM sample is a console application that produces a mapping between resource identifications and Help contexts. The sources are provided for MAKEHM to serve as an illustration of a console application that uses MFC and to enable you to modify the tool.

A console application such as MAKEHM is linked with the same variant of the MFC library as graphical user interface (GUI) applications.

Security noteSecurity Note:

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices. Microsoft assumes no liability for incidental or consequential damages should the sample code be used for purposes other than as intended.

To get samples and instructions for installing them:

  • On the Visual Studio Help menu, click Samples.

    For more information, see Visual Studio Samples.

  • The most recent version and complete list of samples is available online from the Visual Studio 2008 Samples page.

  • You can also locate samples on your computer's hard disk. By default, samples and a Readme file are copied into a folder under \Program Files\Visual Studio 9.0\Samples\. For Express editions of Visual Studio, all samples are located online.

If you have installed the Microsoft Visual C++ product, the MAKEHM utility (MAKEHM.EXE) is installed by default in \\Microsoft Visual Studio .NET 2003\Common7\Tools.

The command line syntax to run MAKEHM directly is:

makehm <from>,<to>,<add> [<from>, <to>,<add> [...]] <resource.h> >> []

Specifies the symbol prefix to be read, such as a command ID.


Specifies the symbol prefix of the Help context identification to be produced in the .hm file.


The Help ID base number to be added to the value of the <from> identification to produce the Help context number.

You can specify one or more sets of <from>,<to>,<add> in the command line.


The header file that provides #define definitions for the symbols to be read.


The .hm file to be produced by MAKEHM.

Look at the custom build steps for the resource.h file to learn what command line values to use.

This sample demonstrates the following keywords:

AfxThrowMemoryException; CFile::Close; CFile::GetPosition; CFile::Open; CFile::Seek; CStdioFile::ReadString; CStdioFile::WriteString; CString::GetBuffer; CString::GetLength; CString::IsEmpty; CString::ReleaseBuffer; CString::Right; __iscsym; __iscsymf; _strdup; exit; fprintf; free; isdigit; isxdigit; sprintf_s; strchr; strcmp; strnlen; strncmp; strstr; strtok


Some samples, such as this one, have not been modified to reflect the changes in the Visual C++ wizards, libraries, and compiler, but still demonstrate how to complete your desired task.

Other Resources