From e3fb7ba8a98aca516e52705e2fe5ba7cc5841c8e Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Thu, 3 Jan 2008 16:38:01 +0100 Subject: [PATCH] shdocvw: Added OnObjectAvailable implementation. --- dlls/shdocvw/navigate.c | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/shdocvw/navigate.c b/dlls/shdocvw/navigate.c index 4fff84a821d..43aa3b25277 100644 --- a/dlls/shdocvw/navigate.c +++ b/dlls/shdocvw/navigate.c @@ -232,8 +232,36 @@ static HRESULT WINAPI BindStatusCallback_OnObjectAvailable(IBindStatusCallback * REFIID riid, IUnknown *punk) { BindStatusCallback *This = BINDSC_THIS(iface); - FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), punk); - return E_NOTIMPL; + IOleObject *oleobj; + HRESULT hres; + + TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), punk); + + IUnknown_AddRef(punk); + This->doc_host->document = punk; + + hres = IUnknown_QueryInterface(punk, &IID_IOleObject, (void**)&oleobj); + if(SUCCEEDED(hres)) { + CLSID clsid; + + hres = IOleObject_GetUserClassID(oleobj, &clsid); + if(SUCCEEDED(hres)) + TRACE("Got clsid %s\n", + IsEqualGUID(&clsid, &CLSID_HTMLDocument) ? "CLSID_HTMLDocument" : debugstr_guid(&clsid)); + + hres = IOleObject_SetClientSite(oleobj, CLIENTSITE(This->doc_host)); + if(FAILED(hres)) + FIXME("SetClientSite failed: %08x\n", hres); + + /* FIXME: Call SetAdvise */ + /* FIXME: Call Invoke(DISPID_READYSTATE) */ + }else { + FIXME("Could not get IOleObject iface: %08x\n", hres); + } + + PostMessageW(This->doc_host->hwnd, WB_WM_NAVIGATE2, 0, 0); + + return S_OK; } #undef BSC_THIS