shdocvw: Use OnObjectAvailable in http_load_hack.

This commit is contained in:
Jacek Caban 2008-01-03 16:38:44 +01:00 committed by Alexandre Julliard
parent e3fb7ba8a9
commit 6f1c3f3613
1 changed files with 10 additions and 17 deletions

View File

@ -466,8 +466,8 @@ static BOOL try_application_url(LPCWSTR url)
static HRESULT http_load_hack(DocHost *This, IMoniker *mon, IBindStatusCallback *callback, IBindCtx *bindctx) static HRESULT http_load_hack(DocHost *This, IMoniker *mon, IBindStatusCallback *callback, IBindCtx *bindctx)
{ {
IOleObject *oleobj;
IPersistMoniker *persist; IPersistMoniker *persist;
IUnknown *doc;
HRESULT hres; HRESULT hres;
/* /*
@ -478,40 +478,33 @@ static HRESULT http_load_hack(DocHost *This, IMoniker *mon, IBindStatusCallback
hres = CoCreateInstance(&CLSID_HTMLDocument, NULL, hres = CoCreateInstance(&CLSID_HTMLDocument, NULL,
CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER, CLSCTX_INPROC_SERVER|CLSCTX_INPROC_HANDLER,
&IID_IUnknown, (void**)&This->document); &IID_IUnknown, (void**)&doc);
if(FAILED(hres)) { if(FAILED(hres)) {
ERR("Could not create HTMLDocument: %08x\n", hres); ERR("Could not create HTMLDocument: %08x\n", hres);
return hres; return hres;
} }
hres = IUnknown_QueryInterface(This->document, &IID_IPersistMoniker, (void**)&persist); hres = IUnknown_QueryInterface(doc, &IID_IPersistMoniker, (void**)&persist);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
hres = IPersistMoniker_Load(persist, FALSE, mon, bindctx, 0); hres = IPersistMoniker_Load(persist, FALSE, mon, bindctx, 0);
IPersistMoniker_Release(persist); IPersistMoniker_Release(persist);
if(SUCCEEDED(hres))
hres = IBindStatusCallback_OnObjectAvailable(callback, &IID_IUnknown, doc);
else
WARN("Load failed: %08x\n", hres);
IUnknown_Release(doc);
if(This->frame) { if(This->frame) {
static const WCHAR empty[] = {0}; static const WCHAR empty[] = {0};
IOleInPlaceFrame_SetStatusText(This->frame, empty); /* FIXME */ IOleInPlaceFrame_SetStatusText(This->frame, empty); /* FIXME */
} }
if(FAILED(hres)) {
WARN("Load failed: %08x\n", hres);
return hres;
}
hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
if(FAILED(hres))
return hres;
hres = IOleObject_SetClientSite(oleobj, CLIENTSITE(This));
IOleObject_Release(oleobj);
PostMessageW(This->hwnd, WB_WM_NAVIGATE2, 0, 0);
return hres; return hres;
} }