该如何实现通过不同的按钮调用到不同.htm帮助页面?

解决方案 »

  1.   

    procedure LoadHelp(AClassName:string);
    var qry:tadoquery;
    begin
      if not FileExists(GetCurrExeDIR + '帮助文件~~.chm') then
      begin
        ErrMsg('帮助文件"帮助文件~~.chm"不存在!');
        exit;
      end;
      
      if Aclassname='' then
      begin
        infomsg('无相关帮助信息!');
        exit;
      end;
      qry:=tadoquery.Create(application);
      qry.Connection:=dm.ADOConn;
      qry.sql.text:='select * from helplink where classname like '+QuotedStr('%'+Aclassname+'%');
      qry.open;
      if qry.IsEmpty then
        ShellExecute(Application.Handle,nil,PChar(GetCurrExeDIR + '帮助文件~~.chm'),nil,nil,SW_SHOWNORMAL)
      else
        WinExec(PChar('HH '+
                      GetCurrExeDIR + '帮助文件~~.chm'+
                      '::/'+
                      qry.fieldbyname('folder').asstring+
                      qry.fieldbyname('helpcontent').asstring ),SW_SHOWNORMAL);
      qry.free;
    end;
      

  2.   

    to Parmy(美美): 
       能不能给点解释
      

  3.   

    按照以上的方法,需要在uses中使用哪些单元?