请教在VC中怎么用WebBrowser控件查找所打开的网页中的内容呢

请问在VC中如何用WebBrowser控件查找所打开的网页中的内容呢?
我定义了:
CWebBrowser2 m_internetexplorer;

对于打开的网页,我想查找其中特定的文本,
是用m_internetexplorer.GetDocument()吗?
该怎么使用啊?我这样的不行呃...

void   CMyWebDlg::OnFindtext()  
{
//   TODO:   Add   your   command   handler   code   here
if(m_internetexplorer.GetDocument()==(IDispatch   *) "控件 ")
MessageBox( "OK ");
else
MessageBox( "NO ");

}
但是结果是,明明打开的网页上有 "控件 "两个字,却仍然提示 "NO ",
不知道这样做对吗?

希望高手们能给点指点啊~~
谢谢!

------解决方案--------------------
先用CWebBrowser2得到IHTMLDocument2指针,然后用get_all得到所有元素的集合,再用item(元素name,...)查找你所要的内容。不知道你所说的“控件”具体是什么类型的元素,下面举例查找input元素:
<input type= "text " name= "myName " value= "控件 " maxlength= "15 ">
代码如下:
CComQIPtr <IHTMLDocument2,&IID_IHTMLDocument2> spHTML=NULL;
CComQIPtr < IHTMLElementCollection > spElementCollection;
CComPtr < IDispatch > spDisp;
CComQIPtr < IHTMLInputTextElement > spInputText;
//CComQIPtr < IHTMLInputButtonElement > spInputButton;
//CComQIPtr < IHTMLInputHiddenElement > spInputHidden;
//......

spHTML = m_ctrlWeb.GetDocument();
if(spHTML)
{
spHTML-> get_all(&spElementCollection);
if(spElementCollection)
{
spElementCollection-> item(CComVariant(CComBSTR( "myName ")),CComVariant(),&spDisp);
spInputText = spDisp;
if(spInputText)
{
CComBSTR val;
spInputText-> get_value(&val);
CString sVal = OLE2A(val.bstrVal);
if(sVal== "控件 ")
MessageBox( "OK ");
else
MessageBox( "NO ");
}
}
}


------解决方案--------------------
up2u