[PATCH 8/8] dhtmled.ocx: Add IConnectionPointContainer interface to HTMLEdit object

Alex Henrie alexhenrie24 at gmail.com
Tue Dec 5 02:10:24 CST 2017


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
 dlls/dhtmled.ocx/edit.c | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c
index c68e9d62fd..a929b4c4e9 100644
--- a/dlls/dhtmled.ocx/edit.c
+++ b/dlls/dhtmled.ocx/edit.c
@@ -32,6 +32,7 @@ typedef struct
     IOleObject IOleObject_iface;
     IOleControl IOleControl_iface;
     IPersistStreamInit IPersistStreamInit_iface;
+    IConnectionPointContainer IConnectionPointContainer_iface;
     IOleClientSite *client_site;
     LONG ref;
 } DHTMLEditImpl;
@@ -66,6 +67,11 @@ static inline DHTMLEditImpl *impl_from_IPersistStreamInit(IPersistStreamInit *if
     return CONTAINING_RECORD(iface, DHTMLEditImpl, IPersistStreamInit_iface);
 }
 
+static inline DHTMLEditImpl *impl_from_IConnectionPointContainer(IConnectionPointContainer *iface)
+{
+    return CONTAINING_RECORD(iface, DHTMLEditImpl, IConnectionPointContainer_iface);
+}
+
 static HRESULT dhtml_edit_addref(DHTMLEditImpl *This)
 {
     LONG ref = InterlockedIncrement(&This->ref);
@@ -119,6 +125,12 @@ static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
         *out = &This->IPersistStreamInit_iface;
         return S_OK;
     }
+    else if (IsEqualGUID(iid, &IID_IConnectionPointContainer))
+    {
+        dhtml_edit_addref(This);
+        *out = &This->IConnectionPointContainer_iface;
+        return S_OK;
+    }
 
     *out = NULL;
     ERR("no interface for %s\n", debugstr_guid(iid));
@@ -1045,6 +1057,47 @@ static const IPersistStreamInitVtbl PersistStreamInitVtbl = {
     PersistStreamInit_InitNew
 };
 
+static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface, REFIID iid, void **out)
+{
+    return dhtml_edit_qi(impl_from_IConnectionPointContainer(iface), iid, out);
+}
+
+static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
+{
+    return dhtml_edit_addref(impl_from_IConnectionPointContainer(iface));
+}
+
+static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
+{
+    return dhtml_edit_release(impl_from_IConnectionPointContainer(iface));
+}
+
+static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface,
+                                                                    IEnumConnectionPoints **conn_points)
+{
+    DHTMLEditImpl *This = impl_from_IConnectionPointContainer(iface);
+    FIXME("(%p)->(%p) stub\n", This, conn_points);
+    *conn_points = NULL;
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface, REFIID iid,
+                                                                   IConnectionPoint **out)
+{
+    DHTMLEditImpl *This = impl_from_IConnectionPointContainer(iface);
+    FIXME("(%p)->(%s, %p) stub\n", This, debugstr_guid(iid), out);
+    *out = NULL;
+    return CONNECT_E_NOCONNECTION;
+}
+
+static const IConnectionPointContainerVtbl ConnectionPointContainerVtbl = {
+    ConnectionPointContainer_QueryInterface,
+    ConnectionPointContainer_AddRef,
+    ConnectionPointContainer_Release,
+    ConnectionPointContainer_EnumConnectionPoints,
+    ConnectionPointContainer_FindConnectionPoint
+};
+
 HRESULT dhtml_edit_create(REFIID iid, void **out)
 {
     DHTMLEditImpl *This;
@@ -1063,6 +1116,7 @@ HRESULT dhtml_edit_create(REFIID iid, void **out)
     This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
     This->IOleControl_iface.lpVtbl = &OleControlVtbl;
     This->IPersistStreamInit_iface.lpVtbl = &PersistStreamInitVtbl;
+    This->IConnectionPointContainer_iface.lpVtbl = &ConnectionPointContainerVtbl;
     This->ref = 1;
 
     *out = &This->IDHTMLEdit_iface;
-- 
2.15.1




More information about the wine-devel mailing list