Programming Guide



sm_slib_install

Installs a function from a DLL into a Panther application

int sm_slib_install(char *fnc_spec, int language, int return_type);

fnc_spec
A string that includes the name of the function to install and a comma-delimited list of its argument types enclosed in parentheses:
"func-name(param-list)"

Panther supports string and integer arguments, specified by s and i, respectively. Specify any combination of strings and integers from zero to five arguments. Panther also supports functions with six integer arguments.

For example, this statement installs the Windows library function FindWindow, which expects two string arguments:

err = sm_slib_install
("FindWindow(s,s)", SLIB_C, SLIB_INTFNC);

language
Specifies which language calling convention to use when pushing this function's arguments onto the code stack. The convention that you specify must conform to the order in which the function expects to find its arguments stacked. Supply one of these identifiers:

SLIB_C
Arguments are pushed onto the stack in left-to-right order. Windows functions usually use this convention.

SLIB_PASCAL
Arguments are pushed onto the stack in right-to-left order. Microsoft Visual C++ does not support this convention.

return_type
The installed function's return type, specified by one of these arguments:
SLIB_INTFNC
SLIB_STRFNC
SLIB_DBLFNC

SLIB_ZROFNC
SLIB_ZROFNC specifies to ignore the installed function's return value and always to return 0.

Environment

Windows

Returns

Description

sm_slib_install installs the specified function from a shared library previously installed by sm_slib_load. Panther searches for the function in all libraries loaded by sm_slib_load, starting with the one most recently loaded. This function is installed as a prototyped function and can be called directly from JPL modules.

Note: In the Windows distribution, Panther automatically loads the DLLs KERNEL32 and USER32 in that order. All functions in these libraries are available for installation.

See Also

sm_slib_load