Hello, wxPython users!
I am building a proprietary PDF doc viewing program that uses a licensed
PDFViewer ActiveX control, which is much faster than Adobe's. Using that
ActiveX in VB works great, but getting it to work with Python caused me some
problems today. I load it the normal way (just like in
ActiveXWrapper_Acrobat.py in the wxPython demo suite) - using
win32com.client.gencache:
first I do:
pdfviewer =
win32com.client.gencache.EnsureModule('{00F29795-7D62-4BEF-AA43-F34B96A4DECB
}', 0x0, 1, 0)
and then:
ActiveXWrapper = MakeActiveXClass(pdfviewer.PDFViewer)
Which produces the following error:
Traceback (most recent call last):
File "docviewer.py", line 125, in ?
frame = TestFrame()
File "docviewer.py", line 121, in __init__
self.tp = TestPanel(self, sys.stdout)
File "docviewer.py", line 46, in __init__
self.pdf = ActiveXWrapper( self, -1, style=wxSUNKEN_BORDER)
File "C:\Python22\Lib\site-packages\wxPython\lib\activexwrapper.py", line
105,
in axw__init__
self._eventBase.__init__(self, self._dispobj_)
File
"C:\Python22\lib\site-packages\win32com\gen_py\00F29795-7D62-4BEF-AA43-F3
4B96A4DECBx0x1x0.py", line 73, in __init__
cp=cpc.FindConnectionPoint(self.CLSID_Sink)
pywintypes.com_error: (-2147220992, 'CONNECT_E_NOCONNECTION', None, None)
16:06:23: Debug: c:\PROJECTS\wx\src\msw\app.cpp(439):
'UnregisterClass(canvas)'
failed with error 0x00000584 (class still has open windows.).
16:06:23: Debug: c:\PROJECTS\wx\src\msw\app.cpp(446): 'UnregisterClass(no
redraw
canvas)' failed with error 0x00000584 (class still has open windows.).
Seems like the Python ActiveX object isn't created properly from the
PDFViewer DLL. I am new to Windows programming and especially to COM and
cannot figure out what exactly could cause that exception. If someone would
help me with pointing out something very obvious or, at least, where to
start looking, I'd really appreciate it. If the info I provided isn't
sufficient, I'd be happy to provide more.
Thank you all very much,
Alex