What Does the Return Value of a LabWindows/CVI Callback Function Do? Primary Software: LabWindows/CVI Development Systems>>Full Development SystemPrimary Software Version: 8.5.1 Primary Software Fixed Version: N/A Secondary Software: N/A
Problem: I noticed that by default my CVI Callback Functions for User Interface events return 0. What are the different options for the return value and what do they do? Solution: A CVI User Interface (UI) callback function gets called whenever there is an event on the UI component and you generally use a switch statement to handle the different events. The function is called for every single event that happens on that UI component whether or not you have any code to handle that event. You can modify this behavior by changing the return value of the callback function. According to the CVI Help:
For instance, clicking on a Command Button in CVI normally generates multiple events, EVENT_LEFT_CLICK and EVENT_COMMIT among others. One thing to keep in mind however, is that not all events are swallowable. The CVI Help lists the events that are swallowable. Related Links: KnowledgeBase 2619O5XL: Why Do Callbacks Get Called More Than Once? LabWindows/CVI 8.5 Help: Swallowing Events Attachments:
Report Date: 05/07/2008 Last Updated: 05/09/2008 Document ID: 4L6AR9PE |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
