Tim Roberts wrote:
rv...@free.fr wrote:

It seems win32client do not interpret correctly the type expected by the COM server, here float() instead of pointer on an array of float.


That statement is not accurate.  The fault is not in win32client. The root of the problem is that the function definition in your type library is not COM-compliant.  There are rules that need to be followed in order for a COM interface to work seamlessly across languages, and you have violated those rules.  The proper way to pass an array is to use a SAFEARRAY. Your definition, for example, cannot possibly work in an out-of-process server, because there is no way for the marashaling code to know how much data to send across.  The GetValues case is doubly hopeless.  How can the server know how large the buffer is?  How can the client know how much data will be returned?  You are simply not allowed in COM to have that be assumed.

Win32client is quite correct in interpreting your definition as it does.  The fact that it works in VBA is an lucky accident.  If you want this to work reliably, you need to change the interface.

Having said all that, you may be able to do what you need with the "comtypes" module, which allows lower-level access to COM interfaces.

--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to