SSAddCustomFunction Function
Applies To
fpSpread DLL control
Description
Adds a custom function to the Spread control's equation parser.
Syntax
C
BOOL SSAddCustomFunction(HWND hWnd, LPCTSTR FunctionName, short ParameterCnt, FARPROC lpfnFunctionProc);
C++
BOOL TSpread::AddCustomFunction(LPCTSTR FunctionName, short ParameterCnt, FARPROC lpfnFunctionProc);
Parameters
The following parameters are available:
| Parameter | Description |
| hWnd | Window handle of the fpSpread control |
| FunctionName | Pointer to a string defining the function name |
| ParameterCnt | Number of parameters required by the function (Value can be SS_CALC_VARPARAMS to let your custom function receive a variable number of parameters.) |
| lpfnFunctionProc | A procedure instance for the callback function used to perform the user-defined function |
Remarks
This function is applied to the entire workbook, including all sheets in the control.
The user-defined function has the following syntax:
int CALLBACK lpFunc(LPSS_VALUE lpResult, LPSS_VALUE lpValues, short nValueCnt);
| Parameter | Description |
|---|---|
| lpResult | Pointer to structure with result |
| lpValues | Pointer to an array of values |
| nValueCnt | Number of values in array |
Return Value
TRUE if the function completes successfully; FALSE otherwise.
See Also
Creating and Using Custom Functions
SSAddCustomFunctionExt function
ActiveX Correspondence
AddCustomFunction method