contents   index   previous   next



SElib.dynamicLink() - for Win16

syntax:

SElib.dynamicLink(library, procedure,

                  returnType, convention[,

                  [desc,] param …])

where:

library - a string, the name of the dynamic link library, DLL, being used, the one having the procedure being called.

 

procedure - a string or number, the name or ordinal number of a routine in a dynamic link library to be used.

 

returnType - a number, which tells ScriptEase what type of, value the procedure returns, so that it can be properly converted into an integer. The be one of the following:

 

UWORD8   SWORD8   UWORD16   SWORD16   UWORD24

SWORD24  UWORD32  SWORD32   FLOAT32   FLOAT64

FLOAT80  (FLOAT80 is not available in Win32)

 

convention - the calling convention to use when invoking or using the procedure being called.

 

CDECL    Push right parameter first.

         Caller pops parameters.

STDCALL  Push right parameter first.

         Caller pops parameters.

PASCAL   Push left parameter first.

         Callee pops parameters.

 

desc - a blobDescriptor that describes the following param if param is a structure. (See blobDescriptor example.) A blobDescriptor is only used in front of params that are structures and is required for such params. A Blob (Binary Large Object) and a Buffer are very similar in ScriptEase. The Blob is the type that was used, in the early days of ScriptEase, to work with data in sections of memory. The Buffer is the newer type. Structure types may be created in Blobs or Buffers and blobDescriptors may be used to describe the data in either type. So, in ScriptEase, you will sometimes see blobDescriptor before a param of type Blob or a param of type buffer. In either case, the blobDescriptor is describing how data is stored in the param, even if the data is a string.

 

param - a variable for a section of memory that holds data in the form of a structure of elements or a buffer a string.

 

return:

value - the value returned by the procedure being called, else void if the procedure does not return a value.

 

description:

For Win16

 

Calls a routine in a dynamic link library, DLL. The most common use is to use various functions in the Windows API.

 

If a parameter is a Blob, a byte-array, or an undefined value, it is passed as a far pointer. All other numeric values are passed as 16-bit values. If 32 bits are needed, the parameter must be passed in parts, with the low word first and the high word second for CDECL calls but the high word first and low word second for PASCAL calls.

 

If a parameter is undefined when SElib.dynamicLink() is called, then it is assumed that the parameter is a far pointer to be filled in, that is, that the far address of a data element is passed to the function and that function will set the value. If any parameter is a structure, then it must be a structure that defines the binary data types in memory to represent the following variable. Before calling the DLL function, the structure will be copied to a binary buffer as described in Blob.put() and Clib.fwrite(). After calling the DLL function, the binary data is converted back into the data structure according to the rules defined in Blob.get() and Clib.fread(). Data conversion is performed according to the current _BigEndianMode setting.

 

see:

Blob object, blobDescriptor example, Win32 structure definitions, Clib.fread()

 

 


SElib.dynamicLink() - for OS/2