Example Code

Programmatically Creating Controls and Panels in LabWindows/CVI

Code and Documents

Attachment

This program demonstrates how to programmatically create panels and controls in LabWindows/CVI. This can be done with functions found in the User Interface Library, which comes with LabWindows/CVI 6.0. This program also demonstrates how to associate a callback function with a control at runtime. A second .h file has been created, which contains the prototype of the callback function associated with one of the programmatically created controls. This second .h file is created because when the .uir file, which contains the primary panel, is saved it overwrites the first .h file. Therefore, if a callback function that is not associated with a pre-runtime created control is declared in the first .h file, it will be overwritten and lost.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors