non static member function as an event handler

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
Sachin
Just popping in
Just popping in
Posts: 20
Joined: Wed Jul 06, 2005 09:42

non static member function as an event handler

Postby Sachin » Mon Aug 01, 2005 06:40

Hi
is it possible to use a non static member function of a class as an event handler for a control.....

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: non static member function as an event handler

Postby lindquist » Mon Aug 01, 2005 13:36

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

User avatar
Sachin
Just popping in
Just popping in
Posts: 20
Joined: Wed Jul 06, 2005 09:42

Re: non static member function as an event handler

Postby Sachin » Mon Aug 01, 2005 15:11

thats gr8.......thanx

User avatar
Coriiander
Just popping in
Just popping in
Posts: 1
Joined: Thu Aug 04, 2005 00:13

Re: non static member function as an event handler

Postby Coriiander » Thu Aug 04, 2005 00:19

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

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: non static member function as an event handler

Postby CrazyEddie » Thu Aug 04, 2005 09:20

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.

User avatar
FluXy
Just popping in
Just popping in
Posts: 14
Joined: Mon Aug 22, 2005 03:34
Location: Germany
Contact:

Re: non static member function as an event handler

Postby FluXy » Mon Aug 22, 2005 03:49

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 ;)


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 7 guests