Kelie schrieb:
> Thomas Heller <thel...@...> writes:
>> 
>> Anyway, you should NOT use 'cast' with COM object pointers. Last,
>> but not least, 'cast' doesn't handle the COM reference count correctly.
>> 
>> Please use 'QueryInterface' with them, like so:
>> 
>> block = obj.QueryInterface(ACAD.IAcadBlockReference)
>> 
> 
> Thanks Thomas. I'm getting an error using QueryInterface.
> 
>> "C:\Python25\pythonw.exe"  "C:\Python25\codes\autocad\temp\cast_test.py" 
> Traceback (most recent call last):
>   File "C:\Python25\codes\autocad\temp\cast_test.py", line 9, in <module>
>     block = obj.QueryInterface(ACAD.IAcadBlockReference)
>   File "C:\Python25\Lib\site-packages\comtypes\__init__.py", line 1069, in
> QueryInterface
>     self.__com_QueryInterface(byref(iid), byref(p))
> _ctypes.COMError: (-2147467262, 'No such interface supported', (None, None,
> None, 0, None))

I guess this means, well, that the interface is not supported.

BTW:  Sometimes, interfaces ARE supported by COM objects but cannot
be marshalled across process boundaries.  You also get the above error
in this case.

-- 
Thanks,
Thomas


------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to