Cannot register dll created using "py2exe --com-dll"

Thomas Heller theller at
Tue Jul 29 11:13:46 CEST 2003

Mark Hammond <mhammond at> writes:

> Giles Brown wrote:
>> I'm feeling quite dumb this morning.
>> I'm trying to build a COM server DLL using py2exe and it ain't
>> working.

Does the sample server work for you? I have tested it with 2.2.2 and
2.3rc2, and win32all build 154 and 155.

> Not too surprising seeing as it was checked in just days ago :)
>> Command line for registering dll:
>> regsvr32 c:\pvcs\madeupname\model\dist\application.dll
>> Result when I try to register dll:
>> """DllRegisterServer in c:\pvcs\madeupname\model\dist\application.dll failed.
>> Return code was: 0x80040201
>> """
> This generally just means that there was a Python exception.  As
> regsvr is a GUI app, the exception is lost.  You may like to add
> "import win32traceutil" at the top of your script (see
> for details) - or if that fails, at the top of
>> I have tried an exe server, but this does not register either.
> Try an EXE server build with the console flag set.  This should allow
> you to see the exception without redirecting error output.
>> Also does anyone know what argument to use to get py2exe to build something
>> other than "application.[dll/exe]".  I thought 'output_base' as an argument
>> to setup() would do it, but no joy.
> Can't recall - sorry.

There is no such flag. I simply forgot to remove the commented-out
'output_base' option from the sample file.


More information about the Python-list mailing list