用Winhelp弹出了Hint帮助,点击Hint里的连接,抱错,说内存不够,不知为什么,请大家帮帮忙,十分感谢!我的代码是这么写的:
procedure HelpContextPopup(const HelpFile: string; const ID: Integer);
var
pchrHelpFile: PChar;
begin
pchrHelpFile := StrAlloc(Length(HelpFile) + 1);
StrPCopy(pchrHelpFile, HelpFile);
WinHelp(Application.Handle, pchrHelpFile, HELP_CONTEXTPOPUP, ID);
StrDispose(pchrHelpFile);
end;
procedure HelpContextPopup(const HelpFile: string; const ID: Integer);
var
pchrHelpFile: PChar;
begin
pchrHelpFile := StrAlloc(Length(HelpFile) + 1);
StrPCopy(pchrHelpFile, HelpFile);
WinHelp(Application.Handle, pchrHelpFile, HELP_CONTEXTPOPUP, ID);
StrDispose(pchrHelpFile);
end;
这条路走不通或不好走可以走其他路嘛。
procedure TForm1.Button1Click(Sender: Tobject);beginwinhelp(form1.clienthandle,'c:\media.hlp',help_contents,0);end;
procedure TForm1.Button2Click(Sender: Tobject);beginwinhelp(form1.clienthandle,'c:\media.hlp',help_key,0);end;