Callback Data
- Updated2023-02-21
- 1 minute(s) read
Callback Data
Functions in the User Interface, DDE Support, TCP Support, RS-232, DataSocket, Utility, and ActiveX Libraries provide callbackData, eventCallbackData, and threadFunctionData parameters for user-defined data. These parameters are pointer-width values passed by the library to the callback function.
You can use these parameters as pointers to data objects that you need to access in the callback function. This way, you can avoid declaring the data object as a global variable. In the User Interface Library, for example, this means that conceptually the panel or control that is associated with the callbacks has ownership of the data object.
You can find examples of callback data in the toolslib control code. Browse through the code in toolslib\custctrl\fileBrowser.c. In the code, callback data is created in the FileBrowser_Create function.