在delphi中调用*.chm帮助文档,它说*.chm不是帮助文档文件或或文件被破坏的错误.
怎么办????

解决方案 »

  1.   

    //说明hhctrl.ocx系统自带的
    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls,shellapi;type
      TForm1 = class(TForm)
        Button1: TButton;
        Button2: TButton;
        procedure Button1Click(Sender: TObject);
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;var
      Form1: TForm1;implementation
    function  HtmlHelpA(Handle:HWND;lpHelpFile:string;wCommand:integer;dwData:string):Integer;stdcall;External 'hhctrl.ocx';
    {$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShellExecute(handle, 'open', 'KIme.chm',nil,nil, SW_SHOWMAXIMIZED);
    end;procedure TForm1.Button2Click(Sender: TObject);
    begin
    HtmlhelpA(form1.handle,'KIme.chm',0,'');
    end;end.