When an event calls my callback function it uses another callback function. So instead of re-doing the code, I did a raw "C" call of the 2nd callback function. However, the 2nd callback function was never called.
In example below, do_more_stuff() was never entered, but do_stuff() and do_other_stuff() was called. What is wrong with my code?
Example:
button press 1 -> callback function callback1().
button press 2 -> callback function callback2().
int CVICALLBACK callback2(
int panel, int control, int event,
void *callback_data, int data1, int data2 )
{
if (event == EVENT_COMMIT)
{
do_more_stuff();
// we dont use PANEL, CONTROL, so hardcoding (0,0)
// is valid
}
} // end
callback2
int CVICALLBACK callback1(
int panel, int control, int event,
void *callback_data, int data1, int data2 )
{
if (event == EVENT_COMMIT)
{
do_stuff();
callback2(0,0,EVENT_COMMIT,0,0,0);
do_other_stuff();
}
return 0;
} // end callback1