//直接在WebBrowser中显示字符串
procedure ShowInWebBrowser(WebB:TWebBrowser;Str:String);
var
v: Variant;
HTMLDocument: IHTMLDocument2;
begin
HTMLDocument := WebB.Document as IHTMLDocument2;
if (assigned(HtmlDocument)) then begin
v := VarArrayCreate([0, 0], varVariant);
v[0] := str; //that is to be shown
HTMLDocument.Write(PSafeArray(TVarData(v).VArray));
HTMLDocument.Close;
end;
end;

posted on 2004-11-11 22:03  flanker27  阅读(297)  评论(0)    收藏  举报