running a COM server in Python
Manoj Plakal
terabaap at yumpee.org
Tue Feb 26 03:44:34 EST 2002
Manoj Plakal wrote:
> Mark Hammond wrote:
>> Mark Barclay wrote:
>>
>>> Is there a way of coding a COM server that can be running before it
>>> is accessed
>>> by a COM client? I'm not sure if this makes sense, but I'd like to
>>> have a program
>>> running, that can be connected to, perhaps multiple times, without it
>>> having to
>>> create multiple instances of teh server, just have multiple clients
>>> using it.
>>
>> IIRC, it gets a little messy - you need to implement a LocalServer
>> object, and add it to the running object table (ROT). Searching old
>> posts at groups.google.com is probably your best bet.
>
> Take a look at the CVS tree of qasid.sourceforge.net.
> There's a small example of a wxPython GUI app that acts
> as a COM server. The COMHostServer function in qasidserver.py
> does the job of creating an instance of the server and
> registering it in the ROT.
Whoops, I was referring to an old version of the code.
You should look at file qasid_win32com.py, class
QasidCOMHostThread, method QasidCOMHostServer (cross fingers).
The sample GUI app is in testapp.py
For the curious, Qasid is an idea I had for encapsulating
platform-specific mechanisms for local intra-machine "desktop"
RPC with a portable API. This is an API can be used by
desktop apps to talk to each other for sending simple messages.
Currently, you have to use platform-specific stuff
like COM, or use XML-RPC/CORBA and implement a registration
and lookup service, or do ad-hoc things like
command-line parameters (Netscape/Opera/XMMS etc).
The idea is to have a simple API wrapping
the existing Win32 COM, AppleEvents, KDE DCOP and
Gnome CORBA/ORBit. So far, there's the Win32 COM
instantiation with a very thin API (start, register
method, stop). There's a short blurb on qasid.sf.net
about why CORBA and XML-RPC may not be a good idea
for intra-machine (between desktop apps) communication,
though they work great on the intra/internet. Haven't
had too much time to work on this since the initial
COM effort, but I do plan to get started on the
Apple Events backend sometime soon.
Manoj
More information about the Python-list
mailing list