如何使用CHM HTML帮助文件与Delphi XE应用程序? [英] How to use CHM HTML Help file with Delphi XE application?
问题描述
http://edn.embarcadero.com/article/27842 文章介绍如何使用CHM文件。
我做了在那里描述的所有步骤。
添加
const
HH_DISPLAY_TOPIC = $ 0000;
HH_DISPLAY_TOC = $ 0001;
HH_CLOSE_ALL = $ 0012;
函数HtmlHelp(hwndCaller:HWND;
pszFile:PChar; uCommand:UINT;
dwData:DWORD):HWND;标准
external'HHCTRL.OCX'name'HtmlHelpA';
和公共函数HH`
函数TForm1.HH(Command:Word; Data:Integer;
var CallHelp:Boolean):Boolean;
begin
if(Command = 0)和(Data = 0)then
HtmlHelp(Application.Handle,
PChar(Application.HelpFile),
HH_DISPLAY_TOC,0 );
CallHelp:= False;
结束
在FormCreate
code> HelpDir:= ExtractFilePath(Application.EXEName);
Application.HelpFile:= HelpDir +'Sample.chm';
Application.OnHelp:= HH;
在button1上,OnClick事件添加了以下代码:
HH(0,0,dummy);
点击button1后,光标会变成沙漏一段时间,这就是全部。 >
我在做什么错?
CHM帮助文件如何从DelphiXE应用程序中使用?
您正在从预建日期开始的文章,支持HTML帮助。这些天你们执行以下操作:
- 在你至少有一个你包含
HtmlHelpViewer
使用条款。 - 将
Application.HelpFile
设置为您的帮助文件的路径。
就是这样。您的问题中的代码应该被删除。内置的帮助查看器负责所有这些细节。
Delphi - How to use CHM HTML Help file with Delphi XE application?
http://edn.embarcadero.com/article/27842 article describes how to use CHM file. I did all the steps described there.
Added
const
HH_DISPLAY_TOPIC = $0000;
HH_DISPLAY_TOC = $0001;
HH_CLOSE_ALL = $0012;
function HtmlHelp(hwndCaller: HWND;
pszFile: PChar; uCommand: UINT;
dwData: DWORD): HWND; stdcall;
external 'HHCTRL.OCX' name 'HtmlHelpA';
and public function HH`
function TForm1.HH(Command: Word; Data: Integer;
var CallHelp: Boolean): Boolean;
begin
if (Command = 0) and (Data = 0) then
HtmlHelp(Application.Handle,
PChar(Application.HelpFile),
HH_DISPLAY_TOC, 0);
CallHelp := False;
end;
In FormCreate
HelpDir:=ExtractFilePath(Application.EXEName);
Application.HelpFile:=HelpDir+'Sample.chm';
Application.OnHelp := HH;
On the button1 OnClick event added the following code:
HH(0, 0, dummy);
After clicking on the button1, cursor becomes an hourglass for a while, and that's all.
What I'm doing wrong ?
And how the CHM help file can be used from DelphiXE application?
The article you are working from pre-dates built in support for HTML help. These days you do the following:
- Include
HtmlHelpViewer
in at least one of your uses clauses. - Set
Application.HelpFile
to the path of your help file.
And that's it. The code in your question should be removed. The built-in help viewer takes care of all those details.
这篇关于如何使用CHM HTML帮助文件与Delphi XE应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!