Custom Functions > Function Definitions > CreateUserFunction
  
CreateUserFunction
This function registers with PTC Mathcad the custom function which is named in FUNCTIONINFO, and defined using the LRESULT structure.
const void * CreateUserFunction(hDLL, functionInfo)
HINSTANCE hDLL;
FUNCTIONINFO * functionInfo;
CreateUserFunction is called when the DLL is attaching to the address space of the current process in order to register the custom function with PTC Mathcad.
Parameter
Description
hDLL
Handle of the DLL supplied by the DLL entry point routine
functionInfo
Pointer to the FUNCTIONINFO structure that contains information about the function. The FUNCTIONINFO structure has the following form:
typedef struct tagFUNCTIONINFO{
char * lpstrName;
char * lpstrParameters;
char * lpstrDescription;
LPCFUNCTION lpfnMyCFunction;
long unsigned int returnType;
unsigned int nArgs;
long unsigned int argType[MAX_ARGS];
} FUNCTIONINFO;
Return Value
Returns a non-NULL handle if the registration is successful, NULL otherwise.