problems with pythoncom and VB-generated OLE/ActiveX DLL

Domenico grayshade at libero.it
Sat Feb 23 19:59:13 EST 2002


Here are the facts: I need to link a Python app with a small VB
frontend (I hadn't got enough time to deal with Tkinter or WxPython,
and the anygui version of that frontend I did was way too slow to be
of any use). I compiled the frontend as an ActiveX dll providing just
one class. Its constructor (class_initialize) shows a form and two
methods from this class are used to interact with it. I registered the
DLL, used it in another VB project and it worked as it was supposed to
do. Then I built a Python wrapper to the class via the script that
comes with win32all. I imported the script in an interactive session.

>>> import display
>>> d = display.Class1()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "C:\compilers\python\display.py", line 40, in __init__
    if oobj is None: oobj = pythoncom.new(self.CLSID)
pywintypes.com_error: (-2147221164, 'Interfaccia non registrata.',
None, None)

'Interfaccia non registrata' (in Italian) means something like
'Unregistered interface'. So I did:

>>> import pythoncom
>>> d = pythoncom.new("{***CLSID of the DLL***}")

getting the same error.
I'm not very much into the whole VB-ActiveX-COM stuff (I hardly recall
having programmed in VB for a couple years before I realized what a
messy language it was) so I actually don't know at all what to check.
Been lurking for a lot of time, I hoped I could come out with
something more clever as my first post -- well, next time. TIA.

import random
sigs = [ "why the hell do I think I can write intelligent stuff",
         "sorry I'm stupid",
         "well I guess I should have solved this by myself" ]
print "-".join(random.choice(sigs).split()) + "-ly y'rs"

Domenico

"If you don't know where you're going, turn back and look at where
you're coming from." (M. Ovadia)



More information about the Python-list mailing list