   callback functions driving me nuts!!
  hi!,i''ve been searching all over the net and i couldn''t find A THING about how to implement callback functions.i want to make a callback member function on my class, but i don''t know how to do it (i wanna make a timer class that handles the events by itself) so can you help me?? HOW DO I IMPLEMENT A CALLBACK FUNCTION??thanks in advance 
  I think that class member can not be a CALLBACK function.But i''am not 100%sure :D "The Gods Made Heavy Metal And They Saw That It Was Good They Said To Play It Louder Than Hell We Promised That We WouldWhen Losers Say Its Over With You Know That It’s A Lie The Gods Made Heavy Metal And It’s Never Gonna Die"THE GODS MADE HEAVY METAL/by  ManOwaR  ;  function-pointer.org, specifically How to implement callbacks in C and C++Google is also your friend. ;  http://function-pointer.orgClass memebers may be callbacks, check out the other threads on this topic. ;  Assuming that you, like the hundreds of posters before you who asked the very same question (without bothering to do a forum search), want to use a non-static   member function as callback, here is the minimum code to "make it work" - that is, how to make a call via a pointer to member. Pointers to static members really are just the same as pointers to non-members. class Foo{public:   int bar(int);};int (Foo::*mfptr)(int);mfptr = &Foo::bar;Foo obj;Foo* ptr = new Foo;(obj.*mfptr)(10);(ptr->*mfptr)(10);The callback API will have to be designed specifically to accept pointers to Foo members, not just ordinary pointers. If it hasn't   (e.g. Win32 API), it is simply impossible to make it work in C++.  You will also have to pass the pointer and the object separately to your callback API and let it rejoin them at the last moment. The expression obj.*mfptr is known as a bound pointer to member   and cannot   be manipulated in any   other way but immediately calling it. No assigment to a variable, no passing to a function, no nothing.   “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”    — Brian W. Kernighan (C programming language co-inventor) [edited by - Fruny on February 6, 2004 3:38:09 AM]