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

Matteo Boscolo matteo.boscolo at boscolini.eu
Sun Feb 20 21:42:45 CET 2011


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 ?

regards,
Matteo


Il 19/02/2011 01:03, Mark Hammond ha scritto:
> [Re-added the python-win32 list - please keep replies on list]
>
> On 19/02/2011 12:51 AM, matteo.boscolo at boscolini.eu wrote:
>> with None It dose not work ..
>
> In what way doesn't it work?  AFAIK, None is the closest thing Python 
> has to Nothing - although you could try setting it to pythoncon.Empty
>
> See the docs for nothing at 
> http://msdn.microsoft.com/en-us/library/0x9tb07z.aspx
>
>> I need to create an empty ITDComponent I think ..
>
> There isn't really any such thing...
>
> Cheers,
>
> Mark
>>
>> regards,
>> Matteo
>>
>> From: "Mark Hammond" skippy.hammond at gmail.com
>> To: "Matteo Boscolo" matteo.boscolo at boscolini.eu
>> Cc:
>> Date: Fri, 18 Feb 2011 17:09:50 +1100
>> Subject: Re: [python-win32] How to create a empty com object
>>
>> > On 18/02/2011 3:30 AM, Matteo Boscolo wrote:
>> > > Hi all,
>> > > I have a property that need an empty comobject
>> > >
>> > > |C++ definition:
>> > > HRESULT activeComponent(
>> > > [out, retval] ITDComponent** pVal)
>> > > HRESULT activeComponent([in] ITDComponent* pVal)|
>> > >
>> > > how can I do it with python ??
>> > > In vb6 i use the following code:
>> > > pComponent.Document.activeComponent = Nothing
>> >
>> > You might find setting it to None works...
>> >
>> > HTH,
>> >
>> > Mark
>
>
>
>
> -----
> Nessun virus nel messaggio.
> Controllato da AVG - www.avg.com
> Versione: 10.0.1204 / Database dei virus: 1435/3451 -  Data di 
> rilascio: 18/02/2011
>
>



More information about the python-win32 mailing list