04-23-2007 08:08 AM
04-23-2007 08:14 AM
Hello,
you could use the function CallCtrlCallback, which will fire the control's callback function. The panel and ctrl paramters should indicate the control you want to access (e.g. pnlHandle and PNL_SLIDE). The event parameter should be EVENT_COMMIT, and the eventData1 and eventData2 parameters can be 0. If you do not need the return value of the callback function, you can safely pass NULL for the last function parameter.
04-23-2007 08:25 AM
If you look at the help index for the events you want to use/simulate, there is a description of these other parameters. Don't forget, the information passed to the callback (such as eventData1) is provided by the system for your function to use: if you don't use the data there is no need to set it to a particular value in the dummy calls you want to make.
JR
04-24-2007 10:42 AM
Another approach (particularly if you are not doing things related to the callback event data) is to break out the functionality that needs to be called both via a callback, and directly, into its own function. Then you can just call that function wherever you like, including from any callback. For example:
void UpdateInputPanel() {
....
}
int CVICALLBACK InputCtrlCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event) {
case EVENT_COMMIT:
UpdateInputPanel();
// do anything else needed only in response to callback
break;
}
return 0;
}