×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Callback Function

Callback Function

Callback Function

(OP)
What is a CALLBACK function ? Why it is used ?
         Thanks
           Moonoo

RE: Callback Function

A callback function is a function that you write that could be called by outside code (i.e. by windows functions).  You set up a callback function by passing the address of your function to the API from which your callback is referenced.

For example, I want my application to handle runtime exceptions rather than letting C++ runtime take care of things for me.  So I wrote a function called my_exception_handler(int, EXCEPTION_POINTERS*) and I call a Microsoft function called _set_se_translator and pass it the address of my_exception_handler.  

In the example above, my_exception_handler is a callback function -- I will never call it myself, but I pass the address of it to an API that will cause it to possibly be called.

Hope that helps!

Pat Gleason
gleason@megsinet.net

RE: Callback Function

its basically a Function pointer, it points to a function in memory, can be used inside and outside of a programming language some languagues cannot use callback functions from say VC++, like visual basic cant(unless you use an API by another dll and such)

Karl
kb244@kb244.8m.com

Experienced in , or have messed with : VC++, Borland C++ Builder, VJ++6(starting),VB-Dos, VB1 thru VB6, Delphi 3 pro, Borland C++ 3(DOS), Borland C++ 4.5, HTML,Visual InterDev 6, ASP(WebProgramming), QBasic(least i didnt start with COBOL)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close