@@ -361,7 +361,7 @@ namespace DM
361361 break ;
362362 }
363363
364- DMComQIPtr<IPersistStreamInit> spPSI = spControl;
364+ DMComQIPtr<IPersistStreamInit> spPSI = (DMComQIPtr<IPersistStreamInit>&) spControl;
365365 if (spPSI != NULL )
366366 {
367367 if (pStream != NULL )
@@ -390,7 +390,7 @@ namespace DM
390390 break ;
391391 }
392392
393- DMComQIPtr<IPersistStreamInit> spPSI = m_spControl;
393+ DMComQIPtr<IPersistStreamInit> spPSI = (DMComQIPtr<IPersistStreamInit>&) m_spControl;
394394 if (spPSI != NULL )
395395 {
396396 if (pStream != NULL )
@@ -435,7 +435,7 @@ namespace DM
435435 if (m_dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)
436436 {
437437 hr = spOleObject->SetClientSite (static_cast <IOleClientSite*>(this ));
438- DMComQIPtr<IOleWindow> ole_window = m_spGitControl;
438+ DMComQIPtr<IOleWindow> ole_window = (DMComQIPtr<IOleWindow>&) m_spGitControl;
439439 HWND hWnd = NULL ;
440440 ole_window->GetWindow (&hWnd);
441441
@@ -477,7 +477,7 @@ namespace DM
477477 if (m_dwMiscStatus & OLEMISC_SETCLIENTSITEFIRST)
478478 {
479479 hr = m_spOleObject->SetClientSite (static_cast <IOleClientSite*>(this ));
480- DMComQIPtr<IOleWindow> ole_window = m_spControl;
480+ DMComQIPtr<IOleWindow> ole_window = (DMComQIPtr<IOleWindow>&) m_spControl;
481481 HWND hWnd = NULL ;
482482 ole_window->GetWindow (&hWnd);
483483
@@ -1223,7 +1223,7 @@ namespace DM
12231223 {
12241224 // todo.
12251225 }
1226- DMComQIPtr<IAdviseSink> advise_sink = m_spGitControl;
1226+ DMComQIPtr<IAdviseSink> advise_sink = (DMComQIPtr<IAdviseSink>&) m_spGitControl;
12271227 m_spGitOleObject->Advise (advise_sink, &m_dwOleObjSink);
12281228
12291229 if (m_spGitViewObject)
@@ -1257,7 +1257,7 @@ namespace DM
12571257 m_dwViewObjectType = 1 ;
12581258 }
12591259 }
1260- DMComQIPtr<IAdviseSink> advise_sink = m_spControl;
1260+ DMComQIPtr<IAdviseSink> advise_sink = (DMComQIPtr<IAdviseSink>&) m_spControl;
12611261 m_spOleObject->Advise (advise_sink, &m_dwOleObjSink);
12621262
12631263 if (m_spViewObject)
0 commit comments