Find and share HowTos to various installations / configurations!
4 posts • Page 1 of 1
4 posts
• Page 1 of 1
mmarchha
Posts:6
Joined: Mon May 16, 2011 8:33 am
call a given callback function from an control extension (dll)
Postby mmarchha »
Is there a way that a own control extension can call a callback function?
One example usescase would be that your control extension has a function that starts a calculation that might take a while an in your code you do not require the result immediately but you like to get a notification with the result.
//button clicked event
{
.....
registerResultCallBack("resultCB"); //function in your control extension to register the callback function that should be called
startCalculation(); //function in your control extension that starts the calculation
.....
}
resultCB(int value) //function that is called from your control extension as soon as the calculation has finished
{
txt1.text = value;
}
If it is possible, are there any examples available how to implement this?
Re: call a given callback function from an control extension (dll)
Postby mkoller »
Yes, this is possible and easy to do. E.g. it's how the HTTP Server starts the registered callbacks.
To start the registered function in a new thread, call CtrlScript::startFunc(), e,g.