[python-win32] How to create a empty com object

Mark Hammond mhammond at skippinet.com.au
Sun Feb 20 23:24:05 CET 2011


On 21/02/2011 7:42 AM, Matteo Boscolo wrote:
>
> I did some other search I try to pass a object() to the activeComponent
> but the active component need a COM VARIANT..
>
> there is any way to create a null COM VARIANT ?
> or to pass a c++ NULL equivalent object ?

win32com automatically creates a variant - if you pass None, it will 
create a variant with VT_NULL, and if you pass pythoncom.Empty, it will 
pass a variant with VT_EMPTY.  If Empty also doesn't work, I'm afraid 
I'm out of ideas...

Cheers,

Mark.


More information about the python-win32 mailing list