这段代码怎么在delphi(bho)中编译,有例程最好
程序代码:
procedure WB_LoadHTML(webBrowser: TwebBrowser; HTMLCode: string); var sl: TStringList; ms: TMemoryStream; begin webBrowser.Navigate('about:blank'); if Assigned(webBrowser.Document) then begin sl := TStringList.Create; try ms := TMemoryStream.Create; try sl.Text := HTMLCode; sl.SaveToStream(ms); ms.Seek(0, 0); (webBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(ms)); finally ms.Free; end; finally sl.Free; end; end; end; procedure TForm1.Button1Click(Sender: TObject); begin WB_LoadHTML(webBrowser1,'<html><body bgcolor="#0099FF">SwissdelphiCenter</html>'); end