LoadDLL - Access to the fast SYS interface and other DLLs

LoadDLL ( Source | Text ) *** UPDATED 06-June-2005 ***

FN_LoadDLL provides a function equivalent to the code in the introduction to the 'Accessing the Windows API' section of the BBC BASIC for Windows manual.

Functions and procedures provided

FN_LoadDLL(dll$,call$)

Loads specified DLL into memory if required anc returns a pointer to the specified function. For subsequent requests for other functions within the same DLL dll$ does not need to be specified.

Many functions which accept strings such as LoadLibrary have two variants accepting either ASCII or UNICODE strings. The ASCII variant is suffixed with a 'A', as in LoadLibraryA and the UNICODE variant is suffixed with a 'W', as in LoadLibraryW. If FN_LoadDLL returns NULL for a known function, append an 'A' or a 'W' to the end of the function name, depending on the string type you are using then test if FN_LoadDLL returns a valid function handle.

Returns:

A handle for the requested function or, NULL if the operation failed.

PROC_FreeDLL(dll$)

Tidy up after using a DLL to save system resources.