如何处理IE中的事件?(在线等待) 我用Ole的方式打开了Internet Explorer,请问我如何得到文档已经下载完毕的消息? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 再请教一下行吗?我是在VC下面用CreateInstance打开的IE,返回的是IWebBrowser2接口,我好像没有直接用到CHtmlView,该怎么办呢?谢过了! MSDN Home > MSDN Web & Internet Samples > Component DevelopmentObjvw sample HRESULT CObjVw::SetClientSite(IOleClientSite *pClientSite){ HRESULT hr = S_OK; if(NULL != pClientSite) { ATLTRACE(_T("SetClientSite called\n")); m_spClientSite = pClientSite; // This AddRefs the client site // if null, existing client site is released } else { //REMOVE: _ASSERT(0 != m_dwAdviseCookie); _ASSERT(m_spWebBrowser != NULL); ATLTRACE(_T("SetClientSite NULL called\n")); //REMOVE: hr = AtlUnadvise( m_spWebBrowser, __uuidof(SHDocVw::DWebBrowserEvents2), m_dwAdviseCookie ); IDispEventImpl<0, CObjVw, &__uuidof(SHDocVw::DWebBrowserEvents2), &LIBID_OBJVWLib, 1, 0>::DispEventUnadvise(m_spWebBrowser); m_spWebBrowser.Release(); return S_OK; } try { IServiceProviderPtr spSP((LPOLECLIENTSITE)m_spClientSite); if(NULL == spSP) return hr; spSP->QueryService(__uuidof(SHDocVw::IWebBrowserApp), __uuidof(SHDocVw::IWebBrowser2), (void**)&m_spWebBrowser); //REMOVE: hr = AtlAdvise(m_spWebBrowser, GetControllingUnknown(), __uuidof(SHDocVw::DWebBrowserEvents2), &m_dwAdviseCookie); IDispEventImpl<0, CObjVw, &__uuidof(SHDocVw::DWebBrowserEvents2), &LIBID_OBJVWLib, 1, 0>::DispEventAdvise(m_spWebBrowser); } catch(...) { return S_FALSE; } return hr;} 我明白了,太谢谢你了!你真牛!Thanks Again! 【原创&交流】路径画刷的使用及其应用场合思考 字符串连接字符串用strcat,字符串连接单个字符用什么函数 我有软件要外包,找地点在福州的VC程序员 一起学习Dicom 在程序中如何设置对话框的Caption! 有谁知道这个原理 是否有检测源程序代码质量的工具 毕业设计的问题?怎么修改? 一个dialog上有一个static,如何得到这个static的cdc??? UAC权限问题 我在邮箱遭到攻击后束手无册!!! 请教两个菜问题
Objvw sample
HRESULT CObjVw::SetClientSite(IOleClientSite *pClientSite)
{
HRESULT hr = S_OK; if(NULL != pClientSite)
{
ATLTRACE(_T("SetClientSite called\n")); m_spClientSite = pClientSite; // This AddRefs the client site
// if null, existing client site is released
}
else
{
//REMOVE: _ASSERT(0 != m_dwAdviseCookie);
_ASSERT(m_spWebBrowser != NULL); ATLTRACE(_T("SetClientSite NULL called\n")); //REMOVE: hr = AtlUnadvise( m_spWebBrowser, __uuidof(SHDocVw::DWebBrowserEvents2), m_dwAdviseCookie );
IDispEventImpl<0, CObjVw, &__uuidof(SHDocVw::DWebBrowserEvents2),
&LIBID_OBJVWLib, 1, 0>::DispEventUnadvise(m_spWebBrowser);
m_spWebBrowser.Release(); return S_OK;
}
try
{
IServiceProviderPtr spSP((LPOLECLIENTSITE)m_spClientSite); if(NULL == spSP)
return hr; spSP->QueryService(__uuidof(SHDocVw::IWebBrowserApp),
__uuidof(SHDocVw::IWebBrowser2), (void**)&m_spWebBrowser); //REMOVE: hr = AtlAdvise(m_spWebBrowser, GetControllingUnknown(), __uuidof(SHDocVw::DWebBrowserEvents2), &m_dwAdviseCookie);
IDispEventImpl<0, CObjVw, &__uuidof(SHDocVw::DWebBrowserEvents2),
&LIBID_OBJVWLib, 1, 0>::DispEventAdvise(m_spWebBrowser); }
catch(...)
{
return S_FALSE;
} return hr;
}