VARKON Version 1.15 1997-10-24


load_dll - Function

Loads a dynamic link library


Description

Loads the named library into memory and links it to VARKON so that functions within the library can be called with the call_dll_function() routine. After a library is loaded it remains in memory and need not be loaded again unless it is unloaded using the unload_dll() routine. Multiple libraries may be loaded at the same time.

load_dll() is only useful in VARKON for Windows95. MBS-programs including calls to load_dll() will compile and run without errors on all platforms but not actually load a dll on other platforms than Windows95/NT.

Syntax

load_dll(name)

STRING name;

Principal parameters

name        - The name of the dll library file. If a path is not included the Windows standard
directories will be searched.         

Optional parameters

None.


Return value

An INT equal to zero if the library was loaded or -1 if an error occured. 1 is returned if the library was already loaded.

Examples

status:=load_dll("C:\MYLIB\MYDLL.DLL");

Loads the MYDLL library in the C:\MYLIB directory. If successful status = 0. If not successful status = -1. If the library already is loaded status = 1.

Comments

load_dll() can be used to load libraries written in any language and compiled with any compiler as long as they conform to the rules of a standard Microsoft Dynamic Link Library. See the call_dll_function() for more information about using dll's.

The maximum number possible to load at the same time (without unloading) is currently set to 25.

It is not regarded as an error to load the same library two or more times without unloading it first. If a library is already loaded load_dll does nothing and returns 1.


VARKON Homepage Index