Looking for an example of using a 3D party DLL in LotusScript

I am looking for an example of a DLL created with Visual Studio nad referenced into Lotus Domino and used with LotusScript.

Any help would be appreciated.

Jeff Beagle

Subject: I don’t have one at hand but…

The function in the dll need to get declared. And, if I remember right, at least historically there used to be compiler options, which, if not set propperly, would not allow the dll to be used (I think I had collegues running into thsi many years ago).

There is samples out there e.g. to write the registry (Google for Registry LotusScript), there should be others e.g. to set a printer, or do remote keyboard calls. I think they should be a good starter.

Subject: Creating a dll in visual studio and linking it with lotus script

Open Visual studio 2005 and Create->New Project->Vc++Project->System32 Project->Name the file as “TestDll”->Choose DLL from the options.

Now

Add the following code on the vc++ file.

#include <stdio.h>

extern “C”

{

__declspec(dllexport) int AddUsingDLL(int a , int b)

{

printf ("Hello from DLL !\n");

int z=0;

z=a+b;

return z;

}

__declspec(dllexport) int SubUsingDLL(int a,int b)

{

  int z=a-b;

  return z;

}

}

Build the file.

Then you have created a dll file.

Goto My documents → Visual Studio 2005 ->Projects->TestDll->debug

Then copy TestDll.dll

And Paste into Windows/System 32

or Lotus/Notes

Then Open Lotes Notes.

Create a new database

Create a new form

Create a new button in the form

Name it as Add

under the click event of the Add button choose Lotus Script

Then add the following code

Sub Click(Source As Button)

Dim a As Integer

Dim b As Integer

a=10

b=20

Print  AddUsingDLL(a,b)

End Sub

Under the Declarations event

Add the following code

Declare Function AddUsingDLL Lib “TestLib.dll” ( Byval a As Integer,Byval b As Integer) As Integer

Then create another button named Sub.

Under the click event of the button add the following code.

Sub Click(Source As Button)

Dim a As Integer

Dim b As Integer

a=25

b=10

Print SubUsingDLL(a,b)

End Sub

Under declarations add

Declare Function SubUsingDLL Lib “TestLib.dll”(Byval a As Integer,Byval b As Integer) As Integer

Then save your form .

View the output in lotus notes

Click on the button see the results…