9.52 DLL

Note: Built-In Function Rules     Usage Options

Allows processing within a standard DLL (Dynamic Link Library) object to be invoked from a LANSA component or function.

This is a generic interface to operating system DLL entry points. It may not be the most appropriate interface for specialized requirements. For specialized requirements please investigate creating your own Built-In Function. Refer to Create Your Own Built-In Functions.

Arguments

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Alias name of DLL to be invoked.

1

32



2

A

Req

Alias name of function (i.e. entry point) to be invoked.

1

32



3-20

X

Opt

User defined real or logical arguments to be passed to the DLL entry points.

1

Unlimited



Return Values

No

Type

Req/ Opt

Description

Min Len

Max Len

Min Dec

Max Dec

1

A

Req

Return Code

"OK" = Completed okay.

"ER" = Error detected.

2

2



2

A

Opt

Error message text

1

256



3-20

X

Opt

User defined real or logical return values from the DLL entry point.

1

Unlimited



Technical Notes

The X_USEDLL.DAT Definition File

The X_USEDLL.DAT definition file defines the characteristics of all DLLs that can be used by the DLL Built-In Function. The following should be read and understood before attempting to create or alter this file or use this Built-In Function: 


As an example of the content of this file, consider the following:

     *  --------------------------------------------------
* Example of defining Crystal Report DLL entry points
* ---------------------------------------------------
DLLNAM=CRPE
DLLALS=CrystalReports
*
ENTNAM=PEOpenEngine
ENTALS=OpenEngine
ENTSKL=CRPE0001.S
*
ENTNAM=PECloseEngine
ENTALS=CloseEngine
ENTSKL=CRPE0002.S
*
ENTNAM=PEPrintReport
ENTALS=PrintReport
ENTSKL=CRPE0003.S
*
ENTNAM=PEGetVersion
ENTALS=GetVersion
ENTSKL=CRPE0004.S

Here you can see the definitions for the Crystal Reports DLL named CRPE. It has four entry point aliases called OpenEngine, CloseEngine, PrintReport and GetVersion. The skeleton / template code for invoking this DLL and the entry points is to be found in the ...\X_LANSA\SOURCE directory in files CRPE0001.S, CRPE0002.S, CRPE0003.S and CRPE0004.S respectively. The skeleton code defines how the DLL is loaded, what the real entry point names are, how Built-In Function arguments are mapped to entry point arguments, how return codes and return values are handled, etc.

When setting up your own skeleton files / templates please follow these guidelines:

The DLL may need to be copied into the X_LANSA/EXECUTE directory for the application to be executed properly. For example, CRPE32.DLL has to be copied into the X_LANSA/EXECUTE directory.

At your development site, you need to decide on a convention for mapping this Built-In Function's arguments to the actual DLL entry point arguments. The convention you adopt is implemented in the skeleton/template code associated with each DLL entry point.

The skeleton template file supplied was used because it supports:

For example, the Crystal Reports entry points use the following parameter and return value conventions in their shipped format:

DLL Alias

Entry Point

Alias

Arguments And Return Values

CrystalReports

OpenEngine

Ret 1

Is the OK or ER return code and it is optional.

CrystalReports

CloseEngine

Ret 1

Is the OK or ER return code and it is optional.

CrystalReports

PrintReport

Arg 3

Is the report name and it is required. If not specified it will default to a null string causing a "not found" error.

Arg 4

Is the print report option and it is optional. It should be Y or N. It defaults to Y.

Arg 5

Is the show in window option and it is optional. It should be Y or N. It defaults to N.

Arg 6

Is the window title and it is optional. It defaults to a null string.

Ret 1

Is the OK or ER return code.

CrystalReports

GetVersion

Ret 1

Is the OK or ER return code and it is optional.

Ret 2

Is the major version number and it is optional.

Ret 3

Is the minor version number, and is optional.