CALL (call procedure from a DLL)

Top  Previous  Next

 

CALL( file, procedure [, flags ] )

CALL

Calls a procedure that has not been prototyped in the application's MAP structure from a Windows standard .DLL.

file

A string constant, variable, or expression containing the name (including extension) of the .DLL to open. This may include a full path.

procedure

A string constant, variable, or expression containing the name of the procedure to call (which may not receive parameters or return a value). This can also be the ordinal number indicating the procedure's position within the .DLL.

flags

An UNSIGNED integer constant, variable, or expression containing bitmap flag settings.

The CALL procedure calls a procedure from a Windows-standard .DLL. The procedure does not need to be prototyped in the application's MAP structure. If it is not already loaded by Windows, the .DLL file is loaded into memory. The .DLL file is automatically unloaded from memory when the procedure terminates unless the lowest flags bit is set to one (1). A .DLL file left loaded may be explicitly unloaded with the UNLOAD procedure.

CALL returns zero (0) for a successful procedure call. If unsuccessful, it can return one of the following mapped error values, or any other valid Windows level error code:

-1 Procedure name cannot be resolved in a specified .DLL

2  File not found

3  Path not found

5  Attempted to load a task, not a .DLL

6  Library requires separate data segments for each task

10 Wrong Windows version

11 Invalid .EXE file (DOS file or error in program header)

12 OS/2 application

13 DOS 4.0 application

14 Unknown .EXE type

15 Attempt to load an .EXE created for an earlier version of Windows.

  This error will not occur if Windows is run in Real mode.

16 Attempt to load a second instance of an .EXE file containing multiple,writeable data

  segments.

17 EMS memory error on the second loading of a .DLL

18 Attempt to load a protected-mode-only application while Windows is running in Real mode

 

Return Data Type:

SIGNED

Example:

X# = CALL('CUSTOM.DLL','1')  !Call first procedure in CUSTOM.DLL

IF X# THEN STOP(X#).         !Check for successful execution

See Also:

UNLOAD

Calling Stored Procedures (SQL)