Cannot register dll created using "py2exe --com-dll"
Thomas Heller
theller at python.net
Tue Jul 29 14:10:06 EDT 2003
"Jordan Tucker" <jtuc at ev1.net> writes:
> A fix that seems to work (at least it lets DllRegisterServer succeed)
> is inserting the following before the aforementioned line:
>
> scriptDir = None
> if hasattr(sys, 'argv'):
> scriptDir = os.path.split(sys.argv[0])[0]
>
> This allows registration, but now when I try to instantiate one of the
> objects defined in my dll from the interpreter, I get the following
> error:
>
> Fatal Python error: PyThreadState_Get: no current thread
>
> This also happens with the server example included. Do I have to use
> something other than win32com.client.Dispatch to connect to an inproc
> server from a dll? I think I've used it before to do the same thing
> with non-py2exe dlls.
I don't know anything about the first error you get (the argv not set
problem), but the second is a known bug: You cannot use the python dll
com server from a Python client (at least if the client uses the same
Python version). This is because of the difficulties managing the
threadstate correctly. I hope Mark or I will be able to fix this bug
soon (in 2.3, with the help of PEP 311 it should be possible).
In the sample zip there's a VB script included to test the server, run
it in a console window with cscript.exe like this: 'cscript test_interp.vbs'.
Thomas
More information about the Python-list
mailing list