[python-win32] Max parameters in method of IConnectionPoint interface?

Mark Hammond mhammond at skippinet.com.au
Fri Mar 28 00:42:57 CET 2008


> That's exactly what I ended up doing. I guess I was just a little too
> green to do it right the first time. I didn't know how to pass a SAFEARRAY
> correctly, so I thought I'd hide the problem and put it in a VARIANT :-)
> 
> Strangely, this actually worked for my C++ clients.

Best I can tell, there is no reason it's not legal - it's just unusual :)
You could argue that we should just recurse away on VT_VARIANT until we find
a real type.  I was kinda hoping you had a legitimate case it was failing
with, as then it would have been clearer it was a bug :)  Particularly, the
top of that function has:

	/* skip past any variant references to a "real" variant 
	  (Why do we do this?  Why is it only a VARIANT?  whats the story,
morning glory?
	*/
	while ( V_VT(var) == (VT_BYREF | VT_VARIANT) )
		var = V_VARIANTREF(var);

but the code fails to gracefully handle the non-byref variant case, as you
found.  Oh well, some other day (or if someone is keen, a bug couldn't
hurt...)

Cheers,

Mark



More information about the python-win32 mailing list