想实现的功能:
    分割view视图,一个显示网页,一个显示该网页中的文本框内容.显示网页已经做好,通过view继承CHtmlView得到的(doc是继承CDocument).显示文本框内容搞不定哦,我的代码如下(代码从网上找来,不太懂,编译通过,运行出问题了,请高手指教.我刚学vc,还望大侠一点说的细):
    IHTMLDocument2* pIHTMLDocument2 = (IHTMLDocument2 *)GetDocument(); HRESULT hr; CString output = "";
CComBSTR bstrTitle;
pIHTMLDocument2->get_title( &bstrTitle ); //取得文档标题 USES_CONVERSION;// cout << _T("开始枚举“") << OLE2CT( bstrTitle ) << _T("”的表单") << endl; CComQIPtr< IHTMLElementCollection > spElementCollection;
hr = pIHTMLDocument2->get_forms( &spElementCollection ); //取得表单集合
if ( FAILED( hr ) )
{
MessageBox("error");
return;
} long nFormCount=0; //取得表单数目
hr = spElementCollection->get_length( &nFormCount );
if ( FAILED( hr ) )
{
MessageBox("获取表单数目错误"); return;
}

for(long i=0; i<nFormCount; i++)
{
IDispatch *pDisp = NULL; //取得第 i 项表单
hr = spElementCollection->item( CComVariant( i ), CComVariant(), &pDisp );
if ( FAILED( hr ) ) continue; CComQIPtr< IHTMLFormElement > spFormElement = pDisp;
pDisp->Release(); long nElemCount=0; //取得表单中 域 的数目
hr = spFormElement->get_length( &nElemCount );
if ( FAILED( hr ) ) continue; for(long j=0; j<nElemCount; j++)
{
CComDispatchDriver spInputElement; //取得第 j 项表单域
hr = spFormElement->item( CComVariant( j ), CComVariant(), &spInputElement );
if ( FAILED( hr ) ) continue; CComVariant vName,vVal,vType; //取得表单域的 名,值,类型
hr = spInputElement.GetPropertyByName( L"name", &vName );
if( FAILED( hr ) ) continue;
hr = spInputElement.GetPropertyByName( L"value", &vVal );
if( FAILED( hr ) ) continue;
hr = spInputElement.GetPropertyByName( L"type", &vType );
if( FAILED( hr ) ) continue; LPCTSTR lpName = vName.bstrVal?
OLE2CT( vName.bstrVal ) : _T("NULL"); //未知域名
LPCTSTR lpVal  = vVal.bstrVal?
OLE2CT( vVal.bstrVal  ) : _T("NULL"); //空值,未输入
LPCTSTR lpType = vType.bstrVal?
OLE2CT( vType.bstrVal ) : _T("NULL"); //未知类型 MessageBox(lpName); }
//想提交这个表单吗?删除下面语句的注释吧
//pForm->submit();
}