LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Why I can't change the type ?

Why I can't change type of the value
which return callback function
associated with menuBar ?

void CVICALLBACK Pomiar (int menuBar, int menuItem, void *callbackData, int
panel)
{

}

How to change returned value type of the menuBar callback function ?
0 Kudos
Message 1 of 3
(3,028 Views)
Seems that since the menu callbacks (the same as controls' callbacks) are built-in pre-defind function of CVI, you cannot change anything of their structure.
You should have to change the way the CVI run-time engine treats menu events in order to modify menu callback structure.
As a workaround for your need, I can suggest you to manipulate an application- or module-level variable inside the menu callback and check the variable's state elsewhere in the program where you need to receive some return from the menu callback.
HOpe this helps a little
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 2 of 3
(3,028 Views)
It's like that !. So you can't change a function prototype, especially a callback function. If you want to return a value, you can use the callbackData that is a pointer to any kind of object. For example, a structure, an interger,...When executing the callback function, that object must be valid : static memory, global memory. You can sets the callback Data by using SetMenuBarAttribute (panel, menubar, ATTR_CALLBACK_DATA, &object);
0 Kudos
Message 3 of 3
(3,028 Views)