W
wyb_star
Unregistered / Unconfirmed
GUEST, unregistred user!
这是左轻候离线浏览器中的一段代码,谁能帮我改写成C++Builder的。
procedure TfrmMain.ShowHtml(Browser:TWebBrowser;content: string);
var
vv: Variant;
HTMLDocument: IHTMLDocument2;
begin
vv := VarArrayCreate([0,0],varVariant);
vv[0] := content;
HTMLDocument := browser.Document as IHTMLDocument2;
HTMLDocument.write(PSafeArray(TVarData(vv).VArray));
HTMLDocument.charset := 'gb2312';
HTMLDocument.close;
end;
procedure TfrmMain.ShowHtml(Browser:TWebBrowser;content: string);
var
vv: Variant;
HTMLDocument: IHTMLDocument2;
begin
vv := VarArrayCreate([0,0],varVariant);
vv[0] := content;
HTMLDocument := browser.Document as IHTMLDocument2;
HTMLDocument.write(PSafeArray(TVarData(vv).VArray));
HTMLDocument.charset := 'gb2312';
HTMLDocument.close;
end;