Hi Andrew,
Andrew Eikum wrote:
+ if(params->cArgs >= 2) { + width = params->rgvarg; + height = params->rgvarg + 1; + }else if(params->cArgs == 1) { + width = params->rgvarg; + height = ∅ + }else { + width = ∅ + height = ∅ + }
Note that DISPPARAMS stores arguments in right to left order so you swap arguments here. Also you have to skip named args that are stored in first cNamedArgs of rgvarg table. How about:
argc = params->cArgs - params->cNamedArgs; width = argc >= 2 ? params->rgvarg+argc-1 : ∅ height = argc >= 1 ? params->rgvarg+argc-2 : ∅
Also:
+ IHTMLImgElement_QueryInterface(img, &IID_IDispatch, (void**)&disp);
IHTMLImgElement is a child interface of IDispatch, so you can use C cast here instead of QueryInterface here.
Jacek
Jacek Caban wrote:
Thanks for the help, Jacek.
If I'm understanding you right, rgvarg points to the named parameters first, followed by the unnamed parameters in reverse order?
In this case: <named params> <height> <width>
If so, then this should work, yes? argc = params->cArgs - params->cNamedArgs; width = argc >= 1 ? params->rgvarg + (params->cArgs - 1) : ∅ height = argc >= 2 ? params->rgvarg + (params->cArgs - 2) : ∅
Andrew Eikum wrote:
Yes, all is right. There are an examples in dlls/jscript/jscript.h arg_cnt() and get_arg() that deal with DISPPARAMS.
Jacek