Robin,
My situation is this:
I have a comms interface card which is delivered with an API written in C.
I have a requirement to display some of the data received by the card using
a GUI. In an attempt to move away from MSVC, I am writing the GUI using
wxPython. I have reasonably large amounts of data coming in from the
interface, so I am therefore writing a DLL in C which contains some
initialisation for the card, and also starts a new thread which handles
data coming into the computer from the interface card. If I was writing it
all in MSVC I would post a thread message from the comms thread to the GUI
thread when a packet of data arrives, and then the GUI would decide whether
to display the result. This I believe is the obvious way to handle the
situation, providing a responsive GUI, and not requiring the comms thread
to be polled to see if new data has arrived.
I naturally want to achieve the same result using Python. I assumed that
posting a thread message (or a window command message) from C to Python
would cause an event in Python for which I could provide an event handler.
Whilst the PostMessage call in the DLL appears to be sent (There is no
error reported), I cannot find any evidence that a Python event is being
generated, either in the GUI thread or in the message queue of the frame to
which I send a message.
Is this assumption correct on how it should work? And if so, do you have
any hints as to how I should catch the message?
Thanks in hope
Ian