Admin Production ni-theme
Current Publication

CallCtrlCallback

LabWindows/CVI

CallCtrlCallback

int CallCtrlCallback (int panel, int ctrl, int event, int eventData1, int eventData2, int *returnValue);

Purpose

This function calls the callback function for a control with the specified parameters.

If the control does not have a callback function then nothing is done.

One use of this function is to send user defined events to a control whose behavior has been customized using the ChainCtrlCallback function.

Parameters

Input
Name Type Description
panel int 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 int Pass the ID of the control for whose callback function is to be called.

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.
event int Pass the event number of the event to send to the control's callback.

This event can be a predefined event from userint.h (such as EVENT_COMMIT) or a user defined event (in the range from 1000 to 10000).

This function only calls the callback function for the control (if any). No control operation related the event will occur. For example, calling a button control's callback with EVENT_LEFT_CLICK will NOT cause the button to operate.
eventData1 int Pass data related to the event being sent.
eventData2 int Pass additional data related to the event being sent.
Output
Name Type Description
returnValue int Pass the address of an integer variable in which to store the value returned by the callback function.

If the return value of the callback function is not needed, you can pass zero (0) for this parameter.

Return Value

Name Type Description
status int Returns a positive number if the control's callback was called, zero (0) if the control does not have a callback function, or a negative error code if the function failed.

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.

Additional Information

Library: Programmer's Toolbox

Include file: toolbox\toolbox.h

LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later