<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-25 21:44 GMT+08:00 Piotr Caban <span dir="ltr"><<a href="mailto:piotr.caban@gmail.com" target="_blank">piotr.caban@gmail.com</a>></span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 06/25/14 15:34, Shuai Meng wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">
2014-06-25 17:32 GMT+08:00 Piotr Caban <<a href="mailto:piotr.caban@gmail.com" target="_blank">piotr.caban@gmail.com</a><br></div>
<mailto:<a href="mailto:piotr.caban@gmail.com" target="_blank">piotr.caban@gmail.com</a>><u></u>>:<div><div class="h5"><br>
<br>
    On 06/25/14 04:19, Shuai Meng wrote:<br>
<br>
           static HRESULT Global_VarType(vbdisp_t *This, VARIANT *arg,<br>
        unsigned args_cnt, VARIANT *res)<br>
           {<br>
        -    FIXME("\n");<br>
        -    return E_NOTIMPL;<br>
        +    TRACE("(%s)\n", debugstr_variant(arg));<br>
        +<br>
        +    assert(args_cnt == 1);<br>
        +<br>
        +    if(V_VT(arg) & ~VT_TYPEMASK) {<br>
        +        FIXME("not supported %s\n", debugstr_variant(arg));<br>
        +        return E_NOTIMPL;<br>
        +    }<br>
        +<br>
        +    if(!res)<br>
        +        return DISP_E_BADVARTYPE;<br>
<br>
    This function should not return error if res is NULL.<br>
<br>
But it returned error when res was NULL in CInt and other conversion<br>
functions. Will you please explain this?<br>
</div></div></blockquote><div class="HOEnZb"><div class="h5">
You need to implement it in the same way as on windows. A test for this behavior may be following:<br>
Call VarType(Empty)<br>
because the function is not returning error the script is executed successfully.<br>
<br>
In general functions are supposed to behave in the same way no matter if return value is used or not. Unfortunately there are some functions that behave differently.<br>
<br>
<br>
</div></div></blockquote></div>OK, I finally understand the secret, keep the same with windows.</div></div>