Implementing callback | developer.brewmp.com Implementing callback | developer.brewmp.com

Developer

Implementing callback

Forums:

Hi,

I want to implement callback thinggy in Extension i developed.

This extension does some file and reporting stuff, and when finishes up should call a function which is specified by calling applet's function pointer.

Say, I m putting one function in my extension to register a routine specified by applet which makes use of extension.
e.g. boolean IEXT_registerCall(_pointer_to_applet_function);

Now my applet will call this function to register any of its routine,
e.g. IEXT_registerCall(myRoutine)

How can i achieve this?

Thanks in advance

From your main applet you create an instance of your extension(which similar to windows dll). Now from your main applet pass the call back funciton pointer to your extension and extension can hold onto the callback function pointer. When the extension needs to callback to the main applet it just uses the callback function pointer to make function call to main applet.

From your main applet you create an instance of your extension(which similar to windows dll). Now from your main applet pass the call back funciton pointer to your extension and extension can hold onto the callback function pointer. When the extension needs to callback to the main applet it just uses the callback function pointer to make function call to main applet.

Thanks ruben.
It worked. :)

Thanks ruben.
It worked. :)

hi navaltiger
i'm trying to do the same thing. Can u please give me an example of code?
thanks in advance

hi navaltiger
i'm trying to do the same thing. Can u please give me an example of code?
thanks in advance