Sync to Wine-0_9_2:
authorGé van Geldorp <ge@gse.nl>
Sat, 26 Nov 2005 09:40:12 +0000 (09:40 +0000)
committerGé van Geldorp <ge@gse.nl>
Sat, 26 Nov 2005 09:40:12 +0000 (09:40 +0000)
YunSong Hwang <hys545@dreamwiz.com>
- Update Korean translations.
- Add Korean translations.
Jacek Caban <jacek@codeweavers.com>
- Beginning implementation of Navigate2.
- Create window in SetClientSite and return it in
  IOleInPlaceSite::GetWindow.
- Added IOleInPlaceSite stub implementation.
- Free ConnectionPoint objects (fix memory leak).
- Added OLEIVERB_INPLACEACTIVATE implementation in IOleObject::DoVerb.
- Added stub implementation of IDocHostUIHandler.
- Added IViewObject2 stub implementation.
- Added GetHostInfo implementation.
- Improve IConnectionPoint handling.

svn path=/trunk/; revision=19617

12 files changed:
reactos/include/wine/debug.h
reactos/lib/shdocvw/Ko.rc
reactos/lib/shdocvw/client.c
reactos/lib/shdocvw/dochost.c [new file with mode: 0644]
reactos/lib/shdocvw/events.c
reactos/lib/shdocvw/oleobject.c
reactos/lib/shdocvw/persist.c
reactos/lib/shdocvw/shdocvw.h
reactos/lib/shdocvw/shdocvw.xml
reactos/lib/shdocvw/webbrowser.c
reactos/lib/uuid/uuid.c
reactos/w32api/include/mshtmhst.h [new file with mode: 0644]

index 80f7ca0..2433ead 100644 (file)
@@ -3,8 +3,8 @@
 
 #include "../roscfg.h"
 #include <stdarg.h>
-#include <windows.h>
-#include <wchar.h>
+#include <windef.h>
+#include <winnt.h>
 
 /* Add ROS Master debug functions if not added yet */
 #ifndef __INTERNAL_DEBUG
index 4929bc1..aa5effa 100644 (file)
@@ -30,7 +30,7 @@ FONT 8, "MS Shell Dlg"
 
 STRINGTABLE
 BEGIN
- 1001  "This application is requesting an ActiveX browser object\n" \
-        "but the Mozilla Active X control is currently not installed." \
-        "Do you wish to download and install it?"
+ 1001  "ÀÌ Ç®±×¸²Àº ¾×Ƽºê¿¢½º ºê¶ó¿ìÀú °´Ã¼¸¦ ¿ä±¸ÇÕ´Ï´Ù.\n" \
+        "±×·¯³ª ¸ðÁú¶ó ¾×Ƽºê ¿¢½º ÄÁÆ®·ÑÀÌ ÇöÀç ¼³Ä¡µÇ¾îÀÖÁö ¾Ê½À´Ï´Ù." \
+        "´ç½ÅÀº ´Ù¿î·ÎµåÇؼ­ ¼³Ä¡ÇÏ°Ú½À´Ï±î?"
 END
index bf8e768..d616b90 100644 (file)
@@ -16,7 +16,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define COBJMACROS
 #include "wine/debug.h"
 #include "shdocvw.h"
 
@@ -42,6 +41,12 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
     }else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
         TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppv);
         *ppv = INPLACESITE(This);
+    }else if(IsEqualGUID(&IID_IDocHostUIHandler, riid)) {
+        TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppv);
+        *ppv = DOCHOSTUI(This);
+    }else if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
+        TRACE("(%p)->(IID_IDocHostUIHandler2 %p)\n", This, ppv);
+        *ppv = DOCHOSTUI2(This);
     }
 
     if(*ppv) {
@@ -146,8 +151,11 @@ static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface)
 static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
 {
     WebBrowser *This = INPLACESITE_THIS(iface);
-    FIXME("(%p)->(%p)\n", This, phwnd);
-    return E_NOTIMPL;
+
+    TRACE("(%p)->(%p)\n", This, phwnd);
+
+    *phwnd = This->doc_view_hwnd;
+    return S_OK;
 }
 
 static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
diff --git a/reactos/lib/shdocvw/dochost.c b/reactos/lib/shdocvw/dochost.c
new file mode 100644 (file)
index 0000000..c8ef021
--- /dev/null
@@ -0,0 +1,217 @@
+/*
+ * Copyright 2005 Jacek Caban for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include "wine/debug.h"
+#include "shdocvw.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
+
+#define DOCHOSTUI_THIS(iface) DEFINE_THIS(WebBrowser, DocHostUIHandler, iface)
+
+static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface,
+                                                      REFIID riid, void **ppv)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
+}
+
+static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    return IOleClientSite_AddRef(CLIENTSITE(This));
+}
+
+static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    return IOleClientSite_Release(CLIENTSITE(This));
+}
+
+static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface,
+         DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%ld %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface,
+        DOCHOSTUIINFO *pInfo)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    IDocHostUIHandler *handler;
+    HRESULT hres;
+
+    TRACE("(%p)->(%p)\n", This, pInfo);
+
+    if(This->client) {
+        hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler, (void**)&handler);
+        if(SUCCEEDED(hres)) {
+            hres = IDocHostUIHandler_GetHostInfo(handler, pInfo);
+            IDocHostUIHandler_Release(handler);
+            if(SUCCEEDED(hres))
+                return hres;
+        }
+    }
+
+    pInfo->dwFlags = DOCHOSTUIFLAG_DISABLE_HELP_MENU | DOCHOSTUIFLAG_OPENNEWWIN
+        | DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 | DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION
+        | DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION;
+    return S_OK;
+}
+
+static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD dwID,
+        IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
+        IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%ld %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
+          pFrame, pDoc);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface,
+                                                      BOOL fEnable)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%x)\n", This, fEnable);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface,
+                                                           BOOL fActivate)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%x)\n", This, fActivate);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface,
+                                                             BOOL fActivate)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%x)\n", This, fActivate);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface,
+        LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p %p %X)\n", This, prcBorder, pUIWindow, fRameWindow);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface,
+        LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p %p %ld)\n", This, lpMsg, pguidCmdGroup, nCmdID);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface,
+        LPOLESTR *pchKey, DWORD dw)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p %ld)\n", This, pchKey, dw);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
+        IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)\n", This);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface,
+        IDispatch **ppDispatch)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppDispatch);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface,
+        DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%ld %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface,
+        IDataObject *pDO, IDataObject **ppDORet)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p %p)\n", This, pDO, ppDORet);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface,
+        LPOLESTR *pchKey, DWORD dw)
+{
+    WebBrowser *This = DOCHOSTUI_THIS(iface);
+    FIXME("(%p)->(%p %ld)\n", This, pchKey, dw);
+    return E_NOTIMPL;
+}
+
+#undef DOCHOSTUI_THIS
+
+static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
+    DocHostUIHandler_QueryInterface,
+    DocHostUIHandler_AddRef,
+    DocHostUIHandler_Release,
+    DocHostUIHandler_ShowContextMenu,
+    DocHostUIHandler_GetHostInfo,
+    DocHostUIHandler_ShowUI,
+    DocHostUIHandler_HideUI,
+    DocHostUIHandler_UpdateUI,
+    DocHostUIHandler_EnableModeless,
+    DocHostUIHandler_OnDocWindowActivate,
+    DocHostUIHandler_OnFrameWindowActivate,
+    DocHostUIHandler_ResizeBorder,
+    DocHostUIHandler_TranslateAccelerator,
+    DocHostUIHandler_GetOptionKeyPath,
+    DocHostUIHandler_GetDropTarget,
+    DocHostUIHandler_GetExternal,
+    DocHostUIHandler_TranslateUrl,
+    DocHostUIHandler_FilterDataObject,
+    DocHostUIHandler_GetOverrideKeyPath
+};
+
+void WebBrowser_DocHost_Init(WebBrowser *This)
+{
+    This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
+}
index 2fb6dc2..184b694 100644 (file)
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
 
-static IConnectionPointImpl SHDOCVW_ConnectionPoint;
+typedef struct {
+    const IConnectionPointVtbl *lpConnectionPointVtbl;
 
-static const GUID IID_INotifyDBEvents =
-    { 0xdb526cc0, 0xd188, 0x11cd, { 0xad, 0x48, 0x00, 0xaa, 0x00, 0x3c, 0x9c, 0xb6 } };
+    WebBrowser *webbrowser;
+
+    IID iid;
+} ConnectionPoint;
+
+#define CONPOINT(x)  ((IConnectionPoint*) &(x)->lpConnectionPointVtbl)
 
 /**********************************************************************
  * Implement the IConnectionPointContainer interface
@@ -70,27 +75,31 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
 {
     WebBrowser *This = CONPTCONT_THIS(iface);
 
-    FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppCP);
+    if(!ppCP) {
+        WARN("ppCP == NULL\n");
+        return E_POINTER;
+    }
 
-    /* For now, return the same IConnectionPoint object for both
-     * event interface requests.
-     */
-    if (IsEqualGUID (&IID_INotifyDBEvents, riid))
-    {
-        TRACE("Returning connection point %p for IID_INotifyDBEvents\n",
-              &SHDOCVW_ConnectionPoint);
-        *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
-        return S_OK;
+    *ppCP = NULL;
+
+    if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) {
+        TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP);
+        *ppCP = This->cp_wbe2;
+    }else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) {
+        TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP);
+        *ppCP = This->cp_wbe;
+    }else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
+        TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP);
+        *ppCP = This->cp_pns;
     }
-    else if (IsEqualGUID (&IID_IPropertyNotifySink, riid))
-    {
-        TRACE("Returning connection point %p for IID_IPropertyNotifySink\n",
-              &SHDOCVW_ConnectionPoint);
-        *ppCP = (LPCONNECTIONPOINT)&SHDOCVW_ConnectionPoint;
+
+    if(*ppCP) {
+        IConnectionPoint_AddRef(*ppCP);
         return S_OK;
     }
 
-    return E_FAIL;
+    WARN("Unsupported IID %s\n", debugstr_guid(riid));
+    return E_NOINTERFACE;
 }
 
 #undef CONPTCONT_THIS
@@ -109,97 +118,125 @@ static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl =
  * Implement the IConnectionPoint interface
  */
 
-static HRESULT WINAPI WBCP_QueryInterface(LPCONNECTIONPOINT iface,
-                                          REFIID riid, LPVOID *ppobj)
+#define CONPOINT_THIS(iface) DEFINE_THIS(ConnectionPoint, ConnectionPoint, iface)
+
+static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
+                                                     REFIID riid, LPVOID *ppv)
 {
-    FIXME("- no interface\n\tIID:\t%s\n", debugstr_guid(riid));
+    ConnectionPoint *This = CONPOINT_THIS(iface);
 
-    if (ppobj == NULL) return E_POINTER;
-    
-    return E_NOINTERFACE;
-}
+    *ppv = NULL;
 
-static ULONG WINAPI WBCP_AddRef(LPCONNECTIONPOINT iface)
-{
-    SHDOCVW_LockModule();
+    if(IsEqualGUID(&IID_IUnknown, riid)) {
+        TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
+        *ppv = CONPOINT(This);
+    }else if(IsEqualGUID(&IID_IConnectionPoint, riid)) {
+        TRACE("(%p)->(IID_IConnectionPoint %p)\n", This, ppv);
+        *ppv = CONPOINT(This);
+    }
 
-    return 2; /* non-heap based object */
+    if(*ppv) {
+        IWebBrowser2_AddRef(WEBBROWSER(This->webbrowser));
+        return S_OK;
+    }
+
+    WARN("Unsupported interface %s\n", debugstr_guid(riid));
+    return E_NOINTERFACE;
 }
 
-static ULONG WINAPI WBCP_Release(LPCONNECTIONPOINT iface)
+static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
 {
-    SHDOCVW_UnlockModule();
-
-    return 1; /* non-heap based object */
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+    return IWebBrowser2_AddRef(WEBBROWSER(This->webbrowser));
 }
 
-static HRESULT WINAPI WBCP_GetConnectionInterface(LPCONNECTIONPOINT iface, IID* pIId)
+static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
 {
-    FIXME("stub: %s\n", debugstr_guid(pIId));
-    return S_OK;
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+    return IWebBrowser2_Release(WEBBROWSER(This->webbrowser));
 }
 
-/* Get this connection point's owning container */
-static HRESULT WINAPI
-WBCP_GetConnectionPointContainer(LPCONNECTIONPOINT iface,
-                                 LPCONNECTIONPOINTCONTAINER *ppCPC)
+static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
 {
-    FIXME("stub: IConnectionPointContainer = %p\n", *ppCPC);
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+
+    TRACE("(%p)->(%p)\n", This, pIID);
+
+    memcpy(pIID, &This->iid, sizeof(IID));
     return S_OK;
 }
 
-/* Connect the pUnkSink event-handling implementation (in the control site)
- * to this connection point.  Return a handle to this connection in
- * pdwCookie (for later use in Unadvise()).
- */
-static HRESULT WINAPI WBCP_Advise(LPCONNECTIONPOINT iface,
-                                  LPUNKNOWN pUnkSink, DWORD *pdwCookie)
+static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoint *iface,
+        IConnectionPointContainer **ppCPC)
 {
-    static int new_cookie;
+    ConnectionPoint *This = CONPOINT_THIS(iface);
 
-    FIXME("stub: IUnknown = %p, connection cookie = %ld\n", pUnkSink, *pdwCookie);
-
-    *pdwCookie = ++new_cookie;
-    TRACE ("Returning cookie = %ld\n", *pdwCookie);
+    TRACE("(%p)->(%p)\n", This, ppCPC);
 
+    *ppCPC = CONPTCONT(This->webbrowser);
     return S_OK;
 }
 
-/* Disconnect this implementation from the connection point. */
-static HRESULT WINAPI WBCP_Unadvise(LPCONNECTIONPOINT iface,
-                                    DWORD dwCookie)
+static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *pUnkSink,
+                                             DWORD *pdwCookie)
 {
-    FIXME("stub: cookie to disconnect = %lx\n", dwCookie);
-    return S_OK;
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+    FIXME("(%p)->(%p %p)\n", This, pUnkSink, pdwCookie);
+    return E_NOTIMPL;
 }
 
-/* Get a list of connections in this connection point. */
-static HRESULT WINAPI WBCP_EnumConnections(LPCONNECTIONPOINT iface,
-                                           LPENUMCONNECTIONS *ppEnum)
+static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dwCookie)
 {
-    FIXME("stub: IEnumConnections = %p\n", *ppEnum);
-    return S_OK;
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+    FIXME("(%p)->(%ld)\n", This, dwCookie);
+    return E_NOTIMPL;
 }
 
-/**********************************************************************
- * IConnectionPoint virtual function table for IE Web Browser component
- */
+static HRESULT WINAPI ConnectionPoint_EnumConnections(IConnectionPoint *iface,
+                                                      IEnumConnections **ppEnum)
+{
+    ConnectionPoint *This = CONPOINT_THIS(iface);
+    FIXME("(%p)->(%p)\n", This, ppEnum);
+    return E_NOTIMPL;
+}
+
+#undef CONPOINT_THIS
 
-static const IConnectionPointVtbl WBCP_Vtbl =
+static const IConnectionPointVtbl ConnectionPointVtbl =
 {
-    WBCP_QueryInterface,
-    WBCP_AddRef,
-    WBCP_Release,
-    WBCP_GetConnectionInterface,
-    WBCP_GetConnectionPointContainer,
-    WBCP_Advise,
-    WBCP_Unadvise,
-    WBCP_EnumConnections
+    ConnectionPoint_QueryInterface,
+    ConnectionPoint_AddRef,
+    ConnectionPoint_Release,
+    ConnectionPoint_GetConnectionInterface,
+    ConnectionPoint_GetConnectionPointContainer,
+    ConnectionPoint_Advise,
+    ConnectionPoint_Unadvise,
+    ConnectionPoint_EnumConnections
 };
 
-static IConnectionPointImpl SHDOCVW_ConnectionPoint = {&WBCP_Vtbl};
+static void ConnectionPoint_Create(WebBrowser *wb, REFIID riid, IConnectionPoint **cp)
+{
+    ConnectionPoint *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ConnectionPoint));
+
+    ret->lpConnectionPointVtbl = &ConnectionPointVtbl;
+    ret->webbrowser = wb;
+    memcpy(&ret->iid, riid, sizeof(IID));
+
+    *cp = CONPOINT(ret);
+}
 
 void WebBrowser_Events_Init(WebBrowser *This)
 {
     This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl;
+
+    ConnectionPoint_Create(This, &DIID_DWebBrowserEvents2, &This->cp_wbe2);
+    ConnectionPoint_Create(This, &DIID_DWebBrowserEvents, &This->cp_wbe);
+    ConnectionPoint_Create(This, &IID_IPropertyNotifySink, &This->cp_pns);
+}
+
+void WebBrowser_Events_Destroy(WebBrowser *This)
+{
+    HeapFree(GetProcessHeap(), 0, This->cp_wbe2);
+    HeapFree(GetProcessHeap(), 0, This->cp_wbe);
+    HeapFree(GetProcessHeap(), 0, This->cp_pns);
 }
index a365885..f0dbeb3 100644 (file)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define COBJMACROS
 #include <string.h>
 #include "wine/debug.h"
 #include "shdocvw.h"
 
 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
 
+static ATOM doc_view_atom = 0;
+static ATOM shell_embedding_atom = 0;
+
+static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    return DefWindowProcA(hwnd, msg, wParam, lParam);
+}
+
+static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+    return DefWindowProcA(hwnd, msg, wParam, lParam);
+}
+
+static void create_doc_view_hwnd(WebBrowser *This)
+{
+    static const WCHAR wszShell_DocObject_View[] =
+        {'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0};
+
+    if(!doc_view_atom) {
+        static WNDCLASSEXW wndclass = {
+            sizeof(wndclass),
+            CS_PARENTDC,
+            doc_view_proc,
+            0, 0 /* native uses 4*/, NULL, NULL, NULL,
+            (HBRUSH)COLOR_WINDOWFRAME, NULL,
+            wszShell_DocObject_View,
+            NULL
+        };
+
+        wndclass.hInstance = shdocvw_hinstance;
+
+        doc_view_atom = RegisterClassExW(&wndclass);
+    }
+
+    This->doc_view_hwnd = CreateWindowExW(0, wszShell_DocObject_View, NULL,
+         WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
+         0, 0, 0, 0, This->shell_embedding_hwnd,
+         NULL, shdocvw_hinstance, This);
+}
+
+static void create_shell_embedding_hwnd(WebBrowser *This)
+{
+    IOleInPlaceSite *inplace;
+    HWND parent = NULL;
+    HRESULT hres;
+
+    static const WCHAR wszShellEmbedding[] =
+        {'S','h','e','l','l',' ','E','m','b','e','d','d','i','n','g',0};
+
+    if(!shell_embedding_atom) {
+        static WNDCLASSEXW wndclass = {
+            sizeof(wndclass),
+            CS_DBLCLKS,
+            shell_embedding_proc,
+            0, 0 /* native uses 8 */, NULL, NULL, NULL,
+            (HBRUSH)COLOR_WINDOWFRAME, NULL,
+            wszShellEmbedding,
+            NULL
+        };
+        wndclass.hInstance = shdocvw_hinstance;
+
+        RegisterClassExW(&wndclass);
+    }
+
+    hres = IOleClientSite_QueryInterface(This->client, &IID_IOleInPlaceSite, (void**)&inplace);
+    if(SUCCEEDED(hres)) {
+        IOleInPlaceSite_GetWindow(inplace, &parent);
+        IOleInPlaceSite_Release(inplace);
+    }
+
+    This->shell_embedding_hwnd = CreateWindowExW(0, wszShellEmbedding, NULL,
+         WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
+         0, 0, 0, 0, parent,
+         NULL, shdocvw_hinstance, This);
+
+    create_doc_view_hwnd(This);
+}
+
 /**********************************************************************
  * Implement the IOleObject interface for the WebBrowser control
  */
@@ -63,13 +140,22 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
     if(This->client == pClientSite)
         return S_OK;
 
+    if(This->doc_view_hwnd)
+        DestroyWindow(This->doc_view_hwnd);
+    if(This->shell_embedding_hwnd)
+        DestroyWindow(This->shell_embedding_hwnd);
+
     if(This->client)
         IOleClientSite_Release(This->client);
 
-    if(pClientSite)
-        IOleClientSite_AddRef(pClientSite);
-
     This->client = pClientSite;
+    if(!pClientSite)
+        return S_OK;
+    
+    IOleClientSite_AddRef(pClientSite);
+
+    create_shell_embedding_hwnd(This);
+
     return S_OK;
 }
 
@@ -177,6 +263,7 @@ static HRESULT WINAPI OleObject_DoVerb(IOleObject *iface, LONG iVerb, struct tag
                                          &This->pos_rect, &This->clip_rect,
                                          &This->frameinfo);
 
+
         IOleInPlaceSite_Release(inplace);
 
         if(This->client) {
@@ -508,7 +595,7 @@ void WebBrowser_OleObject_Init(WebBrowser *This)
 void WebBrowser_OleObject_Destroy(WebBrowser *This)
 {
     if(This->client)
-        IOleClientSite_Release(This->client);
+        IOleObject_SetClientSite(OLEOBJ(This), NULL);
     if(This->container)
         IOleContainer_Release(This->container);
     if(This->frame)
index 0b091ee..ce193f3 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define COBJMACROS
 #include "wine/debug.h"
 #include "shdocvw.h"
 
index f30fa7d..104f978 100644 (file)
@@ -35,6 +35,7 @@
 #include "olectl.h"
 #include "shlobj.h"
 #include "exdisp.h"
+#include "mshtmhst.h"
 
 /**********************************************************************
  * IClassFactory declaration for SHDOCVW.DLL
@@ -75,6 +76,7 @@ typedef struct {
 
     const IOleClientSiteVtbl            *lpOleClientSiteVtbl;
     const IOleInPlaceSiteVtbl           *lpOleInPlaceSiteVtbl;
+    const IDocHostUIHandler2Vtbl        *lpDocHostUIHandlerVtbl;
 
     LONG ref;
 
@@ -92,6 +94,15 @@ typedef struct {
     RECT pos_rect;
     RECT clip_rect;
     OLEINPLACEFRAMEINFO frameinfo;
+
+    HWND doc_view_hwnd;
+    HWND shell_embedding_hwnd;
+
+    /* Connection points */
+
+    IConnectionPoint *cp_wbe2;
+    IConnectionPoint *cp_wbe;
+    IConnectionPoint *cp_pns;
 } WebBrowser;
 
 #define WEBBROWSER(x)   ((IWebBrowser*)                 &(x)->lpWebBrowser2Vtbl)
@@ -109,6 +120,8 @@ typedef struct {
 
 #define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
 #define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
+#define DOCHOSTUI(x)    ((IDocHostUIHandler*)           &(x)->lpDocHostUIHandlerVtbl)
+#define DOCHOSTUI2(x)   ((IDocHostUIHandler2*)          &(x)->lpDocHostUIHandlerVtbl)
 
 void WebBrowser_OleObject_Init(WebBrowser*);
 void WebBrowser_ViewObject_Init(WebBrowser*);
@@ -118,21 +131,13 @@ void WebBrowser_Misc_Init(WebBrowser*);
 void WebBrowser_Events_Init(WebBrowser*);
 
 void WebBrowser_ClientSite_Init(WebBrowser*);
+void WebBrowser_DocHost_Init(WebBrowser*);
 
 void WebBrowser_OleObject_Destroy(WebBrowser*);
+void WebBrowser_Events_Destroy(WebBrowser*);
 
 HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
 
-/**********************************************************************
- * IConnectionPoint declaration for SHDOCVW.DLL
- */
-typedef struct
-{
-    /* IUnknown fields */
-    const IConnectionPointVtbl *lpVtbl;
-    LONG ref;
-} IConnectionPointImpl;
-
 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
 
 /**********************************************************************
@@ -142,4 +147,6 @@ extern LONG SHDOCVW_refCount;
 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
 
+extern HINSTANCE shdocvw_hinstance;
+
 #endif /* __WINE_SHDOCVW_H */
index 1332caf..8707dd0 100644 (file)
@@ -19,6 +19,7 @@
        <library>urlmon</library>
        <file>classinfo.c</file>
        <file>client.c</file>
+       <file>dochost.c</file>
        <file>events.c</file>
        <file>factory.c</file>
        <file>misc.c</file>
index 7f699a1..4ffb3c0 100644 (file)
@@ -19,7 +19,6 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#define COBJMACROS
 #include "wine/debug.h"
 #include "shdocvw.h"
 #include "mshtml.h"
@@ -126,6 +125,7 @@ static ULONG WINAPI WebBrowser_Release(IWebBrowser2 *iface)
             IUnknown_Release(This->document);
 
         WebBrowser_OleObject_Destroy(This);
+        WebBrowser_Events_Destroy(This);
 
         HeapFree(GetProcessHeap(), 0, This);
         SHDOCVW_UnlockModule();
@@ -783,6 +783,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
     WebBrowser_Misc_Init(ret);
     WebBrowser_Events_Init(ret);
     WebBrowser_ClientSite_Init(ret);
+    WebBrowser_DocHost_Init(ret);
 
     hres = IWebBrowser_QueryInterface(WEBBROWSER(ret), riid, ppv);
     if(SUCCEEDED(hres)) {
index 479b33e..ccf1366 100644 (file)
@@ -43,6 +43,7 @@ DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
 
 #include "ocidl.h"
 
+#include "mshtmhst.h"
 #include "docobj.h"
 #include "exdisp.h"
 
diff --git a/reactos/w32api/include/mshtmhst.h b/reactos/w32api/include/mshtmhst.h
new file mode 100644 (file)
index 0000000..807b116
--- /dev/null
@@ -0,0 +1,977 @@
+/*** Autogenerated by WIDL 0.9.2 from mshtmhst.idl - Do not edit ***/
+#include <rpc.h>
+#include <rpcndr.h>
+
+#ifndef __WIDL_MSHTMHST_H
+#define __WIDL_MSHTMHST_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <ocidl.h>
+#include <objidl.h>
+#include <oleidl.h>
+#include <oaidl.h>
+#include <docobj.h>
+#define CONTEXT_MENU_DEFAULT     0
+#define CONTEXT_MENU_IMAGE       1
+#define CONTEXT_MENU_CONTROL     2
+#define CONTEXT_MENU_TABLE       3
+#define CONTEXT_MENU_TEXTSELECT  4
+#define CONTEXT_MENU_ANCHOR      5
+#define CONTEXT_MENU_UNKNOWN     6
+#define CONTEXT_MENU_IMGDYNSRC   7
+#define CONTEXT_MENU_IMGART      8
+#define CONTEXT_MENU_DEBUG       9
+#define CONTEXT_MENU_VSCROLL    10
+#define CONTEXT_MENU_HSCROLL    11
+#define MENUEXT_SHOWDIALOG 1
+#define DOCHOSTUIFLAG_BROWSER (DOCHOSTUIFLAG_DISABLE_HELP_MENU|DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE)
+#define HTMLDLG_NOUI            0x0010
+#define HTMLDLG_MODAL           0x0020
+#define HTMLDLG_MODELESS        0x0040
+#define HTMLDLG_PRINT_TEMPLATE  0x0080
+#define HTMLDLG_VERIFY          0x0100
+#define PRINT_DONTBOTHERUSER     0x0001
+#define PRINT_WAITFORCOMPLETION  0x0002
+#ifndef __IHTMLWindow2_FWD_DEFINED__
+#define __IHTMLWindow2_FWD_DEFINED__
+typedef interface IHTMLWindow2 IHTMLWindow2;
+#endif
+#ifndef __IHostDialogHelper_FWD_DEFINED__
+#define __IHostDialogHelper_FWD_DEFINED__
+typedef struct IHostDialogHelper IHostDialogHelper;
+#endif
+
+/*****************************************************************************
+ * IHostDialogHelper interface
+ */
+#ifndef __IHostDialogHelper_INTERFACE_DEFINED__
+#define __IHostDialogHelper_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IHostDialogHelper, 0x53dec138, 0xa51e, 0x11d2, 0x86,0x1e, 0x00,0xc0,0x4f,0xa3,0x5c,0x89);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IHostDialogHelper : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE ShowHTMLDialog(
+        HWND hwndParent,
+        IMoniker* pMk,
+        VARIANT* pvarArgIn,
+        WCHAR* pchOptions,
+        VARIANT* pvarArgOut,
+        IUnknown* punkHost) = 0;
+
+};
+#else
+typedef struct IHostDialogHelperVtbl IHostDialogHelperVtbl;
+struct IHostDialogHelper {
+    const IHostDialogHelperVtbl* lpVtbl;
+};
+struct IHostDialogHelperVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IHostDialogHelper* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IHostDialogHelper* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IHostDialogHelper* This);
+
+    /*** IHostDialogHelper methods ***/
+    HRESULT (STDMETHODCALLTYPE *ShowHTMLDialog)(
+        IHostDialogHelper* This,
+        HWND hwndParent,
+        IMoniker* pMk,
+        VARIANT* pvarArgIn,
+        WCHAR* pchOptions,
+        VARIANT* pvarArgOut,
+        IUnknown* punkHost);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IHostDialogHelper_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IHostDialogHelper_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IHostDialogHelper_Release(p) (p)->lpVtbl->Release(p)
+/*** IHostDialogHelper methods ***/
+#define IHostDialogHelper_ShowHTMLDialog(p,a,b,c,d,e,f) (p)->lpVtbl->ShowHTMLDialog(p,a,b,c,d,e,f)
+#endif
+
+#endif
+
+HRESULT CALLBACK IHostDialogHelper_ShowHTMLDialog_Proxy(
+    IHostDialogHelper* This,
+    HWND hwndParent,
+    IMoniker* pMk,
+    VARIANT* pvarArgIn,
+    WCHAR* pchOptions,
+    VARIANT* pvarArgOut,
+    IUnknown* punkHost);
+void __RPC_STUB IHostDialogHelper_ShowHTMLDialog_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IHostDialogHelper_INTERFACE_DEFINED__ */
+
+/*****************************************************************************
+ * HostDialogHelper coclass
+ */
+
+DEFINE_GUID(CLSID_HostDialogHelper, 0x429af92c, 0xa51f, 0x11d2, 0x86,0x1e, 0x00,0xc0,0x4f,0xa3,0x5c,0x89);
+
+typedef enum tagDOCHOSTUIDBLCLK {
+    DOCHOSTUIDBLCLK_DEFAULT = 0,
+    DOCHOSTUIDBLCLK_SHOWPROPERTIES = 1,
+    DOCHOSTUIDBLCLK_SHOWCODE = 2
+} DOCHOSTUIDBLCLK;
+typedef enum tagDOCHOSTUIFLAG {
+    DOCHOSTUIFLAG_DIALOG = 0x1,
+    DOCHOSTUIFLAG_DISABLE_HELP_MENU = 0x2,
+    DOCHOSTUIFLAG_NO3DBORDER = 0x4,
+    DOCHOSTUIFLAG_SCROLL_NO = 0x8,
+    DOCHOSTUIFLAG_DISABLE_SCRIPT_INACTIVE = 0x10,
+    DOCHOSTUIFLAG_OPENNEWWIN = 0x20,
+    DOCHOSTUIFLAG_DISABLE_OFFSCREEN = 0x40,
+    DOCHOSTUIFLAG_FLAT_SCROLLBAR = 0x80,
+    DOCHOSTUIFLAG_DIV_BLOCKDEFAULT = 0x100,
+    DOCHOSTUIFLAG_ACTIVATE_CLIENTHIT_ONLY = 0x200,
+    DOCHOSTUIFLAG_OVERRIDEBEHAVIORFACTORY = 0x400,
+    DOCHOSTUIFLAG_CODEPAGELINKEDFONTS = 0x800,
+    DOCHOSTUIFLAG_URL_ENCODING_DISABLE_UTF8 = 0x1000,
+    DOCHOSTUIFLAG_URL_ENCODING_ENABLE_UTF8 = 0x2000,
+    DOCHOSTUIFLAG_ENABLE_FORMS_AUTOCOMPLETE = 0x4000,
+    DOCHOSTUIFLAG_ENABLE_INPLACE_NAVIGATION = 0x10000,
+    DOCHOSTUIFLAG_IME_ENABLE_RECONVERSION = 0x20000,
+    DOCHOSTUIFLAG_THEME = 0x40000,
+    DOCHOSTUIFLAG_NOTHEME = 0x80000,
+    DOCHOSTUIFLAG_NOPICS = 0x100000,
+    DOCHOSTUIFLAG_NO3DOUTERBORDER = 0x200000,
+    DOCHOSTUIFLAG_DISABLE_EDIT_NS_FIXUP = 0x400000,
+    DOCHOSTUIFLAG_LOCAL_MACHINE_ACCESS_CHECK = 0x800000,
+    DOCHOSTUIFLAG_DISABLE_UNTRUSTEDPROTOCOL = 0x1000000
+} DOCHOSTUIFLAG;
+#ifndef __IDocHostUIHandler_FWD_DEFINED__
+#define __IDocHostUIHandler_FWD_DEFINED__
+typedef struct IDocHostUIHandler IDocHostUIHandler;
+#endif
+
+typedef struct _DOCHOSTUIINFO {
+    ULONG cbSize;
+    DWORD dwFlags;
+    DWORD dwDoubleClick;
+    OLECHAR *pchHostCss;
+    OLECHAR *pchHostNS;
+} DOCHOSTUIINFO;
+/*****************************************************************************
+ * IDocHostUIHandler interface
+ */
+#ifndef __IDocHostUIHandler_INTERFACE_DEFINED__
+#define __IDocHostUIHandler_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IDocHostUIHandler, 0xbd3f23c0, 0xd43e, 0x11cf, 0x89,0x3b, 0x00,0xaa,0x00,0xbd,0xce,0x1a);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IDocHostUIHandler : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE ShowContextMenu(
+        DWORD dwID,
+        POINT* ppt,
+        IUnknown* pcmdtReserved,
+        IDispatch* pdispReserved) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetHostInfo(
+        DOCHOSTUIINFO* pInfo) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE ShowUI(
+        DWORD dwID,
+        IOleInPlaceActiveObject* pActiveObject,
+        IOleCommandTarget* pCommandTarget,
+        IOleInPlaceFrame* pFrame,
+        IOleInPlaceUIWindow* pDoc) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE HideUI(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE UpdateUI(
+        ) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE EnableModeless(
+        BOOL fEnable) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE OnDocWindowActivate(
+        BOOL fActivate) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE OnFrameWindowActivate(
+        BOOL fActivate) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE ResizeBorder(
+        LPCRECT prcBorder,
+        IOleInPlaceUIWindow* pUIWindow,
+        BOOL fRameWindow) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(
+        LPMSG lpMsg,
+        const GUID* pguidCmdGroup,
+        DWORD nCmdID) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetOptionKeyPath(
+        LPOLESTR* pchKey,
+        DWORD dw) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetDropTarget(
+        IDropTarget* pDropTarget,
+        IDropTarget** ppDropTarget) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE GetExternal(
+        IDispatch** ppDispatch) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE TranslateUrl(
+        DWORD dwTranslate,
+        OLECHAR* pchURLIn,
+        OLECHAR** ppchURLOut) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE FilterDataObject(
+        IDataObject* pDO,
+        IDataObject** ppDORet) = 0;
+
+};
+#else
+typedef struct IDocHostUIHandlerVtbl IDocHostUIHandlerVtbl;
+struct IDocHostUIHandler {
+    const IDocHostUIHandlerVtbl* lpVtbl;
+};
+struct IDocHostUIHandlerVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IDocHostUIHandler* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IDocHostUIHandler* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IDocHostUIHandler* This);
+
+    /*** IDocHostUIHandler methods ***/
+    HRESULT (STDMETHODCALLTYPE *ShowContextMenu)(
+        IDocHostUIHandler* This,
+        DWORD dwID,
+        POINT* ppt,
+        IUnknown* pcmdtReserved,
+        IDispatch* pdispReserved);
+
+    HRESULT (STDMETHODCALLTYPE *GetHostInfo)(
+        IDocHostUIHandler* This,
+        DOCHOSTUIINFO* pInfo);
+
+    HRESULT (STDMETHODCALLTYPE *ShowUI)(
+        IDocHostUIHandler* This,
+        DWORD dwID,
+        IOleInPlaceActiveObject* pActiveObject,
+        IOleCommandTarget* pCommandTarget,
+        IOleInPlaceFrame* pFrame,
+        IOleInPlaceUIWindow* pDoc);
+
+    HRESULT (STDMETHODCALLTYPE *HideUI)(
+        IDocHostUIHandler* This);
+
+    HRESULT (STDMETHODCALLTYPE *UpdateUI)(
+        IDocHostUIHandler* This);
+
+    HRESULT (STDMETHODCALLTYPE *EnableModeless)(
+        IDocHostUIHandler* This,
+        BOOL fEnable);
+
+    HRESULT (STDMETHODCALLTYPE *OnDocWindowActivate)(
+        IDocHostUIHandler* This,
+        BOOL fActivate);
+
+    HRESULT (STDMETHODCALLTYPE *OnFrameWindowActivate)(
+        IDocHostUIHandler* This,
+        BOOL fActivate);
+
+    HRESULT (STDMETHODCALLTYPE *ResizeBorder)(
+        IDocHostUIHandler* This,
+        LPCRECT prcBorder,
+        IOleInPlaceUIWindow* pUIWindow,
+        BOOL fRameWindow);
+
+    HRESULT (STDMETHODCALLTYPE *TranslateAccelerator)(
+        IDocHostUIHandler* This,
+        LPMSG lpMsg,
+        const GUID* pguidCmdGroup,
+        DWORD nCmdID);
+
+    HRESULT (STDMETHODCALLTYPE *GetOptionKeyPath)(
+        IDocHostUIHandler* This,
+        LPOLESTR* pchKey,
+        DWORD dw);
+
+    HRESULT (STDMETHODCALLTYPE *GetDropTarget)(
+        IDocHostUIHandler* This,
+        IDropTarget* pDropTarget,
+        IDropTarget** ppDropTarget);
+
+    HRESULT (STDMETHODCALLTYPE *GetExternal)(
+        IDocHostUIHandler* This,
+        IDispatch** ppDispatch);
+
+    HRESULT (STDMETHODCALLTYPE *TranslateUrl)(
+        IDocHostUIHandler* This,
+        DWORD dwTranslate,
+        OLECHAR* pchURLIn,
+        OLECHAR** ppchURLOut);
+
+    HRESULT (STDMETHODCALLTYPE *FilterDataObject)(
+        IDocHostUIHandler* This,
+        IDataObject* pDO,
+        IDataObject** ppDORet);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IDocHostUIHandler_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDocHostUIHandler_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDocHostUIHandler_Release(p) (p)->lpVtbl->Release(p)
+/*** IDocHostUIHandler methods ***/
+#define IDocHostUIHandler_ShowContextMenu(p,a,b,c,d) (p)->lpVtbl->ShowContextMenu(p,a,b,c,d)
+#define IDocHostUIHandler_GetHostInfo(p,a) (p)->lpVtbl->GetHostInfo(p,a)
+#define IDocHostUIHandler_ShowUI(p,a,b,c,d,e) (p)->lpVtbl->ShowUI(p,a,b,c,d,e)
+#define IDocHostUIHandler_HideUI(p) (p)->lpVtbl->HideUI(p)
+#define IDocHostUIHandler_UpdateUI(p) (p)->lpVtbl->UpdateUI(p)
+#define IDocHostUIHandler_EnableModeless(p,a) (p)->lpVtbl->EnableModeless(p,a)
+#define IDocHostUIHandler_OnDocWindowActivate(p,a) (p)->lpVtbl->OnDocWindowActivate(p,a)
+#define IDocHostUIHandler_OnFrameWindowActivate(p,a) (p)->lpVtbl->OnFrameWindowActivate(p,a)
+#define IDocHostUIHandler_ResizeBorder(p,a,b,c) (p)->lpVtbl->ResizeBorder(p,a,b,c)
+#define IDocHostUIHandler_TranslateAccelerator(p,a,b,c) (p)->lpVtbl->TranslateAccelerator(p,a,b,c)
+#define IDocHostUIHandler_GetOptionKeyPath(p,a,b) (p)->lpVtbl->GetOptionKeyPath(p,a,b)
+#define IDocHostUIHandler_GetDropTarget(p,a,b) (p)->lpVtbl->GetDropTarget(p,a,b)
+#define IDocHostUIHandler_GetExternal(p,a) (p)->lpVtbl->GetExternal(p,a)
+#define IDocHostUIHandler_TranslateUrl(p,a,b,c) (p)->lpVtbl->TranslateUrl(p,a,b,c)
+#define IDocHostUIHandler_FilterDataObject(p,a,b) (p)->lpVtbl->FilterDataObject(p,a,b)
+#endif
+
+#endif
+
+HRESULT CALLBACK IDocHostUIHandler_ShowContextMenu_Proxy(
+    IDocHostUIHandler* This,
+    DWORD dwID,
+    POINT* ppt,
+    IUnknown* pcmdtReserved,
+    IDispatch* pdispReserved);
+void __RPC_STUB IDocHostUIHandler_ShowContextMenu_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_GetHostInfo_Proxy(
+    IDocHostUIHandler* This,
+    DOCHOSTUIINFO* pInfo);
+void __RPC_STUB IDocHostUIHandler_GetHostInfo_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_ShowUI_Proxy(
+    IDocHostUIHandler* This,
+    DWORD dwID,
+    IOleInPlaceActiveObject* pActiveObject,
+    IOleCommandTarget* pCommandTarget,
+    IOleInPlaceFrame* pFrame,
+    IOleInPlaceUIWindow* pDoc);
+void __RPC_STUB IDocHostUIHandler_ShowUI_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_HideUI_Proxy(
+    IDocHostUIHandler* This);
+void __RPC_STUB IDocHostUIHandler_HideUI_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_UpdateUI_Proxy(
+    IDocHostUIHandler* This);
+void __RPC_STUB IDocHostUIHandler_UpdateUI_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_EnableModeless_Proxy(
+    IDocHostUIHandler* This,
+    BOOL fEnable);
+void __RPC_STUB IDocHostUIHandler_EnableModeless_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_OnDocWindowActivate_Proxy(
+    IDocHostUIHandler* This,
+    BOOL fActivate);
+void __RPC_STUB IDocHostUIHandler_OnDocWindowActivate_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_OnFrameWindowActivate_Proxy(
+    IDocHostUIHandler* This,
+    BOOL fActivate);
+void __RPC_STUB IDocHostUIHandler_OnFrameWindowActivate_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_ResizeBorder_Proxy(
+    IDocHostUIHandler* This,
+    LPCRECT prcBorder,
+    IOleInPlaceUIWindow* pUIWindow,
+    BOOL fRameWindow);
+void __RPC_STUB IDocHostUIHandler_ResizeBorder_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_TranslateAccelerator_Proxy(
+    IDocHostUIHandler* This,
+    LPMSG lpMsg,
+    const GUID* pguidCmdGroup,
+    DWORD nCmdID);
+void __RPC_STUB IDocHostUIHandler_TranslateAccelerator_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_GetOptionKeyPath_Proxy(
+    IDocHostUIHandler* This,
+    LPOLESTR* pchKey,
+    DWORD dw);
+void __RPC_STUB IDocHostUIHandler_GetOptionKeyPath_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_GetDropTarget_Proxy(
+    IDocHostUIHandler* This,
+    IDropTarget* pDropTarget,
+    IDropTarget** ppDropTarget);
+void __RPC_STUB IDocHostUIHandler_GetDropTarget_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_GetExternal_Proxy(
+    IDocHostUIHandler* This,
+    IDispatch** ppDispatch);
+void __RPC_STUB IDocHostUIHandler_GetExternal_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_TranslateUrl_Proxy(
+    IDocHostUIHandler* This,
+    DWORD dwTranslate,
+    OLECHAR* pchURLIn,
+    OLECHAR** ppchURLOut);
+void __RPC_STUB IDocHostUIHandler_TranslateUrl_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostUIHandler_FilterDataObject_Proxy(
+    IDocHostUIHandler* This,
+    IDataObject* pDO,
+    IDataObject** ppDORet);
+void __RPC_STUB IDocHostUIHandler_FilterDataObject_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IDocHostUIHandler_INTERFACE_DEFINED__ */
+
+#ifndef __IDocHostUIHandler2_FWD_DEFINED__
+#define __IDocHostUIHandler2_FWD_DEFINED__
+typedef struct IDocHostUIHandler2 IDocHostUIHandler2;
+#endif
+
+/*****************************************************************************
+ * IDocHostUIHandler2 interface
+ */
+#ifndef __IDocHostUIHandler2_INTERFACE_DEFINED__
+#define __IDocHostUIHandler2_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IDocHostUIHandler2, 0x3050f6d0, 0x98b5, 0x11cf, 0xbb,0x82, 0x00,0xaa,0x00,0xbd,0xce,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IDocHostUIHandler2 : public IDocHostUIHandler
+{
+    virtual HRESULT STDMETHODCALLTYPE GetOverrideKeyPath(
+        LPOLESTR* pchKey,
+        DWORD dw) = 0;
+
+};
+#else
+typedef struct IDocHostUIHandler2Vtbl IDocHostUIHandler2Vtbl;
+struct IDocHostUIHandler2 {
+    const IDocHostUIHandler2Vtbl* lpVtbl;
+};
+struct IDocHostUIHandler2Vtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IDocHostUIHandler2* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IDocHostUIHandler2* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IDocHostUIHandler2* This);
+
+    /*** IDocHostUIHandler methods ***/
+    HRESULT (STDMETHODCALLTYPE *ShowContextMenu)(
+        IDocHostUIHandler2* This,
+        DWORD dwID,
+        POINT* ppt,
+        IUnknown* pcmdtReserved,
+        IDispatch* pdispReserved);
+
+    HRESULT (STDMETHODCALLTYPE *GetHostInfo)(
+        IDocHostUIHandler2* This,
+        DOCHOSTUIINFO* pInfo);
+
+    HRESULT (STDMETHODCALLTYPE *ShowUI)(
+        IDocHostUIHandler2* This,
+        DWORD dwID,
+        IOleInPlaceActiveObject* pActiveObject,
+        IOleCommandTarget* pCommandTarget,
+        IOleInPlaceFrame* pFrame,
+        IOleInPlaceUIWindow* pDoc);
+
+    HRESULT (STDMETHODCALLTYPE *HideUI)(
+        IDocHostUIHandler2* This);
+
+    HRESULT (STDMETHODCALLTYPE *UpdateUI)(
+        IDocHostUIHandler2* This);
+
+    HRESULT (STDMETHODCALLTYPE *EnableModeless)(
+        IDocHostUIHandler2* This,
+        BOOL fEnable);
+
+    HRESULT (STDMETHODCALLTYPE *OnDocWindowActivate)(
+        IDocHostUIHandler2* This,
+        BOOL fActivate);
+
+    HRESULT (STDMETHODCALLTYPE *OnFrameWindowActivate)(
+        IDocHostUIHandler2* This,
+        BOOL fActivate);
+
+    HRESULT (STDMETHODCALLTYPE *ResizeBorder)(
+        IDocHostUIHandler2* This,
+        LPCRECT prcBorder,
+        IOleInPlaceUIWindow* pUIWindow,
+        BOOL fRameWindow);
+
+    HRESULT (STDMETHODCALLTYPE *TranslateAccelerator)(
+        IDocHostUIHandler2* This,
+        LPMSG lpMsg,
+        const GUID* pguidCmdGroup,
+        DWORD nCmdID);
+
+    HRESULT (STDMETHODCALLTYPE *GetOptionKeyPath)(
+        IDocHostUIHandler2* This,
+        LPOLESTR* pchKey,
+        DWORD dw);
+
+    HRESULT (STDMETHODCALLTYPE *GetDropTarget)(
+        IDocHostUIHandler2* This,
+        IDropTarget* pDropTarget,
+        IDropTarget** ppDropTarget);
+
+    HRESULT (STDMETHODCALLTYPE *GetExternal)(
+        IDocHostUIHandler2* This,
+        IDispatch** ppDispatch);
+
+    HRESULT (STDMETHODCALLTYPE *TranslateUrl)(
+        IDocHostUIHandler2* This,
+        DWORD dwTranslate,
+        OLECHAR* pchURLIn,
+        OLECHAR** ppchURLOut);
+
+    HRESULT (STDMETHODCALLTYPE *FilterDataObject)(
+        IDocHostUIHandler2* This,
+        IDataObject* pDO,
+        IDataObject** ppDORet);
+
+    /*** IDocHostUIHandler2 methods ***/
+    HRESULT (STDMETHODCALLTYPE *GetOverrideKeyPath)(
+        IDocHostUIHandler2* This,
+        LPOLESTR* pchKey,
+        DWORD dw);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IDocHostUIHandler2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDocHostUIHandler2_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDocHostUIHandler2_Release(p) (p)->lpVtbl->Release(p)
+/*** IDocHostUIHandler methods ***/
+#define IDocHostUIHandler2_ShowContextMenu(p,a,b,c,d) (p)->lpVtbl->ShowContextMenu(p,a,b,c,d)
+#define IDocHostUIHandler2_GetHostInfo(p,a) (p)->lpVtbl->GetHostInfo(p,a)
+#define IDocHostUIHandler2_ShowUI(p,a,b,c,d,e) (p)->lpVtbl->ShowUI(p,a,b,c,d,e)
+#define IDocHostUIHandler2_HideUI(p) (p)->lpVtbl->HideUI(p)
+#define IDocHostUIHandler2_UpdateUI(p) (p)->lpVtbl->UpdateUI(p)
+#define IDocHostUIHandler2_EnableModeless(p,a) (p)->lpVtbl->EnableModeless(p,a)
+#define IDocHostUIHandler2_OnDocWindowActivate(p,a) (p)->lpVtbl->OnDocWindowActivate(p,a)
+#define IDocHostUIHandler2_OnFrameWindowActivate(p,a) (p)->lpVtbl->OnFrameWindowActivate(p,a)
+#define IDocHostUIHandler2_ResizeBorder(p,a,b,c) (p)->lpVtbl->ResizeBorder(p,a,b,c)
+#define IDocHostUIHandler2_TranslateAccelerator(p,a,b,c) (p)->lpVtbl->TranslateAccelerator(p,a,b,c)
+#define IDocHostUIHandler2_GetOptionKeyPath(p,a,b) (p)->lpVtbl->GetOptionKeyPath(p,a,b)
+#define IDocHostUIHandler2_GetDropTarget(p,a,b) (p)->lpVtbl->GetDropTarget(p,a,b)
+#define IDocHostUIHandler2_GetExternal(p,a) (p)->lpVtbl->GetExternal(p,a)
+#define IDocHostUIHandler2_TranslateUrl(p,a,b,c) (p)->lpVtbl->TranslateUrl(p,a,b,c)
+#define IDocHostUIHandler2_FilterDataObject(p,a,b) (p)->lpVtbl->FilterDataObject(p,a,b)
+/*** IDocHostUIHandler2 methods ***/
+#define IDocHostUIHandler2_GetOverrideKeyPath(p,a,b) (p)->lpVtbl->GetOverrideKeyPath(p,a,b)
+#endif
+
+#endif
+
+HRESULT CALLBACK IDocHostUIHandler2_GetOverrideKeyPath_Proxy(
+    IDocHostUIHandler2* This,
+    LPOLESTR* pchKey,
+    DWORD dw);
+void __RPC_STUB IDocHostUIHandler2_GetOverrideKeyPath_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IDocHostUIHandler2_INTERFACE_DEFINED__ */
+
+#ifndef __ICustomDoc_FWD_DEFINED__
+#define __ICustomDoc_FWD_DEFINED__
+typedef struct ICustomDoc ICustomDoc;
+#endif
+
+/*****************************************************************************
+ * ICustomDoc interface
+ */
+#ifndef __ICustomDoc_INTERFACE_DEFINED__
+#define __ICustomDoc_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_ICustomDoc, 0x3050f3f0, 0x98b5, 0x11cf, 0xbb,0x82, 0x00,0xaa,0x00,0xbd,0xce,0x0b);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct ICustomDoc : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE SetUIHandler(
+        IDocHostUIHandler* pUIHandler) = 0;
+
+};
+#else
+typedef struct ICustomDocVtbl ICustomDocVtbl;
+struct ICustomDoc {
+    const ICustomDocVtbl* lpVtbl;
+};
+struct ICustomDocVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        ICustomDoc* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        ICustomDoc* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        ICustomDoc* This);
+
+    /*** ICustomDoc methods ***/
+    HRESULT (STDMETHODCALLTYPE *SetUIHandler)(
+        ICustomDoc* This,
+        IDocHostUIHandler* pUIHandler);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define ICustomDoc_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define ICustomDoc_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define ICustomDoc_Release(p) (p)->lpVtbl->Release(p)
+/*** ICustomDoc methods ***/
+#define ICustomDoc_SetUIHandler(p,a) (p)->lpVtbl->SetUIHandler(p,a)
+#endif
+
+#endif
+
+HRESULT CALLBACK ICustomDoc_SetUIHandler_Proxy(
+    ICustomDoc* This,
+    IDocHostUIHandler* pUIHandler);
+void __RPC_STUB ICustomDoc_SetUIHandler_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __ICustomDoc_INTERFACE_DEFINED__ */
+
+#ifndef __IDocHostShowUI_FWD_DEFINED__
+#define __IDocHostShowUI_FWD_DEFINED__
+typedef struct IDocHostShowUI IDocHostShowUI;
+#endif
+
+/*****************************************************************************
+ * IDocHostShowUI interface
+ */
+#ifndef __IDocHostShowUI_INTERFACE_DEFINED__
+#define __IDocHostShowUI_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IDocHostShowUI, 0xc4d244b0, 0xd43e, 0x11cf, 0x89,0x3b, 0x00,0xaa,0x00,0xbd,0xce,0x1a);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IDocHostShowUI : public IUnknown
+{
+    virtual HRESULT STDMETHODCALLTYPE ShowMessage(
+        HWND hwnd,
+        LPOLESTR lpstrText,
+        LPOLESTR lpstrCaption,
+        DWORD dwType,
+        LPOLESTR lpstrHelpFile,
+        DWORD dwHelpContext,
+        LRESULT* plResult) = 0;
+
+    virtual HRESULT STDMETHODCALLTYPE ShowHelp(
+        HWND hwnd,
+        LPOLESTR pszHelpFile,
+        UINT uCommand,
+        DWORD dwData,
+        POINT ptMouse,
+        IDispatch* pDispatchObjectHit) = 0;
+
+};
+#else
+typedef struct IDocHostShowUIVtbl IDocHostShowUIVtbl;
+struct IDocHostShowUI {
+    const IDocHostShowUIVtbl* lpVtbl;
+};
+struct IDocHostShowUIVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IDocHostShowUI* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IDocHostShowUI* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IDocHostShowUI* This);
+
+    /*** IDocHostShowUI methods ***/
+    HRESULT (STDMETHODCALLTYPE *ShowMessage)(
+        IDocHostShowUI* This,
+        HWND hwnd,
+        LPOLESTR lpstrText,
+        LPOLESTR lpstrCaption,
+        DWORD dwType,
+        LPOLESTR lpstrHelpFile,
+        DWORD dwHelpContext,
+        LRESULT* plResult);
+
+    HRESULT (STDMETHODCALLTYPE *ShowHelp)(
+        IDocHostShowUI* This,
+        HWND hwnd,
+        LPOLESTR pszHelpFile,
+        UINT uCommand,
+        DWORD dwData,
+        POINT ptMouse,
+        IDispatch* pDispatchObjectHit);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IDocHostShowUI_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDocHostShowUI_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IDocHostShowUI_Release(p) (p)->lpVtbl->Release(p)
+/*** IDocHostShowUI methods ***/
+#define IDocHostShowUI_ShowMessage(p,a,b,c,d,e,f,g) (p)->lpVtbl->ShowMessage(p,a,b,c,d,e,f,g)
+#define IDocHostShowUI_ShowHelp(p,a,b,c,d,e,f) (p)->lpVtbl->ShowHelp(p,a,b,c,d,e,f)
+#endif
+
+#endif
+
+HRESULT CALLBACK IDocHostShowUI_ShowMessage_Proxy(
+    IDocHostShowUI* This,
+    HWND hwnd,
+    LPOLESTR lpstrText,
+    LPOLESTR lpstrCaption,
+    DWORD dwType,
+    LPOLESTR lpstrHelpFile,
+    DWORD dwHelpContext,
+    LRESULT* plResult);
+void __RPC_STUB IDocHostShowUI_ShowMessage_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+HRESULT CALLBACK IDocHostShowUI_ShowHelp_Proxy(
+    IDocHostShowUI* This,
+    HWND hwnd,
+    LPOLESTR pszHelpFile,
+    UINT uCommand,
+    DWORD dwData,
+    POINT ptMouse,
+    IDispatch* pDispatchObjectHit);
+void __RPC_STUB IDocHostShowUI_ShowHelp_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IDocHostShowUI_INTERFACE_DEFINED__ */
+
+#define IClassFactory3 IClassFactoryEx
+#define IID_IClassFactory3 IID_IClassFactoryEx
+#ifndef __IClassFactoryEx_FWD_DEFINED__
+#define __IClassFactoryEx_FWD_DEFINED__
+typedef struct IClassFactoryEx IClassFactoryEx;
+#endif
+
+/*****************************************************************************
+ * IClassFactoryEx interface
+ */
+#ifndef __IClassFactoryEx_INTERFACE_DEFINED__
+#define __IClassFactoryEx_INTERFACE_DEFINED__
+
+DEFINE_GUID(IID_IClassFactoryEx, 0x342d1ea0, 0xae25, 0x11d1, 0x89,0xc5, 0x00,0x60,0x08,0xc3,0xfb,0xfc);
+#if defined(__cplusplus) && !defined(CINTERFACE)
+struct IClassFactoryEx : public IClassFactory
+{
+    virtual HRESULT STDMETHODCALLTYPE CreateInstanceWithContext(
+        IUnknown* punkContext,
+        IUnknown* punkOuter,
+        REFIID riid,
+        void** ppv) = 0;
+
+};
+#else
+typedef struct IClassFactoryExVtbl IClassFactoryExVtbl;
+struct IClassFactoryEx {
+    const IClassFactoryExVtbl* lpVtbl;
+};
+struct IClassFactoryExVtbl {
+    BEGIN_INTERFACE
+
+    /*** IUnknown methods ***/
+    HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+        IClassFactoryEx* This,
+        REFIID riid,
+        void** ppvObject);
+
+    ULONG (STDMETHODCALLTYPE *AddRef)(
+        IClassFactoryEx* This);
+
+    ULONG (STDMETHODCALLTYPE *Release)(
+        IClassFactoryEx* This);
+
+    /*** IClassFactory methods ***/
+    HRESULT (STDMETHODCALLTYPE *CreateInstance)(
+        IClassFactoryEx* This,
+        IUnknown* pUnkOuter,
+        REFIID riid,
+        void** ppvObject);
+
+    HRESULT (STDMETHODCALLTYPE *LockServer)(
+        IClassFactoryEx* This,
+        BOOL fLock);
+
+    /*** IClassFactoryEx methods ***/
+    HRESULT (STDMETHODCALLTYPE *CreateInstanceWithContext)(
+        IClassFactoryEx* This,
+        IUnknown* punkContext,
+        IUnknown* punkOuter,
+        REFIID riid,
+        void** ppv);
+
+    END_INTERFACE
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IClassFactoryEx_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IClassFactoryEx_AddRef(p) (p)->lpVtbl->AddRef(p)
+#define IClassFactoryEx_Release(p) (p)->lpVtbl->Release(p)
+/*** IClassFactory methods ***/
+#define IClassFactoryEx_CreateInstance(p,a,b,c) (p)->lpVtbl->CreateInstance(p,a,b,c)
+#define IClassFactoryEx_LockServer(p,a) (p)->lpVtbl->LockServer(p,a)
+/*** IClassFactoryEx methods ***/
+#define IClassFactoryEx_CreateInstanceWithContext(p,a,b,c,d) (p)->lpVtbl->CreateInstanceWithContext(p,a,b,c,d)
+#endif
+
+#endif
+
+HRESULT CALLBACK IClassFactoryEx_CreateInstanceWithContext_Proxy(
+    IClassFactoryEx* This,
+    IUnknown* punkContext,
+    IUnknown* punkOuter,
+    REFIID riid,
+    void** ppv);
+void __RPC_STUB IClassFactoryEx_CreateInstanceWithContext_Stub(
+    struct IRpcStubBuffer* This,
+    struct IRpcChannelBuffer* pRpcChannelBuffer,
+    PRPC_MESSAGE pRpcMessage,
+    DWORD* pdwStubPhase);
+
+#endif  /* __IClassFactoryEx_INTERFACE_DEFINED__ */
+
+typedef HRESULT WINAPI SHOWHTMLDIALOGFN(HWND,IMoniker*,VARIANT*,WCHAR*,VARIANT*);
+typedef HRESULT WINAPI SHOWHTMLDIALOGEXFN(HWND,IMoniker*,DWORD,VARIANT*,WCHAR*,VARIANT*);
+typedef HRESULT WINAPI SHOWMODELESSHTMLDIALOGFN(HWND,IMoniker*,VARIANT*,VARIANT*,IHTMLWindow2**);
+EXTERN_C HRESULT WINAPI ShowHTMLDialog(HWND,IMoniker*,VARIANT*,WCHAR*,VARIANT*);
+EXTERN_C HRESULT WINAPI ShowHTMLDialogEx(HWND,IMoniker*,DWORD,VARIANT*,WCHAR*,VARIANT*);
+EXTERN_C HRESULT WINAPI ShowModelessHTMLDialog(HWND,IMoniker*,VARIANT*,VARIANT*,IHTMLWindow2**);
+EXTERN_C HRESULT WINAPI RunHTMLApplication(HINSTANCE,HINSTANCE,LPSTR,int);
+EXTERN_C HRESULT WINAPI CreateHTMLPropertyPage(IMoniker*,IPropertyPage**);
+/* Begin additional prototypes for all interfaces */
+
+unsigned long   __RPC_USER BSTR_UserSize     (unsigned long *, unsigned long,   BSTR *);
+unsigned char * __RPC_USER BSTR_UserMarshal  (unsigned long *, unsigned char *, BSTR *);
+unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR *);
+void            __RPC_USER BSTR_UserFree     (unsigned long *, BSTR *);
+unsigned long   __RPC_USER VARIANT_UserSize     (unsigned long *, unsigned long,   VARIANT *);
+unsigned char * __RPC_USER VARIANT_UserMarshal  (unsigned long *, unsigned char *, VARIANT *);
+unsigned char * __RPC_USER VARIANT_UserUnmarshal(unsigned long *, unsigned char *, VARIANT *);
+void            __RPC_USER VARIANT_UserFree     (unsigned long *, VARIANT *);
+unsigned long   __RPC_USER HWND_UserSize     (unsigned long *, unsigned long,   HWND *);
+unsigned char * __RPC_USER HWND_UserMarshal  (unsigned long *, unsigned char *, HWND *);
+unsigned char * __RPC_USER HWND_UserUnmarshal(unsigned long *, unsigned char *, HWND *);
+void            __RPC_USER HWND_UserFree     (unsigned long *, HWND *);
+
+/* End additional prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __WIDL_MSHTMHST_H */