# 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 4-byte 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.

User Interface Callback Function

TCP Callback Function

DDE Callback Function