是的,已经打开了啊! 但加入上面的代码就会编译出错: E:\TEST\yycHtml\yycHtmlView.cpp(75) : error C2227: left of '->IHTMLDocument2' must point to class/struct/union E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2653: 'IHTMLDocument2' : is not a class or namespace name E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2065: 'QueryInterface' : undeclared identifier E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2065: 'IHTMLDocument3' : undeclared identifier E:\TEST\yycHtml\yycHtmlView.cpp(76) : warning C4552: '>' : operator has no effect; expected operator with side-effect E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2653: 'IHTMLDocument3' : is not a class or namespace name E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2065: 'getElementById' : undeclared identifier E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2065: 'IHTMLElement' : undeclared identifier...
<html>
<head>
<script ...>
window.onload = function() {
document.all.path.innerText = document.URL; // 替换div标签中的内容为当前文档的路径
}
</script>
</head>
<body>
<div id=path>路径将显示在这儿</div>
</body>
</html>
<html>
<head>
<script ...>
window.onload = function() {
document.all.path.innerText = document.URL; // 替换div标签中的内容为当前文档的路径
}
</script>
</head>
<body>
<div id=path>路径将显示在这儿 </div>
</body>
</html>
把路径值放到上面所指的地方,不行啊...
GetModuleFileName(NULL, szpath, MAX_PATH);this->GetDocument --> IHTMLDocument2
IHTMLDocument2::QueryInterface --> IHTMLDocument3
IHTMLDocument3::getElementById("path") --> IHTMLElement
IHTMLElement::put_innerText(szpath)
TCHAR szpath[MAX_PATH] = _T("");
GetModuleFileName(NULL, szpath, MAX_PATH); this->GetDocument --> IHTMLDocument2
IHTMLDocument2::QueryInterface --> IHTMLDocument3
IHTMLDocument3::getElementById("path") --> IHTMLElement
IHTMLElement::put_innerText(szpath)
上面的代码应放在哪里呢?
我吧他放在view的OnInitialUpdate()里,报错了啊赐教啊
但加入上面的代码就会编译出错:
E:\TEST\yycHtml\yycHtmlView.cpp(75) : error C2227: left of '->IHTMLDocument2' must point to class/struct/union
E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2653: 'IHTMLDocument2' : is not a class or namespace name
E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2065: 'QueryInterface' : undeclared identifier
E:\TEST\yycHtml\yycHtmlView.cpp(76) : error C2065: 'IHTMLDocument3' : undeclared identifier
E:\TEST\yycHtml\yycHtmlView.cpp(76) : warning C4552: '>' : operator has no effect; expected operator with side-effect
E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2653: 'IHTMLDocument3' : is not a class or namespace name
E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2065: 'getElementById' : undeclared identifier
E:\TEST\yycHtml\yycHtmlView.cpp(77) : error C2065: 'IHTMLElement' : undeclared identifier...
分数不够,另开贴奉上,再不够就有情后感,以后补上!先谢过了!