473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

instance of COM-server with Win32all

Hi !

I seek how to define a COM-server in "mono-instance". Do you know if there
are policies for that ?
I sought much, but did not find anything. And i had difficult with english.

Python is great, Win32all is brilliant, but i am wedged in a corner.
* and sorry for my bad english * Babelfish was a great help *
@-salutations
--
Michel Claveau


Jul 18 '05 #1
2 1673
Michel Claveau/Hamster wrote:
Hi !

I seek how to define a COM-server in "mono-instance". Do you know if there
are policies for that ?
I sought much, but did not find anything. And i had difficult with english.

Python is great, Win32all is brilliant, but i am wedged in a corner.
* and sorry for my bad english * Babelfish was a great help *


I think you are asking how to create a "singleton" using win32com. The
simplest way is to *pretend* you have created one.

Consider an object setup like this:

class RealObject:
def foo(self)...
def bar(self)...

realObject = RealObject()

class COMOBject:
_public_methods_ = "foo", "bar"
def foo(self):
realOBject.foo()
def bar(self):
realObject.bar()

In this case, it doesn't matter how many "COMObject" objects are alive,
as they will always delegate to the single "RealObject".

If you want a true singleton, you will need to dig a little deeper into
win32com, and create your own "policy".

Mark.
Jul 18 '05 #2
Hi !

Thanks for your read of my message. Indeed, I seek a "global singleton". Il
have try singleton-tech, but when differents soft call my python-COM-server,
i obtain differents singleton (sic).

I want have an persistant-dictionary, common to all task on one computer.

I have look other softs :
- MsWord have an "handle instance" (!?)
- Delphi requires, at the beginning of an COM/OLE-project, to choose
"mono-instance" or "multi-instance".

For the moment, I circumvented the problem with a local-TCP/IP-server,
common to all the softwares of the computer, but if it's possible, I prefer
to integrate that in my COM-server. Can I hope for a solution with win32all
?

In all the cases, thank you very much, for your works, and forgive my bad
English.

@-salutations
--
Michel Claveau
mél : http://cerbermail.com/?6J1TthIa8B
site : http://mclaveau.com
NG : news://news.zoo-logique.org/programmation.Paradox

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Sridhar R | last post by:
Consider the code below, class Base(object): pass class Derived(object): def __new__(cls, *args, **kwds): # some_factory returns an instance of Base # and I have to derive from this...
6
by: Dmitry Karneyev | last post by:
Hi! I guess this question have been asked a lot of times, but please be tolerant and if you have any ideas share it. The question is: how to make availibale only one instance of application and...
18
by: Steve Barnett | last post by:
I want to ensure that there is only ever one instance of my app running on a single PC at any time. I understand that I can achieve this by using a mutex and, if I can't take ownership of the...
7
by: Göran Tänzer | last post by:
Hi, i've written a class which does some calculations for my web application. These informatinos are different for each page request - the current user is not important. i have about 10 aspx...
12
by: titan nyquist | last post by:
I have a class with data and methods that use it. Everything is contained perfectly THE PROBLEM: A separate thread has to call a method in the current instantiation of this class. There is...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.