Retrieve javascript array object with C++ using DISPID_NEWENUM fails on IE9 -
following similar question answered time ago, found out when trying enumerate object, using idispatch::invoke(dispid_newenum,...) fails disp_e_exception on ie9.
happens idispatch , idispatchex, on javascript array.
needless code works great on ie6-ie8, , fails on ie9.
the same question appears in msdn dev forums no luck far.
here's code snippet demonstrate tried do. notice pdispatch javascript's array variant.
// invoke object retrieve enumerator containing object ccomvariant varresult; dispparams dispparamsnoargs = {0}; excepinfo excepinfo = {0}; uint uiargerr = (uint)-1; // initialize invalid arg hresult hr = pdispatch->invoke(dispid_newenum, iid_null, locale_user_default, dispatch_method | dispatch_propertyget, &dispparamsnoargs, &varresult, &excepinfo, &uiargerr); // if failed - retry idispatchex if (failed(hr)) { ccomptr<idispatchex> pdispatchex; pdispatchex = pdispatch; // implied query interface hr = pdispatchex->invokeex(dispid_newenum, locale_user_default, dispatch_method | dispatch_propertyget, &dispparamsnoargs, &varresult, &excepinfo, null); if (failed(hr)) return false; } does have idea why code fails (idispatch , idispatchex) hresult of disp_e_exception on ie9?
thanks.
ienumvariant may work. although when tried ienumvariant::next returning e_fail, element fetched correctly. didn't have time or need bottom of this.
it worked me, if didn't intended use idispatchex: when enumerated members of array objects passed ie had "0", "1" etc.., not "length" method though, must in it's typeinfo, haven't checked. think idea.
sorry can't post pseudo code site won't allow me without following special formatting rules
hth
Comments
Post a Comment