Developer Documentation Library > Data Model > Extending the UNICOM Intelligence Data Model > Adding function libraries > Function library registration
 
Function library registration
Function libraries must be self-registering co‑classes. Additional to COM registration, the component must create a new key under:
HKEY_LOCAL_MACHINE\Software\SPSS\MR Function Library
Add the new key value as:
Key Name
The name of the function library; for example, mrFuncLib.
Default Value
The description of the component.
The new function library section can have the following values:
Server
The full path and name of the file that contains the type library. For Visual Basic .NET projects, the type library file must have a extension of.tlb.
A type library is a binary file that contains all of the type information needed to use .dll procedures or classes.
If the function library is implemented with Visual Basic or Visual C#, the Value is typically <filename>.tlb.
If the function library is implemented with Visual C++, the Value is typically <filename>.dll.
ExportedFunctions
A list of function names, separated by commas. The DLL or TLB file referenced by the Server registry value can contain multiple objects each with multiple methods; only the methods listed in the ExportedFunctions registry value are registered as function library functions, and only the objects with exported methods are created.
If ExportedFunctions is not specified or is an empty string, all methods of all objects in the function library are exported.
Script only functions
Function libraries might contain functions that are intended for scripting but not intended for use in Data Model queries. To ensure that these functions are not called by Data Model expressions, which might compromise security, the ScriptOnlyFunctions registration setting specifies which functions are available only to mrScriptBasic and not to the Data Model. Any function that is marked as ‘script-only’ is not loaded for the Data Model, so it cannot be called by a Data Model expressions. If a Data Model expression that contains a script-only function is executed, an error, “Function '%1!s!' is not defined”, is returned.
For more information, see Script only functions.
See also
Adding function libraries
Functions with hidden parameters
Functions with optional or variable parameters
Name resolution and function precedence
Custom function example