0

你好,我正在测试一个在 geckobrowser(Delphi 中的 gecko 组件)中加载 html 代码的函数。这里的功能

   procédure TCustomGeckoBrowser.LoadHTML (htmlCode: string);
 var
   domwindow: nsIDOMWindow;
    domdoc: nsIDOMDocument;
    domhtmldoc: nsIDOMHTMLDocument;
    nsstr: IInterfacedString;
begin
  domwindow: = GetContentWindow;
  domdoc: = GetContentDocument;
  domhtmldoc: = domdoc que nsIDOMHTMLDocument;

  nsstr: = nouvelleChaine;
  nsstr.Assign (htmlCode);
  domhtmldoc.Write (nsstr.AString);
end;

但程序显示“OLE ERROR 805303E8”类型的错误。我跟踪执行,发现问题出在这一行:domhtmldoc.Write (nsstr.AString) 在我的组件的接口中声明了函数“write”:

    nsIDOMHTMLDocument = interface(nsIDOMDocument)
      procedure Writeln(const text: nsAString); safecall;
    .....
    end;

你遇到过这样的错误吗?

4

1 回答 1

0

I used a temporary solution that needs to create a temporary file and then load do with the gecko. but with this solution, I can not make a step backwards.

that's why I seek another solution that allows me to make change on the webpage. thancks for your help

于 2011-04-15T07:51:38.843 回答