shdocvw: Move more initialization code to DocHost_Init.

This commit is contained in:
Jacek Caban 2006-04-19 20:31:11 +02:00 committed by Alexandre Julliard
parent c355574d4f
commit b26ed16633
3 changed files with 8 additions and 7 deletions

View File

@ -478,16 +478,19 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
DocHostUIHandler_GetOverrideKeyPath
};
void DocHost_Init(DocHost *This)
void DocHost_Init(DocHost *This, IDispatch *disp)
{
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
This->disp = disp;
This->document = NULL;
This->hostui = NULL;
This->hwnd = NULL;
This->frame_hwnd = NULL;
This->url = NULL;
DocHost_ClientSite_Init(This);
DocHost_Frame_Init(This);
@ -498,4 +501,6 @@ void DocHost_Release(DocHost *This)
{
DocHost_ClientSite_Release(This);
DocHost_Events_Release(This);
SysFreeString(This->url);
}

View File

@ -153,7 +153,7 @@ void WebBrowser_HlinkFrame_Init(WebBrowser*);
void WebBrowser_OleObject_Destroy(WebBrowser*);
void DocHost_Init(DocHost*);
void DocHost_Init(DocHost*,IDispatch*);
void DocHost_ClientSite_Init(DocHost*);
void DocHost_Events_Init(DocHost*);
void DocHost_Frame_Init(DocHost*);

View File

@ -132,7 +132,6 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
WebBrowser_OleObject_Destroy(This);
SysFreeString(This->doc_host.url);
HeapFree(GetProcessHeap(), 0, This);
SHDOCVW_UnlockModule();
}
@ -844,10 +843,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
ret->ref = 0;
ret->doc_host.url = NULL;
ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret);
DocHost_Init(&ret->doc_host);
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
WebBrowser_OleObject_Init(ret);
WebBrowser_ViewObject_Init(ret);