I have a MFC based application where various dialogs are implemented as
extension DLLs. I've made a
special extension DLL which loads Python and exposes some of the
applications objects using Boost.
The Python code loaded is a wxPython based dialog (wxFrame). There is one
feature in the current
application I don't see how to 'integrate' into the python extension DLL.
The application is constructed so that if there is no (user) activity for a
defined time period, the
'kernel' closes down all open dialogs and presents a new login-window. So,
whenever an extension DLL
opens a dialog (MFC CDialog), the extension DLL notifies the 'kernel' that
the dialog is open. When
the dialog is closed (user terminates) the extension DLL notifies the
'kernel' again. If there is a
timeout condition, the 'kernel' will force the closing of the current open
dialog(s) by sending a
WM_COMMAND / IDCANCEL (win32) message to the dialogs.
My special extension DLL also opens a CDialog (not visible though) and in
the OnInitDialog, I create a
thread which executes the Python code. When the Python dialog is closed,
the thread-code sends a
WM_COMMAND / IDOK to the invisible dialog before ending.
Given that I in my OnCancel method in the invisible dialog would propagate
the message to the Python
code, how would I set up the Python code (wxFrame) so that I'm able to
receive (and process) such
a (win32) message - and also how would I send the message from the C++ code.
I was thinking of user a timer (in the Python code) to read a flag (which
would be set by the OnCancel
method in the invisible dialog) at regular intervals and upon correct
condition initiate the
termination, however I would prefer not to have a 'polled' system.
Thanks for any help.
Nikolai