LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can CALLBACK function be called in code or does it have to be rewritten as regular function

Solved!
Go to solution

This maybe is a silly question but has anyone called a CALLBACK function in code instead of just a response to user interface?

How can I pass info to it without knowing what the H file will renumber the controls to?

 

Thanks for not making fun of the question!

 

Dmitry

0 Kudos
Message 1 of 2
(2,427 Views)
Solution
Accepted by topic author CPST

You can call a control callback function in code: once you know the panel handle, you can call the function passing the panel handle (which I suppose you have stored in some variable), the control id in the form PANEL_CONTROLID the same way you pass it to e.g. SetCtrlVal and the event using EVENT_COMMIT and other macros thet you can find in userint.h

If you are using the Programmer's Toolbox (<cvi Folder>\toolslib\toolbox.fp) you can also use CallCtrlCallback command to invoke a control callback without knowing its name.



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?
Message 2 of 2
(2,414 Views)