[PATCH v2 6/8] dhtmled.ocx: Add IOleControl interface to DHTMLEdit object

Alex Henrie alexhenrie24 at gmail.com
Tue Dec 5 03:09:24 CST 2017


Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
v2: Fixed typo in commit message
---
 dlls/dhtmled.ocx/edit.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 66 insertions(+)

diff --git a/dlls/dhtmled.ocx/edit.c b/dlls/dhtmled.ocx/edit.c
index 804c32dfb7..80ec00614d 100644
--- a/dlls/dhtmled.ocx/edit.c
+++ b/dlls/dhtmled.ocx/edit.c
@@ -30,6 +30,7 @@ typedef struct
     IQuickActivate IQuickActivate_iface;
     IViewObject IViewObject_iface;
     IOleObject IOleObject_iface;
+    IOleControl IOleControl_iface;
     IOleClientSite *client_site;
     LONG ref;
 } DHTMLEditImpl;
@@ -54,6 +55,11 @@ static inline DHTMLEditImpl *impl_from_IOleObject(IOleObject *iface)
     return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleObject_iface);
 }
 
+static inline DHTMLEditImpl *impl_from_IOleControl(IOleControl *iface)
+{
+    return CONTAINING_RECORD(iface, DHTMLEditImpl, IOleControl_iface);
+}
+
 static HRESULT dhtml_edit_addref(DHTMLEditImpl *This)
 {
     LONG ref = InterlockedIncrement(&This->ref);
@@ -94,6 +100,12 @@ static HRESULT dhtml_edit_qi(DHTMLEditImpl *This, REFIID iid, void **out)
         *out = &This->IOleObject_iface;
         return S_OK;
     }
+    else if (IsEqualGUID(iid, &IID_IOleControl))
+    {
+        dhtml_edit_addref(This);
+        *out = &This->IOleControl_iface;
+        return S_OK;
+    }
 
     *out = NULL;
     ERR("no interface for %s\n", debugstr_guid(iid));
@@ -897,6 +909,59 @@ static const IOleObjectVtbl OleObjectVtbl = {
     OleObject_SetColorScheme
 };
 
+static HRESULT WINAPI OleControl_QueryInterface(IOleControl *iface, REFIID iid, void **out)
+{
+    return dhtml_edit_qi(impl_from_IOleControl(iface), iid, out);
+}
+
+static ULONG WINAPI OleControl_AddRef(IOleControl *iface)
+{
+    return dhtml_edit_addref(impl_from_IOleControl(iface));
+}
+
+static ULONG WINAPI OleControl_Release(IOleControl *iface)
+{
+    return dhtml_edit_release(impl_from_IOleControl(iface));
+}
+
+static HRESULT WINAPI OleControl_FreezeEvents(IOleControl *iface, BOOL freeze)
+{
+    DHTMLEditImpl *This = impl_from_IOleControl(iface);
+    FIXME("(%p)->(%u) stub\n", This, freeze);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleControl_GetControlInfo(IOleControl *iface, CONTROLINFO *value)
+{
+    DHTMLEditImpl *This = impl_from_IOleControl(iface);
+    FIXME("(%p)->(%p) stub\n", This, value);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleControl_OnAmbientPropertyChange(IOleControl *iface, DISPID disp_id)
+{
+    DHTMLEditImpl *This = impl_from_IOleControl(iface);
+    FIXME("(%p)->(%d) stub\n", This, disp_id);
+    return E_NOTIMPL;
+}
+
+static HRESULT WINAPI OleControl_OnMnemonic(IOleControl *iface, MSG *msg)
+{
+    DHTMLEditImpl *This = impl_from_IOleControl(iface);
+    FIXME("(%p)->(%p) stub\n", This, msg);
+    return E_NOTIMPL;
+}
+
+static const IOleControlVtbl OleControlVtbl = {
+    OleControl_QueryInterface,
+    OleControl_AddRef,
+    OleControl_Release,
+    OleControl_GetControlInfo,
+    OleControl_OnMnemonic,
+    OleControl_FreezeEvents,
+    OleControl_OnAmbientPropertyChange
+};
+
 HRESULT dhtml_edit_create(REFIID iid, void **out)
 {
     DHTMLEditImpl *This;
@@ -913,6 +978,7 @@ HRESULT dhtml_edit_create(REFIID iid, void **out)
     This->IQuickActivate_iface.lpVtbl = &QuickActivateVtbl;
     This->IViewObject_iface.lpVtbl = &ViewObjectVtbl;
     This->IOleObject_iface.lpVtbl = &OleObjectVtbl;
+    This->IOleControl_iface.lpVtbl = &OleControlVtbl;
     This->ref = 1;
 
     *out = &This->IDHTMLEdit_iface;
-- 
2.15.1




More information about the wine-devel mailing list