# GetChainedCallbackData

int GetChainedCallbackData (int panel, int ctrl, const char typeName[], void **callbackData);

## Purpose

This function retrieves the callback data for a callback function that was linked to a control by the ChainCtrlCallback function.

This function is typically used to implement helper functions which operate on controls which have been customized using ChainCtrlCallback.

As an example, imagine that ChainCtrlCallback is used to cause a help window to appear when the right mouse button is clicked on a control. If the callback data for the chained callback contained a pointer to a structure which described what help information to display, then GetChainedCallbackData could be used to implement hypothetical functions such as GetHelpInfo(panel, control, info) and SetHelpInfo(panel, control, newInfo). These functions would use GetChainedCallbackData to retrieve and/or modify the help information pointed to by the callback data.

## Parameters

Input
Name | Type | Description
panel | integer | The specifier for a particular panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function.
ctrl | integer | Pass the ID of the control for which the callback data of its chained callback with the specified type name is to be retrieved. The ID is the defined constant (located in the UIR header file) which was assigned to the control in the User Interface Editor, or the ID returned by the NewCtrl or DuplicateCtrl function.
typeName | const char [] | Pass in the string that was passed to ChainCtrlCallback to specify the type name of the link. Pass an empty string if you want to get the original callback data (if it exists) before any ChainCtrlCallback was performed. If the control has not been previously linked by ChainCtrlCallback with specified type name, then nothing is done and the error code UIEInvalidControlType (–45) is returned.
Output
Name | Type | Description
callbackData | void ** | Pass the address of a variable of type pointer to void (void *). The callback data that was specified in the call to ChainCtrlCallback will be placed in this variable.

## Return Value

Name | Type | Description
status | integer | Returns 0 if the function succeeded or a negative error code if the function failed. If the control has not been previously linked by ChainCtrlCallback with specified type name, then nothing is done and the error code UIEInvalidControlType (–45) is returned. The possible negative error codes are:
–1 to –999 | A User Interface Library error code. (Constants are available in userint.h.)
A description of any of these error codes can be obtained using the GetGeneralErrorString function in the toolbox.fp instrument driver.