Hello.

Hello... Need help with TWebBrowser (XE3, IE11, W10). I need to call events from Javascript to Delphi. I've found such Javascript:

var event = document.createEvent('Event');
event.initEvent('somename', true, false);
...
someelement.dispatchEvent(evt);

Is it possible to listen this event in Delphi somehow? I have written IDispatch implementation and passed it to IHTMLElement2.attachEvent.

TIEEventObject = class(TInterfacedObject, IDispatch)
private
function getTypeInfoCount(out Count: Integer): HResult; stdcall;
function getTypeInfo(Index, LocaleID: Integer; out TypeInfo): HResult; stdcall;
function getIDsOfNames(const IID: TGUID; Names: Pointer; NameCount, LocaleID: Integer; DispIDs: Pointer): HResult; stdcall;
function invoke(DispID: Integer; const IID: TGUID; LocaleID: Integer; Flags: Word; var Params; VarResult, ExcepInfo, ArgErr: Pointer): HResult; stdcall;
end;

Unfortunately Invoke method is not being called.

Any suggestions? Thank you for ANY help!

Comments