C++ – callback function in VC++ 6.0


What is callback function [CALLBACK EXPORT] ,how it works , is it infinite loop or recursive.
I have a piece of code in vc++ 6.0 can any body explain how it works.

timer_result=SetTimer(NULL,1,(t*1000),Timerflow); //say t=2,or t=10,


void  CALLBACK EXPORT Timerflow(HWND hWnd, UINT nMsg, UINT nIDEvent, DWORD dwTime)

Best Solution

A callback function is one which is called from outside your own code, normally by the operating system. In the example you give, the SetTimer function asks the OS to call your callback after a fixed time has elapsed.

Related Question