COM server created with py2exe fails if CLSCTX_INPROC_SERVER

Lu Ruguaya luruguaya at yahoo.com
Tue Nov 13 12:25:24 EST 2001


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?

Lu Ruguaya

(Thomas code can be found in:
http://groups.google.com/groups?hl=en&rnum=3&selm=9eag5l%241muh3%241%40ID-59885.news.dfncis.de)



More information about the Python-list mailing list