Call back functions

Login to reply to this topic.
Thu, 2004-10-28 11:14
Joined: 2004-10-27
Forum posts: 18
Hi All

I am new to symbian.
I wanted to know the concept of call back functions in Symbian (may be a simple example will he very much helpful).

Thanks

Thu, 2004-10-28 11:57
Joined: 2004-07-28
Forum posts: 1379
Call back functions
Look at TCallback - most callbacks are wrapped up with one of them.

Essentially, a static/global function that returns a TInt and takes a TAny*

didster

Thu, 2004-10-28 12:03
Joined: 2004-10-27
Forum posts: 18
Call back functions
Thanks for the reply. But then whats the big difference between a ordinary function and a call back function.
Thu, 2004-10-28 12:09
Joined: 2004-07-28
Forum posts: 1379
Call back functions
Well a callback is just a global/static function with a known return type and a known parameter - basically one that can easily be called via a function pointer.  callback isn't a type of function - such as global or member function - its a word used to discrible a function where the caller knows what to pass.

Basically, any global/static function can be a callback - or any memeber function can be with some nasty C++ to call memebers via function pointers which is why members are usually avoided as call backs.  

You pass a pointer to a function to some other function, then later it calls you back - and to do that, it must know what parameters you are expecting - which is what the word callback is used to describe.

I haven't explained that too well, but I hope you get me.

didster

Thu, 2004-10-28 12:15
Joined: 2004-10-27
Forum posts: 18
Call back functions
Well Thanks
I was parallely studying the stuff and was looking at some examples. With your input my concepts have got more clearer.

Thanks for your inputs . Will get in touch with you if i require more information.

Again thanks for your time
  • Login to reply to this topic.