Problem registering com interfaces on win98

Juan Carlos CORUÑA jcc at ibdosnorte.com
Thu Mar 20 05:13:24 EST 2003


Hello all,

I have created several COM servers with Mark Hammond's win extensions
that work fine on win2000, but when I try to register the interface of
the COM server on a win98 machine I become the following error (Python
2.2.2 win32all-152):

>>> universal.RegisterInterfaces("{3185FECF-9258-415E-9478-D2C3D2532535}",
0, 1, 0, ["IrpcClient"])

Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\ARCHIV~1\PYTHON22\Lib\site-packages\XMLRPCLib\__init__.py",
line 29, in ?
    ["IrpcClient"])
  File "win32com\universal.py", line 63, in RegisterInterfaces
    _doCreateVTable(iid, name, is_dispatch, method_defs)
  File "win32com\universal.py", line 71, in _doCreateVTable
    defn = Definition(iid, is_dispatch, method_defs)
  File "win32com\universal.py", line 153, in __init__
    entry = Method(info)
  File "win32com\universal.py", line 102, in __init__
    all_names, dispid, desc = method_info
ValueError: unpack tuple of wrong size

I inspected the value of the method_info variable and here are the
results, for win2000:

method_info = ('execute', 'method', 'params', 'result'), 1000, (1000,
(), ((8, 1, None, None), (8204, 17, None, None), (16396, 10, None,
None)), 11, 4, 1, 28, (3, 0, None, None), 0)

and for win98:

method_info = ('execute', 1000, 1, ((8, 1, None, None), (8204, 17,
None, None), (16396, 10, None, None)), (3, 0, None, None), ('method',
'params', 'result'))

as you can see on win2000 the tuple has 3 elements (this is correct),
but on win98 the tuple has 6 elements. the information contained is
similar, but the structure is very diferrent!

Inspecting the universal module I see the following lines, that sets
the method_defs variable (method_defs is a list of several method_info
tuples):

            sub_mod = gencache.GetModuleForCLSID(iid)
            is_dispatch = getattr(sub_mod, name +
"_vtables_dispatch_", None)
            method_defs = getattr(sub_mod, name + "_vtables_", None)

Then the problem seems to come from the gencache module.

Anyone knows this problem?
Why is the behaviour different from win98 to win2000?
Any solutions or workaround?




More information about the Python-list mailing list