I am faily new to wxWidgets and right now I am issuing a problem with a solution I am currently developing on.
basically the solution consists of 3 components:
1. the engine class (derived from wxApp)
2. a dialog class (wxDialog)
3. and a thread that does constant evaluations (inherits of wxThread of course )
Inside my thread there can occour two events that I'd like to give to my engine class for further processing (getting different information, showing up the dialog if needed and so on)...
I am now trying to get these events work for quite a while but until now with very little progress (most progress is on my understanding of wxwidgets but not enough to solve this on my own ). I've tried several ways: with event tables, as well as the connect functions (I personally favor those). Most times I ended up with invalid static_casts to unresolved function types when trying to do connect or creating the event table.
The following is an example how I try to do it
Code: Select all
// This is my "controller", that starts a thread and shows a dialog if its needed
class MyEngine : public wxApp
// These Connects do not compile (wxEventHandler tries to cast statically to an "unresolved overloaded function type")
Connect(wxID_ANY, wxEVT_XXX, wxEventHandler(MyEngine::onThread1)), NULL, this);
Connect(wxID_ANY, wxEVT_XXX, wxEventHandler(MyEngine::onThread2)), NULL, this);
virtual bool OnInit()
pMyThread = new MyThread(this);
pMyDlg = new MyWXDialog( (wxWindow*)NULL );
void onThread1(wxEvent& evt)
// for example...
void onThread2(wxEvent& evt)
//This is the thread that does constant evaluations. It shall inform MyEngine if "event" one or two has been found
class MyThread : public wxThread
pMain = ref;
virtual ExitCode Entry()
// When I find out that my first (second as well) event happened I need to tell that MyEngine to take further steps...
I really hope one of the wx experts here can help me out. As I already mentioned the connect functions can not be compiled the way I implemented them. As well I am not sure if I implemented the events correctly (I always tried to do it the same way how various samples tryed to explain it to me)...
Maybe you even have a better idea how to do this. I am open to (and thankfull for) every possible solution.
Best Regards and thanks in advance