open_dll

Definition: atom a = open_dll(string st)
Description: Open a Windows dynamic link library ( .dll) file, or a Linux shared library ( .so) file. A base address will be returned, or 0 if the file cannot be found. st can be a relative or an absolute file name. Windows will use the normal search path for locating .dll files.
Comments: The value returned by open_dll() can be passed to define_c_proc(), define_c_func(), or define_c_var().

You can open the same .dll or .so file multiple times. No extra memory is used and you will get the same address returned each time.

Phix closes the .dll or .so for you automatically at the end of execution.
Example:
atom user32
user32 = open_dll("user32.dll")
if user32=0 then
    puts(1, "Couldn't open user32.dll!\n")
end if
See Also: define_c_func, define_c_proc, define_c_var, c_func, c_proc, Calling C Functions