函数及参数说明(具体参考MSND)
HWND HtmlHelp(HWND hwndCaller, LPCSTR pszFile, UINT uCommand, DWORD dwData);
-
hwndCaller
- Specifies the handle of the window calling the HtmlHelp API. If the HtmlHelp API call results in messages being sent from the HTML Help window, they will be sent to this window handle. pszFile
- Specifies an HTML file, a URL, a compiled HTML file, or a window definition (preceeded with a ‘>’ character). If the command being used does not require a file or URL, this value may be NULL. uCommand
- Specifies the action to perform. See the Comments section for details. dwData
- Specifies any data that may be required based on the value of the uCommand parameter.
在这里我们没有生成help.chm文件,以个人博客URL http://blog.csdn.net/jiazhen替代,具体如下:
HtmlHelp(g_hWnd,"http://blog.csdn.net/jiazhen", HH_DISPLAY_TOPIC,NULL);
注意:在系统中搜索要找到htmlhelp.h 和htmlhelp.lib分别所在的文件路径,添加到
Project settings-->C++ -->Catergory-->PreProcessor-->Addtional include files和
Project settings-->Link 的Category-->input-->Additional library path中
比较简单的方法:找到htmlhelp.h和htmlhelp.lib文件,复制到工程文件夹中,Project-->Add to Project-->files,分别将上面两个文件添加到工程中,在工程文件里加入 #include "htmlhelp.h" 。
如果不进行上面的操作可能会出现以下提示:
Cannot open include file: 'HtmlHelp.h': No such file or directory
cannot open file "./Htmlhelp.Lib"
或者编译成功,而链接出错。