[python-win32] creating a long-running Python COM server

David Goodger goodger at python.org
Fri Sep 15 22:51:46 CEST 2006


On 9/14/06, Mark Hammond <mhammond at skippinet.com.au> wrote:
> Basically, you must:
> * Arrange for your process to be started
> * In your process, create a COM server object - ie, create an object with
> the _public_methods_ etc attributes, then use win32com.server.wrap to wrap
> it
> * Call pythoncom.RegisterActiveObject passing it this object.
>
> That should be enough to have GetObject attach to your instance.

Thanks for the clues. I had trouble getting my app to do anything in
response to COM messages, but some further digging revealed
pythoncom.PumpWaitingMessages, which the event loop could poll or or
it could run in a separate thread.

I will write this up as a recipe in the Python Cookbook; any comments
on my code (attached)?

Thanks again!

-- 
David Goodger <http://python.net/~goodger>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: comtest.py
Type: text/x-python
Size: 2449 bytes
Desc: not available
Url : http://mail.python.org/pipermail/python-win32/attachments/20060915/6c9f6926/attachment.py 


More information about the Python-win32 mailing list