views:

27

answers:

1

In documentation (C++ example)

LUnknown* pIUnknown = CreateInstance(slot);

I try this

>> import ctypes
>> print type(ctypes.cdll.lcomp.CreateInstance(0))
<type 'int'>

How to get IUNKNOWN and QueryInterface?

A: 

I guess that accessing COM object with ctypes might be a bit difficult. I would recommend to have a look to win32com included in the windows extensions by Mark Hammond.

You can start with this tutorial : http://www.boddie.org.uk/python/COM.html

I hope it helps

luc