COM with Python?

Mark Hammond MHammond at skippinet.com.au
Thu Jul 8 03:40:16 EDT 1999


Gordon McMillan wrote in message <1280807192-67537824 at hypernet.com>...
[Markus Stenberg]
> > >Spesifically, I'm looking for information on activation policies; how
to
> > >implement idispatch objects that are singletons for a single machine.
[Mark Hammond]
> > Your best bet is DejaNews - the singleton subject was done fairly
> > thourghly a while ago, and no significan changes have been made to
> > the COM package to make it any eaiser (alas)


> Hmm. I've read those posts, and never did find a resolution.

Well, what I meant was that all the threads Gordon mentions has done the
topic, as far as I can tell, pretty much to its conclusion with the current
state of win32com.  I agree the solutions, if applicable, still dont really
qualify as a "resolution".  Anything better will require some win32com
changes tho, and these havent been made (or even identified)

Ive never needed to implement a singleton, but my personal solution (from
someone else I cant recall in those threads) would be to implement the
functionality in a single Python object and have the COM objects delegate to
it.  Thus you dont really have a singleton COM object (as you are giving off
as many as necessary) but by keeping the functionality and state in a single
Python object you are can get the same result (for most cases!)

Mark.








More information about the Python-list mailing list