[pdfwin.py] how to build a Python VARIANT Object for messageHandler

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[pdfwin.py] how to build a Python VARIANT Object for messageHandler

Laurent Delosieres

I am not so familiar with COM objects, especially with Python. I am using the PDFWindow class to open a PDF via Python, nevertheless, I cannot get the Adobe ActiveX events such as OnMessage and OnError. I tried to implement those two methods in the class PDFWIndow, but none of them are triggered. I noticed in the previous version of PDFWindow, a member called "messageHandler" was used, very likely to get the messages from the Adobe ActiveX component. Nevertheless, my problem resides in the conversion of a Python object to a VARIANT. I  tried automation.VARIANT(obj), but this is not working.

class Events(object):
        def OnMessage(self, event):

        def OnError(self, event):

events = Events()
pdf.messageHandler = automation.VARIANT(events)  <-- issue

Your help is more than welcome.


You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.