Page 1 of 1

non static member function as an event handler

Posted: Mon Aug 01, 2005 06:40
by Sachin
Hi
is it possible to use a non static member function of a class as an event handler for a control.....

Re: non static member function as an event handler

Posted: Mon Aug 01, 2005 13:36
by lindquist
Many posts have already been made about this.
You might want to check out this one:
http://www.cegui.org.uk/modules/newbb/v ... 21&forum=2

Re: non static member function as an event handler

Posted: Mon Aug 01, 2005 15:11
by Sachin
thats gr8.......thanx

Re: non static member function as an event handler

Posted: Thu Aug 04, 2005 00:19
by Coriiander
Unfortunately I can't see what's so great about it. My program simply keeps crashing at

mButton->subscribeEvent(CEGUI::PushButton::EventClicked, CEGUI::Event::Subscriber(HandlerClass::eventHandler, handler));

and yes :p The CEGUI is up and functional, and the mButton is there too.


I *dont* have this problem in Release Mode (VC7.0)
only in Debug Mode...

BEen looking for hours, but just can't find the bug

Re: non static member function as an event handler

Posted: Thu Aug 04, 2005 09:20
by CrazyEddie
Hi,

It would be helpful if you posted some diagnostic information; stating that te program crashed is a little vague ;)

Check that you're linking your program with the correct runtime; that is 'Multithreaded DLL' for release builds and 'Multithreaded Debug DLL' for debug builds (you basically need to ensure that everything is built using this same configuration, or you will get issues.

If the above is not the problem, you'll need to post some relevant parts of CEGUI.log, the exact exception that's causing the program to crash, and some lines of code to show, in context, what you are doing.

Re: non static member function as an event handler

Posted: Mon Aug 22, 2005 03:49
by FluXy
Just wanted to say that i had the same issue with 0.3 and 0.4 CVS !

Compiler : VC 7.1
Freetype : 2.1.10
Xerces : 2.6
Renderer : OpenGL

The problem came from the libs because i used the release CEGUI libs in debug ;)