[2/2] mshtml: Add HTMLImageElementFactory::value for constructing IHTMLImgElement objects

Jacek Caban jacek at codeweavers.com
Wed Oct 21 15:07:49 CDT 2009


Hi Andrew,

Andrew Eikum wrote:
> ---
>  dlls/mshtml/htmlimg.c |   46
> +++++++++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 45 insertions(+), 1 deletions(-)
>
>
>   


+    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





More information about the wine-devel mailing list