Commit d4da27ae authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Added WebBrowser::Invoke implementation.

parent 3d1627f6
......@@ -212,6 +212,7 @@ extern void register_iewindow_class(void);
extern void unregister_iewindow_class(void);
HRESULT register_class_object(BOOL);
HRESULT get_typeinfo(ITypeInfo**);
/* memory allocation functions */
......
......@@ -40,6 +40,30 @@ LONG SHDOCVW_refCount = 0;
HINSTANCE shdocvw_hinstance = 0;
static HMODULE SHDOCVW_hshell32 = 0;
static ITypeInfo *wb_typeinfo = NULL;
HRESULT get_typeinfo(ITypeInfo **typeinfo)
{
ITypeLib *typelib;
HRESULT hres;
if(wb_typeinfo) {
*typeinfo = wb_typeinfo;
return S_OK;
}
hres = LoadRegTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, &typelib);
if(FAILED(hres)) {
ERR("LoadRegTypeLib failed: %08lx\n", hres);
return hres;
}
hres = ITypeLib_GetTypeInfoOfGuid(typelib, &IID_IWebBrowser2, &wb_typeinfo);
ITypeLib_Release(typelib);
*typeinfo = wb_typeinfo;
return hres;
}
/*************************************************************************
* SHDOCVW DllMain
......@@ -56,6 +80,8 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID fImpLoad)
case DLL_PROCESS_DETACH:
if (SHDOCVW_hshell32) FreeLibrary(SHDOCVW_hshell32);
unregister_iewindow_class();
if(wb_typeinfo)
ITypeInfo_Release(wb_typeinfo);
break;
}
return TRUE;
......
......@@ -172,9 +172,18 @@ static HRESULT WINAPI WebBrowser_Invoke(IWebBrowser2 *iface, DISPID dispIdMember
EXCEPINFO *pExepInfo, UINT *puArgErr)
{
WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%ld %s %ld %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
ITypeInfo *typeinfo;
HRESULT hres;
TRACE("(%p)->(%ld %s %ld %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
return E_NOTIMPL;
hres = get_typeinfo(&typeinfo);
if(FAILED(hres))
return hres;
return ITypeInfo_Invoke(typeinfo, WEBBROWSER2(This), dispIdMember, wFlags, pDispParams,
pVarResult, pExepInfo, puArgErr);
}
/* IWebBrowser methods */
......@@ -923,7 +932,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
WebBrowser *ret;
HRESULT hres;
TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv);
TRACE("(%p %s %p) version=%d\n", pOuter, debugstr_guid(riid), ppv, version);
ret = shdocvw_alloc(sizeof(WebBrowser));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment