A script-enabled browser is required for this page to function properly.

Defining Foreign Functions in Multiple Dynamic Link Libraries

Foreign functions developed for use in Oracle Forms for Windows are contained in DLLs. Oracle Forms establishes a single DLL, FRMXTB32.DLL, for containing foreign functions. FRMXTB32.DLL is the default DLL for containing foreign functions. Multiple foreign functions can be contained in a single DLL.

Using a single DLL that contains all foreign functions can cause conflicts, especially when two programs try to access the same DLL. To alleviate dynamic library conflicts, Oracle Forms supports multiple user exit DLLs; foreign functions can be contained in multiple DLLs without restrictions on the name of the DLL.

FORMS_USEREXITS Parameter

The FORMS_USEREXITS parameter in the registry allows you to define multiple DLLs to contain foreign functions that can be invoked from a user exit. The FORMS_USEREXITS parameter includes a semicolon delimited List of user exit DLLs.

This is an example of defining multiple user exit DLLs

FORMS_USEREXITS = C:/mathlib/add.dll;C:/mathlib/mult.dll;

A DLL loads into memory when any one of the foreign functions it contains is invoked from the user exit. Although the FORMS_USEREXITS parameter can List many DLLs that each contain multiple user exit foreign functions, only one such DLL is in memory at any time.

Oracle Forms determines the foreign function to invoke from a user exit using the following criteria:

NOTE: To avoid calling an unexpected foreign function, do not use the same foreign function name more than once in any of your user exit DLLs. An example of a non-unique function name is when two different functions have the same name, but are contained in different user exit DLLs.

User Exit Cache Memory

Oracle Forms deals with non-unique function names by maintaining a user exit cache memory. Exiting a form clears the user exit cache memory, otherwise the user exit cache memory retains the last called foreign function in memory until you call another foreign function.

Invoking a foreign function that has a non-unique function name depends on what is in the user exit cache memory. The first occurrence of a foreign function with a non-unique function name that follows the foreign function in the user exit cache memory is invoked.

If the user exit cache memory is empty, the first occurrence of a function with the non-unique function name in the List of DLLs is invoked. Because the cache memory is not cleared until you exit a form, subsequent calls to a non-unique function name may result in an unexpected foreign function call. For instance, you may accidentally call a function that follows a function with a unique name as opposed to calling a function that appears earlier in the sequence of user exit DLLs. Although in many cases, the user exit cache memory correctly identifies foreign functions with non-unique names, you should use unique foreign function names in the List of DLLs that are members of the FORMS_USEREXITS variable whenever possible.