CHtmlView访问文件内部资源与innerHTML演示代码例子......
1、访问文件内部资源
void CInerHTMLView::OnRes()
{
// TODO: Add your command handler code here
//--资源访问
CString s;
s.Format("res://%s.exe/%d", ::AfxGetAppName(), IDR_HTML1);
Navigate2(s);
}
2、innerHTML操作内存中的HTML
void CInerHTMLView::OnTest()
{
// TODO: Add your command handler code here
CInternetSession session;
//CStdioFile* file = session.OpenURL("");
CStdioFile* file = session.OpenURL("");
CString s = "";
if (file)
{
char buf[1024] = {0};
while (file->Read(buf, sizeof(buf)) > 0) s += buf;
delete file;
}
...
}
[代码性质]
VC可重用代码段
[代码作者] f310@263.net
[文件大小] 42K
[更新日期] 2004-5-11 9:00:00
[下载次数] 3301
--------------------next---------------------
阅读(290) | 评论(0) | 转发(0) |