用chtmlview做的浏览器,为什么可以得到text文本域的值,也可以赋值到页面,其他的都得不到值,像button,select,hidden,一个都得不到,如果把页面上的hidden改为text,就可以得到这个值了,这是什么问题,用的是vc6.0的,不知道是不是有什么限制,以前好像可以得到的,msdn上说也是可以的,况且有这个方法if ( hr == S_OK )
{
BSTR bstr;
hr = pElem->get_tagName(&bstr);
CString strTag = bstr;
AfxMessageBox("strTag1re="+strTag);
BSTR bString;
IHTMLInputTextElement* ptagno;
hr = pDisp->QueryInterface(
IID_IHTMLInputTextElement,
(void **) &ptagno );
if ( hr == S_OK )
{
//AfxMessageBox("re");
//tagNo
ptagno->get_name(&bstr);
strTag = bstr;
AfxMessageBox("strTagr="+strTag);
if(strTag == "re") {
//得到值
ptagno->get_value(&bString);
re = bString;
AfxMessageBox("re="+re);
ptagno->Release();
getStr = "";
}
}
}if ( hr == S_OK )
{
BSTR bstr;
hr = pElem->get_tagName(&bstr);
CString strTag = bstr;
AfxMessageBox("strTag1select="+strTag);
BSTR bString;
IHTMLInputHiddenElement* ptagno;
hr = pDisp->QueryInterface(
IID_IHTMLInputHiddenElement,
(void **) &ptagno );
if ( hr == S_OK )
{
ptagno->get_name(&bstr);
strTag = bstr;
AfxMessageBox("strTagse="+strTag);
if(strTag == "printQuantity") {
//得到值
ptagno->get_value(&bString);
re = bString;
AfxMessageBox("printQuantity="+re);
ptagno->Release();
getStr = "";
}
}
}
{
BSTR bstr;
hr = pElem->get_tagName(&bstr);
CString strTag = bstr;
AfxMessageBox("strTag1re="+strTag);
BSTR bString;
IHTMLInputTextElement* ptagno;
hr = pDisp->QueryInterface(
IID_IHTMLInputTextElement,
(void **) &ptagno );
if ( hr == S_OK )
{
//AfxMessageBox("re");
//tagNo
ptagno->get_name(&bstr);
strTag = bstr;
AfxMessageBox("strTagr="+strTag);
if(strTag == "re") {
//得到值
ptagno->get_value(&bString);
re = bString;
AfxMessageBox("re="+re);
ptagno->Release();
getStr = "";
}
}
}if ( hr == S_OK )
{
BSTR bstr;
hr = pElem->get_tagName(&bstr);
CString strTag = bstr;
AfxMessageBox("strTag1select="+strTag);
BSTR bString;
IHTMLInputHiddenElement* ptagno;
hr = pDisp->QueryInterface(
IID_IHTMLInputHiddenElement,
(void **) &ptagno );
if ( hr == S_OK )
{
ptagno->get_name(&bstr);
strTag = bstr;
AfxMessageBox("strTagse="+strTag);
if(strTag == "printQuantity") {
//得到值
ptagno->get_value(&bString);
re = bString;
AfxMessageBox("printQuantity="+re);
ptagno->Release();
getStr = "";
}
}
}
<input type="text" name="re" id="re" value="111">
<input type="hidden" name="printQuantity" id="printQuantity" value="222">