Bill Medland wrote:

before I start trying to get up to speed on it.

Congratulations. My company's program now gets somewhere with the builtin ole dlls (thanks to fixes in the out-of-process COM) so I am interested in trying to get it to work completely with them (especially since the native ones no longer work)

What I have just fallen over is some VB that calls a method that results in ITypeInfo_fnInvoke failed to convert param 0 to VT_VARIANT|
VT_BYREF from VT_I2.

So I changed the VB and ended up with ITypeInfo_fnInvoke failed to convert param 0 to VT_VARIANT|
VT_BYREF from VT_VARIANT|VT_BYREF.

Now it seems to me that it ought at least to handle the second case, but that probably demonstrates that I don't know what I am talking about.

Anyway; if someone is already working on that sort of thing then there is probably little point in me trying to learn it all. However if no-one is then I guess I will start trying to learn it.

Comments?

I had hoped others would continue development on typelib stuff, picking up from where I left off after the rewrite to use more of VariantChangeType, but unfortunately this isn't the case and I don't have enough time to work on this area too much. Fortunately, I don't think there are too many issues left to fix and already the new code in ITypeInfo::Invoke gets some programs working that wouldn't work with the old code.

Does this patch fix both issues for you?

--
Rob Shearman

diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c
index 43dfb73..4b88a18 100644
--- a/dlls/oleaut32/typelib.c
+++ b/dlls/oleaut32/typelib.c
@@ -5238,8 +5238,15 @@ static HRESULT WINAPI ITypeInfo_fnInvoke
                     VARIANTARG *src_arg = &pDispParams->rgvarg[pDispParams->cArgs - 1 - i];
                     dump_Variant(src_arg);
 
-                    if (rgvt[i] == VT_VARIANT)
+                    if ((rgvt[i] == VT_VARIANT) || (rgvt[i] == V_VT(src_arg)))
                         VariantCopy(&rgvarg[i], src_arg);
+                    else if (rgvt[i] == (VT_VARIANT | VT_BYREF))
+                    {
+                        VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams);
+                        VariantCopy(&missing_arg[i], src_arg);
+                        V_VARIANTREF(&rgvarg[i]) = &missing_arg[i];
+                        V_VT(&rgvarg[i]) = rgvt[i];
+                    }
                     else if ((rgvt[i] & VT_BYREF) && !V_ISBYREF(src_arg))
                     {
                         VARIANTARG *missing_arg = INVBUF_GET_MISSING_ARG_ARRAY(buffer, func_desc->cParams);


Reply via email to