MFC 使用active插件 webbroswer 执行问题

void CtestwebbsrDlg::OnBnClickedButton1()
{   
    //获取WebBrowser的Document对象
        CComPtr<IHTMLDocument2> pDoc2 = xxxxxx;
        //查询IHTMLDocument3接口
        CComPtr<IHTMLDocument3> pDoc3 = NULL;
        pDoc2->QueryInterface(IID_IHTMLDocument3, (void **)&pDoc3);
        //用getElementsByTagName获取指定标签的所有元素
        CComPtr<IHTMLElementCollection> pCollection = NULL;
        pDoc3->getElementsByTagName((CComBSTR)_T("A"), &pCollection);
        long nCount = 0;
        pCollection->get_length(&nCount);//元素数量
        //循环,遍历所有元素
        CComPtr<IHTMLElement> pElement = NULL;
        for (long i = 0; i < nCount; i++)
        {
            _variant_t index = i;
            pCollection->item(index, index, &spDispatch);
            spDispatch->QueryInterface(IID_IHTMLElement, (void **)&pElement);
            if (pElement)
            {
                pElement->get_innerTEXT(&bstr);    //元素文本           
                CString strText = CString(bstr);
                if (strText == _T("离线下载"))//对比文本是不是我们要的
                {
                    //执行点击操作
                    pElement->click(); //  代码执行到这没有立即生效 页面没有反应
                }
                pElement.Release();
                pElement = NULL;
            }
            spDispatch.Release();
            spDispatch = NULL;
        }
        ....这里需要执行其他的一些操作
}// 这个按钮响应完全结束后 页面才开始执行 刚才的操作

我获取到一个按钮的IHTMLElement接口后,执行click操作,页面没有立即执行,等到btn整体执行后 才会执行,但是我还要执行其他的操作是建立在这个,按钮被点击之后基础上的,。
求大神指点指点