diff --git a/dlls/mshtml/htmlelemcol.c b/dlls/mshtml/htmlelemcol.c index 125819d94d0..8407e024203 100644 --- a/dlls/mshtml/htmlelemcol.c +++ b/dlls/mshtml/htmlelemcol.c @@ -400,7 +400,7 @@ static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name) static HRESULT get_item_idx(HTMLElementCollection *This, UINT idx, IDispatch **ret) { if(idx < This->len) { - *ret = (IDispatch*)This->elems[idx]; + *ret = (IDispatch*)&This->elems[idx]->node.event_target.dispex.IDispatchEx_iface; IDispatch_AddRef(*ret); } diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index c2eeb7d8fc2..fc5277b902e 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -1024,7 +1024,7 @@ void call_event_handlers(HTMLDocumentNode *doc, HTMLEventObj *event_obj, EventTa int i; V_VT(&arg) = VT_DISPATCH; - V_DISPATCH(&arg) = (IDispatch*)event_obj; + V_DISPATCH(&arg) = (IDispatch*)&event_obj->dispex.IDispatchEx_iface; i = data->event_table[eid]->handler_cnt; while(i--) {