MR Michael Robellard (5314) schrieb:
> The same thing happens with just this code running, and this code
> running with additional python code running in the process.
> 
> That was the first thing we tried to isolate

Ok, I see.

What I (we, in our company) usually do is that we distribute COM servers
written in Python as dlls created by py2exe.  We choose the '-b1' option
to py2exe, the main advantage is not that less files are created but that
the resulting dlls contain a Python interpreter that is NOT loaded from
python.dll residing somewhere in the file system.  Instead py2exe does some
magic which creates a Python intrepreter that is totally isolated from any
other Pythons that may be in the same process (you never know how other
COM objects that the process may load are implemented).

In addition I have changed the script you have posted in several minor ways:

1. I enabled logging to redirects logging output, sys.stderr and sys.stdout
to the Windows OutputDebugString function, you can view it with sysinternals
debugerviewer.

2. I changed the GUID for the URLSearch object, also changed the progid.

3. I changed the TranslateWithSearchContext method code to my coding style,
maybe it is interesting to you.

4. I changed the object so that it automatically writes/removes the registry
value that is needed for InternetExplorer when it is registered/unregistered.

5. I changed TranslateWithSearchContext so that it forwards the search to this
page: http://starship.python.net/crew/theller/pyhelp.cgi

Testing the script running with python.exe, I see normal behaviour, except that
IE is not shutting down correctly when I close it - I have to kill it with the
task manager.  No idea why, and it may be worth to investigate this.

Testing the standalone dll, everything seems to work correctly. Also the process
shuts down correctly.

I did not test every possible _reg_apartment_ models, but I did not find that
they behaved differently.

I put a zip-archive (2MB) containing both the script (pyhelp.py) and the
frozen dll (pyhelp.dll) here:

    http://starship.python.net/crew/theller/pyhelp.zip

Please try it out, maybe the dll works better for you also.

Thomas

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to