9.52 DLL

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: 

Keyword

Meaning

*

Line is a comment

DLLNAM=

Name of the real (ie: operating system level) DLL file without any form of suffix.

DLLALS=

The alias name for this DLL that is to be used in RDML functions. Up to 32 characters may be specified. This name must be unique within the definition file and is not case sensitive. The DLLNAM= must precede DLLALS=.

ENTNAM=

Name of the real (ie: operating system level) DLL entry point. This name is case sensitive in most operating systems. This name should be unique within the current DLL definition.

ENTALS=

The alias name for a DLL entry point that is to be used in RDML functions Up to 32 characters may be specified. This name must be unique within the current DLL and is not case sensitive. The ENTNAM= must precede ENTALS=.

ENTSKL=

Specifies the name of the skeleton file (including the suffix) that defines the required C code to execute the DLL entry point. This code is used as a template to generate C code to invoke the DLL entry point. Please refer to shipped samples / examples for fully commented examples of how to produce such a template. All template files must reside in the X_LANSA/SOURCE directory. The ENTNAM= must precede ENTSKL=.

 

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.