COM server created with py2exe fails if CLSCTX_INPROC_SERVER
Thomas Heller
thomas.heller at ion-tof.com
Tue Nov 13 16:04:31 EST 2001
"Lu Ruguaya" <luruguaya at yahoo.com> wrote in message news:30f17542.0111130925.713c2aa5 at posting.google.com...
> I tried Thomas Heller's example changing
> _reg_clsctx_ to pythoncom.CLSCTX_INPROC_SERVER
> (his example uses CLSCTX_LOCAL_SERVER)
>
> It registers OK, but when I tried to use it from
> a VB client I get the following error:
>
> "Unexpected Python Error: exceptions.AttributeError: '__main__' module
> has no attribute 'HelloWorld'
>
> If I use LOCAL_SERVER, then it works like a champ.
>
> It obviously relates to the code:
> if hasattr(sys, 'importers'):
> # In the py2exe-packed version, specify the module.class
> # to use. In the python script version, python is able
> # to figure it out itself.
> _reg_class_spec_ = "__main__.HelloWorld"
>
> Any suggestions?
Currently you cannot create inproc COM servers with py2exe, point.
Thomas
More information about the Python-list
mailing list