Link to home
Start Free TrialLog in
Avatar of yuhoo
yuhoo

asked on

CallBack Function

I am making a DLL, that at certain point should call back some function in my main EXE.

How to do this?

I need a small example of exported DLL function, that will receive information about address of call-back function in EXE, and example of calling call-back function from DLL.

I am using MS VC, and I work in plain C.
ASKER CERTIFIED SOLUTION
Avatar of faster
faster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of yuhoo
yuhoo

ASKER


      I can't follow you, Can you give me real example?

I suppose I should define lpcfunc as:

EXEEXPORTPROC *lpcfunc;

but how to define function that retrieves EXE's function pointer?
It is easy, just have another function defined in DLL:

setFuncPointer(EXEEXPORTPROC lpcfunc);

Let the exe call this function and pass the pointer in.