1>需要引用 webbrowser2.h,mshtml.h
//m_web绑定的webbrowser的变量 CComQIPtrd=m_web.GetDocument(); CComPtr c; d->get_all(&c); long len; c->get_length(&len); for(int i=0;i item(CComVariant(i),CComVariant(i),&p); CComQIPtr e=p; CComBSTR id; e->get_id(&id); //"txtName"要赋值的元素的id if(id==L"txtName"){ CComQIPtr kw=e; kw->put_value(CComBSTR("asdsa")); } }
程序员的基础教程: