반응형
우와 너무함.. 이것 때문에... 몇시간을 삽질을 했네요.
IWebBrowser2* CSLCtrl::GetIWebPointer()
{
// TODO: Replace the following code with your own drawing code.
HRESULT hr ;
IOleContainer *pIContainer = NULL ;
IWebBrowser2 *pIWeb = NULL ;
IServiceProvider *pISP = NULL ;
// Get IOleClientSite interface pointer.
LPOLECLIENTSITE pIClientSite = GetClientSite() ;
pIClientSite->AddRef(); <---------------- 요거 한줄 안넣다고...익스플로어에서 불규칙적으로 에러가 남ㅠㅠ
// Get IOleContainer interface poineter.
hr = pIClientSite->GetContainer(&pIContainer) ;
if (hr != S_OK) {
pIClientSite->Release() ;
return NULL ;
}
// Get IServiceProvider interface pointer.
hr = pIClientSite->QueryInterface(IID_IServiceProvider,(void **)&pISP) ;
if (hr != S_OK) {
pIContainer->Release() ;
pIClientSite->Release() ;
return NULL ; }
// Get IWebBrowser2 interface pointer.
hr = pISP->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void**)&pIWeb) ;
if (hr != S_OK) {
pIContainer->Release() ;
pIClientSite->Release() ;
pISP->Release() ;
return NULL ;
}
// release interface.
pIContainer->Release() ;
pIClientSite->Release() ;
pISP->Release() ;
return pIWeb ;
}
이것떄문에 삽질...
void CSLPropPage::OnClose()
{
// TODO: Add your message handler code here and/or call default
if (m_pParent->m_pIWeb)
{
m_pParent->m_pIWeb->Quit();
}
COlePropertyPage::OnClose();
}
void CSLPropPage::OnDestroy()
{
COlePropertyPage::OnDestroy();
if(m_pParent->m_pIWeb)
{
m_pParent->m_pIWeb->Release();
}
}
IWebBrowser2* CSLCtrl::GetIWebPointer()
{
// TODO: Replace the following code with your own drawing code.
HRESULT hr ;
IOleContainer *pIContainer = NULL ;
IWebBrowser2 *pIWeb = NULL ;
IServiceProvider *pISP = NULL ;
// Get IOleClientSite interface pointer.
LPOLECLIENTSITE pIClientSite = GetClientSite() ;
pIClientSite->AddRef(); <---------------- 요거 한줄 안넣다고...익스플로어에서 불규칙적으로 에러가 남ㅠㅠ
// Get IOleContainer interface poineter.
hr = pIClientSite->GetContainer(&pIContainer) ;
if (hr != S_OK) {
pIClientSite->Release() ;
return NULL ;
}
// Get IServiceProvider interface pointer.
hr = pIClientSite->QueryInterface(IID_IServiceProvider,(void **)&pISP) ;
if (hr != S_OK) {
pIContainer->Release() ;
pIClientSite->Release() ;
return NULL ; }
// Get IWebBrowser2 interface pointer.
hr = pISP->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void**)&pIWeb) ;
if (hr != S_OK) {
pIContainer->Release() ;
pIClientSite->Release() ;
pISP->Release() ;
return NULL ;
}
// release interface.
pIContainer->Release() ;
pIClientSite->Release() ;
pISP->Release() ;
return pIWeb ;
}
이것떄문에 삽질...
void CSLPropPage::OnClose()
{
// TODO: Add your message handler code here and/or call default
if (m_pParent->m_pIWeb)
{
m_pParent->m_pIWeb->Quit();
}
COlePropertyPage::OnClose();
}
void CSLPropPage::OnDestroy()
{
COlePropertyPage::OnDestroy();
if(m_pParent->m_pIWeb)
{
m_pParent->m_pIWeb->Release();
}
}
본 게시물이 도움이 되었다면, 꾸~욱~ 눌러주세요.
포스팅 하는데 많은 힘이 됩니다~~~
반응형
'Programming > MFC-C++' 카테고리의 다른 글
AR 구현 관련 자료 (0) | 2012.11.06 |
---|---|
[Kinect] 설치 방법 (0) | 2012.05.10 |
[Kinect] 자료 모음 (0) | 2012.05.10 |
random 데이터 생성 (2) | 2012.04.05 |
템플릿(Templete) 프로그래밍 (0) | 2011.10.23 |