[python-win32] IADsContainer.GetObject returns objects of different type than IADsContainer.Create

Arve Knudsen arve.knudsen at gmail.com
Tue Aug 4 10:49:06 CEST 2009


Looking at the implementation of PyIADs, I can see that the PutEx
implementation is commented out. This just gets more and more mysterious, to
me at least.
Arve

On Tue, Aug 4, 2009 at 9:56 AM, Arve Knudsen <arve.knudsen at gmail.com> wrote:

> To exemplify, when I try to call PutEx on <PyIADs at 0x0264A260 with obj at
> 0x003C1EB8>, which was obtained by calling QueryInterface(IID_IADs) on an
> object returned from IADsContainer.GetObject, I get an AttributeError:
> 'PyIADs' object has no attribute 'PutEx'. This correlates with the
> documentation for PyIADs at
> http://docs.activestate.com/activepython/2.5/pywin32/PyIADs.html.
> The __class__ of objects returned by GetObject, is <type 'PyIADs'>, whereas
> for Create it is <class win32com.adsi.ADSIDispatch at 0x0288DD20>. Why not
> just the second class, which appears more complete (i.e., it implements
> PutEx)?
>
> Arve
>
> On Mon, Aug 3, 2009 at 11:17 PM, Arve Knudsen <arve.knudsen at gmail.com>wrote:
>
>> Well, for one the representations of the objects returned by the two
>> methods are different and with one type I can access .PutEx but not
>> with the other.
>>
>> Arve
>>
>> On 8/3/09, Tim Roberts <timr at probo.com> wrote:
>> > Arve Knudsen wrote:
>> >>
>> >> I am thoroughly confused by win32com.adsi at this point. Right now I
>> >> am finding that IADsContainer.GetObject returns objects of a different
>> >> type than IADsContainer.Create, that expose only a subset of the
>> >> expected methods!
>> >
>> > How do you know?  Are you using dir() to look at the list of methods?
>> > That's not reliable with COM objects, unless you have used makepy on
>> > them.  The win32com stuff doesn't go query the complete list of methods
>> > and properties.  When you ask for one, it checks for it, and will
>> > remember that for later.
>> >
>> > --
>> > Tim Roberts, timr at probo.com
>> > Providenza & Boekelheide, Inc.
>> >
>> > _______________________________________________
>> > python-win32 mailing list
>> > python-win32 at python.org
>> > http://mail.python.org/mailman/listinfo/python-win32
>> >
>>
>> --
>> Sent from my mobile device
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20090804/ba0c789d/attachment-0001.htm>


More information about the python-win32 mailing list