AW: Error using event table in derived wxDialog class

Joerg Toellner toellner at oss-gmbh.de
Fri Jan 19 07:45:11 PST 2007


Hi sadkjl,

I'm not an expert, but i do always:

private:
    DECLARE_CLASS(myClassName)
    // any class wishing to process wxWindows events must use this macro
    DECLARE_EVENT_TABLE() 

In my class declaration in the .h file. The comment is produced from the
wxWizard, so i think it is mandantory and i miss that line in your code.

Try to use the DECLARE_EVENT_TABLE() macro in your dialog derived class .h
file additional to your BEGIN_EVENT_TABLE in the .cpp file.

Hope this helps
CU
Joerg

-----Ursprüngliche Nachricht-----
Von: sadkjl [mailto:sadkjl at gmx.de] 
Gesendet: Freitag, 19. Januar 2007 16:24
An: wx-users at lists.wxwidgets.org
Betreff: Error using event table in derived wxDialog class


Hello all,


I'm trying to derive a class from the wxDialog class. Everything is working
fine. But when I try to create an event table for the derived class I get
the following error (Visual
C++ 2005):

// error:
warning C4356: 'wxDialog::sm_eventTable' : static data member cannot be
initialized via derived class error C2509: 'GetEventTable' : member function
not declared in 'EditMatsDialog'
       see declaration of 'EditMatsDialog'
warning C4356: 'wxDialog::sm_eventHashTable' : static data member cannot be
initialized via derived class error C2509: 'GetEventHashTable' : member
function not declared in 'EditMatsDialog'
       see declaration of 'EditMatsDialog'
warning C4356: 'wxDialog::sm_eventTableEntries' : static data member cannot
be initialized via derived class // end error

Can someone tell me where I am wrong??

Thanks in advance,
Paul

-----------
Below the code:

// header:

class EditMatsDialog : public wxDialog
{
private:
.......

public:
	EditMatsDialog( unsigned hnd, wxWindow* parent, int id = -1,
		wxString title = wxT(""), wxPoint pos = wxDefaultPosition,
		wxSize size = wxSize( 450,460 ),
		int style = wxCLOSE_BOX|wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP
); .........

public:
	static const int ID_APPLY;
	void OnButton(wxCommandEvent &event);

};
// end header


// CPP:
........
const int EditMatsDialog::ID_APPLY = ::wxNewId();


BEGIN_EVENT_TABLE(EditMatsDialog, wxDialog)
	EVT_BUTTON(ID_APPLY, OnButton)
END_EVENT_TABLE()

............
...........
//end CPP




---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wx-users-help at lists.wxwidgets.org






More information about the wx-users mailing list