Newbie COM problem

Blair Hall b.hall at irl.cri.nz
Sun May 5 22:09:56 EDT 2002


I was trying to get the example from Chapter 5
"Python programming on win32" to work.

The example is a simple COM server. The code I have used is:

class PythonUtilities:
    _public_methods_ = [ 'SplitString' ]
    _reg_progid_ = "PythonDemos.Utilities"
    _reg_clsid_ = "{41B329A0-14D2-498B-9F49-55B7203BE0E7}"

    def SplitString(self, val, item=None):
        import string
        if item != None : item = str(item)
        return string.split(str(val),item)

if __name__ == '__main__':
    print "Registering COM"
    import win32com.server.register
    win32com.server.register.UseCommandLine(PythonUtilities)

The class id was obtained by doing
>>> print pythoncom.CreateGuid()

Now when I execute this script I get the following message

>>> Registering COM
Warning:  Can not locate a host .EXE for the COM server
The server will not be registered with LocalServer32 support.Registered:
PythonDemos.Utilities

Can anyone explain what might have gone wrong?

Thanks

Blair





More information about the Python-list mailing list