LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the same CallBack function for deffernt command button?

Hi,

I'm writing a calculator UI.
I want to create a CallBack function  so every control on the calculator panel will operate it.
Once the program enters the function will be a switch - case condition for every button.
How can I do it without  creating a separate function for each control?

Thanks,

Eliran

0 Kudos
Message 1 of 3
(3,195 Views)

...you can specify the callback function in the UI editor yourself

cbf.png

 

0 Kudos
Message 2 of 3
(3,183 Views)

Once your application is compiled and run it loads these functions into memory.

 

With a callback you are actually giving the OS/Driver a pointer to where the function resides in memory, it will then, when the callback is fired, load this function, execute the code and return it into memory.

 

With this in mind, there should be no reason you cannot use the same function for multiple callbacks, have you found an issue when doing so?

0 Kudos
Message 3 of 3
(2,986 Views)