From: sadkjl on
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

From: Piotr Starczewski on
You need to add DECLARE_EVENT_TABLE() macro in your class declaration.

Regards,
Peter

sadkjl wrote:
> 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(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
>
>
>
>

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

From: sadkjl on
Thank You, this was the hint I needed.

Paul


Piotr Starczewski schrieb:

> You need to add DECLARE_EVENT_TABLE() macro in your class declaration.
>
> Regards,
> Peter
>
> sadkjl wrote:
> > 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(a)lists.wxwidgets.org
> > For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wx-users-unsubscribe(a)lists.wxwidgets.org
> For additional commands, e-mail: wx-users-help(a)lists.wxwidgets.org