You can call a control's callback simply typing its name and filling the arguments as needed. A more polite way could be to use the toolbox function
CallCtrlCallback (panel, control, event, eventData1, eventData2, &retVal);
which treats correctly the ChainCtrlCallback added to the control (if any...).
That way your code will look so:
void CVICALLBACK Pomiar (int menuBar, int menuItem, void *callbackData, int
panel)
{
// ... Other source code
Pomiary (panel, control, EVENT_COMMIT, NULL, 0, 0);
// ... Other source code
return;
}
You must fill correctly the event and eventData parameter if necessary (look in userint.h for predefined macros for callback events and the use of eventData for single events).
You can also pass the callbackData parameters o
f the menu callback to the control callback that way:
Pomiary (panel, control, event, callbackData, 0, 0);
If you need to use PostDeferredCallback, you must build a transit function, for example:
void CVICALLBACK Pomiar (int menuBar, int menuItem, void *callbackData, int
panel)
{
...
PostDeferredCall (DefFunc, 0);
}
The transit function will look as follows:
void CVICALLBACK DefFunc (void *callbackData)
{
Pomiary (panel, control, EVENT_COMMIT, callbackData, 0, 0);
}
In this case you must be careful to the panel handle of the postdeferredcall function: either it is stored in a global variable or you must pass it in the callbackData parameter (casting it to a void* type in the caller and back to an int in the transit function before using it).
And that's all.
Remember that that way the Pomiary function is treated AFTER the caller function (and ts callers if any) are completely processed.
Roberto