Monday, 20 March 2023

How do you format a list of Python values to be compatible with the COM SAFEARRAY format?

I am sort of surprised this hasn't been covered before.

handle = win32com.client.Dispatch("My.Application")
vals = [1.1, 2.2, 3.3]
handle.SetValues("PUT_IT_HERE", vals)

I assume there is some kind of conversion needed to make it compatible with (SAFEARRAY *) but no one has been very clear about this.



from How do you format a list of Python values to be compatible with the COM SAFEARRAY format?

No comments:

Post a Comment