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

This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.

To get samples and instructions for installing them:

To access samples from Visual Studio

  • On the Help menu, click Samples.

    By default, these samples are installed in drive:\Program Files\Microsoft Visual Studio 10.0\Samples\.

  • For the most recent version of this sample and a list of other samples, see Visual Studio Samples on the MSDN Web site.

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_s; strchr; strcmp; strnlen; 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.

See Also

Other Resources

MFC Samples