microsoft.mshtml - mshtml fireevent onchange not firing -
i unable fire "onchange" event in mshtml. can please tell me doing wrong here.
htmlselectelement element = (htmlselectelement)this.htmldocument.all.item(controlid, 0); ihtmlelement e = element ihtmlelement; ihtmldocument4 doc = e.document ihtmldocument4; object dummy = null; object eventobj = doc.createeventobject(ref dummy); htmlselectelementclass se = element htmlselectelementclass; se.fireevent("onchange", ref eventobj);
i getting variable "se" null. got piece of code link http://www.itwriting.com/phorum/read.php?3,1507
can me this.
thanks, sam
runtime callable wrapper objects generated com calls htmldocument.all.item can translate interface casting queryinterface calls. rcw not know how convert managed class htmlselectelementclass, returns null.
instead of casting htmlselectelementclass, cast ihtmlelement3 call fireevent.
by way, code not work in ie11 mode document.all deprecated. use ihtmldocument3::getelementbyid instead.
Comments
Post a Comment