04-08-2009 06:10 AM
04-08-2009 07:39 AM
It seems a little inconsistent that there isn't one, but it's not going to be hard to do. Something like:
#include <userint.h>
int CallMenuItemCallback (int menuBar, int menuItem, void *callbackData,
int panel)
{
void (CVICALLBACK * CallbackFunction)(int, int, void *, int);
int retVal = GetMenuBarAttribute(menuBar, menuItem, ATTR_CALLBACK_FUNCTION_POINTER, &CallbackFunction);
if (retVal < 0) // error check
return retVal;
// If there is a callback, call it
if (CallbackFunction)
(*CallbackFunction)(menuBar, menuItem, callbackData, panel);
return 0;
}
might suffice?
(n.b.: code above untested)