Use dll from SDK in lotus notes

hi,

i want to use a dll file that is delivered to us by one of our suppliers. there are several functions in the dll file that i want to use to read the information from an electronic identity card. how do i use the functions of this dll file? i’m not a lotus notes developer expert so please explain as detailed as possible. thanks

Subject: use dll from SDK in lotus notes

Hi Cindy,There are quite a few things to consider if you want to use an external DLL-file in your LotusScript.

First you have to think about distribution.

Are you the only one that’s going to use the DLL-file?

If so, the distribution is, of course, not a problem.

But if you intend to write some code that is to be available for everyone, you must also find a way to distibute the DLL-file to each user.

The simplest way may be to send a mail with a coded button that will detach the attached DLL-file to a specific location.

There are other ways, but they can be more difficult.

If you are only dealing with a small number of intended users you may get away with manually installing the DLL-file for them.

Then, for the actual code, you will have to use LotusScript.

I recommend you create an agent that you can call from a button or any other hotspot with @Command([ToolsRunMacro]; “agentname”).

In order to use the DLL-file in the agent, you must know the DLL entrypoints and the parameters to use.

Hopefully you have some form of documentation from the provider of the DLL-file for that.

In the (Options) section of the agent, put this:

Option Declare

This will force you to declare all variables in the code.

In the (Declarations) section of the agent, you will need to define all the DLL-file entrypoints and the parameters.

These examples assume the DLL-file’s name is “mydllfile.dll” and that the file is located at “c:\mydllfilelocation”:

Declare Function entrypoint1 Lib “c:\mydllfilelocation\mydllfile.dll” (ByVal parameter1 As Long, ByVal parameter2 As Long) As Integer

Declare Sub entrypoint2 Lib “c:\mydllfilelocation\mydllfile.dll” (ByVal parameter1 As Long)

It is almost impossible to give a broad generic help about this because it all depends on the exact specifications of the DLL-file.

But the 2 examples above should give you a general idea of how to declare the DLL’s entrypoints.

Now, to call the entrypoints in your code, you just call them.

As an example, you may have this in your agents Initialize section:

Dim lngParm1 As Long

Dim lngParm2 As Long

Dim iReturn As Integer

lngParm1 = 1001

lngParm2 = 2002

iReturn = entryPoint1(lngParm1, lngParm2)

I hope all of this has been of some help.

// Ken Haggman, http://www.noteshound.com