VC添加.chm帮助文档

一. 首先需要.chm文件。

1.假设帮助文档内容是用word编写,word另存为“单个文件网页”的类型,并将此文件放在一个文件夹里(这个是必须要这样,下面步骤中的Easy CHM软件才能识别)。

2.打开本文所使用的CHM文件生成软件:Easy CHM,新建->浏览->找到刚另存为的文件->编译->生成CHM,即生成了以文件夹命名的.chm文件。


二. 将生成的.chm文件放在VC工程中,并在工程中添加一个include文件夹,里面需要包括一个htmlhelp.h和htmlhelp.lib文件(这俩文件网上有)。


三. 在StdAfx.h文件中添加头文件:#include "include\htmlhelp.h"


四. 在需要使用的帮助文档类中添加成员函数:

void CHelp::OnButtonHelp()
{
   char appPath[256];
 GetCurrentDirectory(256,appPath); //取得应用程序当前路径
 CString  helpFile;
 helpFile.Format("%s",appPath);
 helpFile+="\\help.chm"; //取得帮助文件路径
 HWND hwnd  = HtmlHelp(NULL,(LPCSTR)helpFile,HH_DISPLAY_TOPIC,0);
}

其中help.chm即为需要打开的帮助文档文件。以上步骤经过测试,可以使用。


Class Library Reference The Class Library Reference covers the classes, global functions, global variables, and macros that make up the Microsoft® Foundation Class Library, version 6.0. The class hierarchy chart details the class relationships in the class library. The Class Library Overview lists the classes in helpful categories. Use these lists to help locate a class that contains the functionality you are interested in.Visual C++ Programmer's Guide explains how to use the class library to program for Microsoft Windows NT®, Microsoft Windows® 95, and other Win32® platforms. Practical examples and techniques are supplied in the tutorials inVisual C++/MFC Tutorials. The remainder of the Class Library Reference consists of an alphabetical listing of the classes and an MFC Macros and Globals section that explains the global functions, global variables, and macros used with the class library. The individual hierarchy charts included with each class are useful for locating base classes. The Class Library Reference usually does not describe inherited member functions, inherited operators, and overridden virtual member functions. For information on these functions, refer to the base classes depicted in the hierarchy diagrams. In the alphabetical listing section, each class description includes a member summary by category, followed by alphabetical listings of member functions, overloaded operators, and data members. Public and protected class members are documented only when they are normally used in application programs or derived classes. Occasionally, private members are listed because they override a public or protected member in the base class. See the class header files for a complete listing of class members. Some C-language structures defined by Windows are so widely applicable that their descriptions have been reproduced completely in a section following the alphabetical reference. Please note that the “See Also” sections refer to Win32 API functions by prefacing them with the scope resolution operator (::), for example, ::EqualRect. More information on these functions can be found in the Win32 SDK documentation.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值