wxEvtHandler::Connect
Riccardo Corona
coronariccardo at gmail.com
Thu May 17 00:43:00 PDT 2007
Thank you, it works!!
2007/5/16, Eran Ifrah <eran.ifrah at gmail.com>:
>
> Instead of connecting your event the way you did, do this:
>
> Connect(timer.GetId(), timerid, wxEVT_TIMER,
> wxTimerEventHandler(B::OnTimer), NULL, this);
>
> Eran
>
> On 5/16/07, Riccardo Corona <coronariccardo at gmail.com> wrote:
> >
> > Hi,
> > I've this situation:
> >
> > Class A{
> >
> >
> > }
> >
> > Classe B: public wxEvtHandler, public A{
> >
> >
> >
> > }
> >
> >
> > Now, when I try to connect a timer event into the costructor of B :
> >
> > ....
> > //timer is a wxTimer
> > B::B{
> > long timerid =3D ::wxNewId();
> > timer.SetOwner(this,timerid);
> > Connect(timer.GetId(), timerid, wxEVT_TIMER, (wxObjectEventFunction)
> > &B::OnTimer);
> > }
> > ....
> > I obtain this error:
> >
> > error C2440: 'type cast' : cannot convert from 'void (__thiscall
> > B::*)(class wxTimerEvent &)' to 'void (__thiscall wxObject::*)(class wx=
Event
> > &)'
> > Pointers to members have different representations; cannot cast
> > between them
> >
> >
> > What can it be the problem?
> >
> > --
> > Riccardo Corona
>
>
>
>
> --
> Eran Ifrah
> eran.ifrah at gmail.com
-- =
Riccardo Corona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-users/attachments/20070517/2c7=
61d15/attachment.htm
More information about the wx-users
mailing list