[python-win32] Finding the COM server
theller at ctypes.org
Fri Oct 12 20:57:03 CEST 2007
Tim Roberts schrieb:
> Kevin Patterson wrote:
>> Does the registry get updated every time the comserver is run? For
>> example I know some of my users keep multiple copies of the same rev
>> (or different revs) in different directories. My script often gets
>> called after the COM server is up and running:
>> So user has:
>> The appA may be the one originally installed, but appB directory may
>> be another copy of the same app only with different config files. If
>> the user ran appB would the register still points to appA.
> Well, this is a good question, and having looked into it in more depth,
> I've discovered that I don't know the answer.
> Out-of-process servers call CoRegisterClassObject to register their
> classes with the COM runtime. That doesn't change the registry. I
> can't find a COM utility to return the process ID for a given CLSID, and
> without that, I don't know how you'd find the executable name.
I think that's not entirely correct. Out-of-process servers call CoRegisterClassObject
*only* to make the class factory available to the COM runtime. The server is still
started with CoCreateInstance looking into the registry for finding the executable
I event think that at least /some/ out-of-process servers update the registry
each time they are started. But, a simple experiment should find out if that's
the case for the OP's app.exe.
More information about the python-win32