LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Callback functions

Hi,
i'm new for LabWindows, but experienced in LabVIEW.
I see that all examples that shipped with CVI have one C file that includes all Callback Functions.
Sometimes it is not comfortable that all Callback Functions found in one C file.
For example if i have number of panels, it will be better if i can write C file for each panel with its Callback Functions.
Is it possible to do that?
0 Kudos
Message 1 of 5
(3,368 Views)
Hi,
yes it is possible - callbacks are just specially defined functions at the end of the day, so they can be distributed around your project as you see fit, just remember to #include the header file that goes with the UIR you created the panel in.

Hope that helps (example attached)

S.
// it takes almost no time to rate an answer Smiley Wink
Message 2 of 5
(3,368 Views)
Thanks SachaE,

and what is about *.h files. Can i make *.h file for each panel?
0 Kudos
Message 3 of 5
(3,368 Views)
The .h file contains the settings for the declared items in the panels (registered callback definitions, and constants for the panel, controls etc).
When you create a .uir a .h file is automatically generated.
It is possible to create a separate set of .h files by hand, but it's messy when you add / remove items.
Better, if this is what you really want, to use more .uir files, or create the panels and controls programatically.

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 4 of 5
(3,368 Views)
You can easily create .h files, related to a panel, separate from the .h file defining panel and control constants created automatically for your .UIR file. Don't mess with the .h file created for your .UIR file. Leave the panel and control constants and the callback function prototypes there. In your separate, manually created .h file, you can have prototypes for non-callback functions, constants (other than the panel and control constants), variable declarations, etc. You may need to include the new .h file in other .c files in your project.
0 Kudos
Message 5 of 5
(3,368 Views)