Hi,

I'm currently having trouble to write a COM-Server that has some special 
requirements:
- It needs to derive from IUnknown
- It needs to implement multiple interface from two different proprietary 
typelibs (dlls)
- It needs to implement a custom category

At first I started with pythoncom. I used the attribute _reg_catids_ to specify 
the category and _com_interfaces_ to specify the interfaces I want to 
implement. The client (proprietary 3rd party sw, no source) sees the server but 
throws some 0x80004005 error on CoCreateInstance.

I was hoping that I can just tell the COM dispatcher, "yes, I have these 
interface implemented" and implement the methods without really having the 
interface classes available.

I read, that pythoncom can only create components that use IDispatch so I guess 
the _com_interfaces_ idea won't work, will it?

Then I did some further research and found comtypes. I tried to write a server 
stub again. I used GetModule to load the type library containing the 
Interfaces, importing the generated interface classes and let the main server 
class extend these interfaces.

The first problem was, that comtypes did not support the _reg_catids_ attribute 
or anything similar so I had to add the Implemented Categories key manually to 
the registry.
Then, I was able to see the server through the client, which obviously filters 
by categories, but it still shows the same error as before.

So, what is the correct/best way to implement a server that needs to implement 
custom interfaces and categories? Or is it possible at all using python?

Thanks!

//Jan

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to