# MAKEHM Sample: Utility for Associating Resources with Help Contexts

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 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.

# Running the Sample

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> >> [output.hm]
    <from>

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

    <to>

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

    <add>

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.

    <resource.h>

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

    <output.hm>

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.

# Keywords

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; strchr; strcmp; strlen; strncmp; strstr; strtok

Note
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.