What is CALLBACK? How it work?
what is the advantage of CALLBACK,
please explain with an example

Answer Posted / zero zero....

• callback function is a function that is called
through a function pointer.
• pass the pointer (address) of a function as an
argument to another, when that pointer is used to call the
function it points to it is said that a call back is made.
// 2.1 define a function pointer and initialize to NULL
int (*pt2Function)(float, char, char) =
NULL; // C
int (TMyClass::*pt2Member)(float, char, char) =
NULL; // C++
int (TMyClass::*pt2ConstMember)(float, char, char) const =
NULL; // C++

• A callback function is a function that is passed
to another function (in the form of a pointer to the
callback function) so that the second function can
call it. This is simply of way of making the second
function more flexible without the second function needing
to know a lot of stuff

Uses:
• A callback can be used for notifications
• callback functions can be used for updates, sort of
like hooking into another function. For example, consider a
function that downloads files using http. Your application
may want to display progress to the user. You could pass a
callback function (display progress) into the download
function so that it calls your display function everytime
it reads from the socket. At least that is my
understanding...

Is This Answer Correct ?    30 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to handle dynamic menus in mfc? What happens when client calls cocreateinstance?

691


How do I create a dialog box in mfc?

607


plzz tell me what we can do and dont in tally ERP & sap business one?

1878


2.create for 10 batch: Employee_Number Employee_name Employee_Dateofjoining Employee_address Employee_salary 1.select the employee name who deriving more than 10 thousand salary and joined before august 08. use structure and pointers

1809


what is functioning of DIalodDataXchange ..?

1188






What does mfc stand for?

956


Do you have an idea about MFC?

911


What is mfc class hierarchy?

614


What is the difference between Struts and JSF? Pls list some most suitable differences.

2843


what message is sent to an application when the user presses the primary button?

1384


how to repaint when working with horizontal scroll bar

1543


what is the meaning of constant FILE EXCEEDS LENGTH LIMIT while loading from ps file to vsam in the jcl?

3339


List out the basic features of MFC.

13678


I want recent paper pattern for HP company?

1783