EVT_CUSTOM function type errors...

Manuel Martín mmartin at ceyd.es
Thu Sep 6 12:33:11 PDT 2007


Hi, see below comments

> Hi all,
> 
> I have:
> 
> class MyApp: public wxApp
> {
> 	......
> 	void OnThreadEnd(wxCommandEvent &event);

   DECLARE_EVENT_TABLE() // This is needed inside class declaration

> }

Shouldn't it better to add semicolon after "}" ?
Or it is just a typo in this post?

> 
> BEGIN_EVENT_TABLE(MyApp, wxApp)
> 	EVT_CUSTOM( myEVT_THREAD_END, wxID_ANY, MyApp:OnThreadEnd)

Beside the ":" typo, where and how is myEVT_THREAD_END defined?
I presume you want it to be a wxCommandEvent.

> END_EVENT_TABLE()
> 
> void MyApp::OnThreadEnd(wxCommandEvent &event)
> {
> 	....
> }
> 
> On compiling under MSVS-2005, i get the error:
> cannot convert from 'void (__thiscall MyApp::*)(wxCommandEvent &)' to 'wxEventFunction'
> 
> Whats wrong with this??
> 
> Thanks in advance.

Please, don't forget to tell in your posts:
+ wx version
+ OS
+ complier

Manolo





More information about the wx-users mailing list