你可以把s存到一个htm文件里阿(比如通过memo)
然后用webbrower.navigate('filepath+filename')
就可以了阿
然后用webbrower.navigate('filepath+filename')
就可以了阿
解决方案 »
- delphi调用批处理bat时如何显示bat执行进度条
- 怎么样把查询后的某些字段的值赋值给水晶报表中的公式字段?
- 一个字符截取函数
- 大家看看!!!!
- 用TTreeView编了似资源管理器的树形目录,顶层“我的电脑”图标怎样取到?100分!
- 怎樣在dbgrid上動態地增加column?
- 寻找《delphi构建进销存系统--pos应用实例》一书所附光盘的源代码。
- 关于CreateProcess和子父窗体
- delphi中dbchart控件的共轴问题(急等,已经提问几次,均无人能解答)
- 谁能偷偷告诉我www.inprises.com的会员下载区的进入办法?
- 哪里有DELPHI 6 DOWN?
- DELPHI6使用中的小问题
void __fastcall SetHtmlSourceToControl(const AnsiString &HtmlSource)
{
HRESULT hr;
IPersistStreamInit *psi;
IStream *pContentStream;
HGLOBAL hMemHandle;
int SourceLength; //
SourceLength = HtmlSource.Length(); hr = WebBrowser->Document->QueryInterface(IID_IPersistStreamInit,(void**)&psi);
if(SUCCEEDED(hr))
{
hMemHandle = GlobalAlloc(GPTR,SourceLength);
CopyMemory((PVOID)hMemHandle,HtmlSource.c_str(),SourceLength); hr = CreateStreamOnHGlobal(hMemHandle,true,&pContentStream); if(SUCCEEDED(hr))
{
hr = psi->Load(pContentStream);
if(FAILED(hr))
SetStatus("出现错误:" + SysErrorMessage(hr));
}
else
SetStatus("出现错误:" + SysErrorMessage(hr)); GlobalFree(hMemHandle);
psi->Release();
}
else
SetStatus("出现错误:" + SysErrorMessage(hr));
<html>
<head>
</head>
<body>
<pre id="myid">
<SCRIPT language="javascript">
<!--
myid.innerText="<html><h1>test</h1></html>"
// -->
</script>
</pre>
</body>
</html>