“Error in loading DLL" error

RPrabha
RPrabha used Ask the Experts™
on
I have a web agent in forms6.nsf. When I try to call a function from a dll in this agent, I get the error “Error in loading DLL". I have the dll both in Windows system directory and Domino directory. I tried putting the dll in Domino/Data/iNotes directory, I tried specifying the full path in Declare statement but nothing helps. Any idea? Here is the Declare statement.
Declare Function TestInitialize Lib "c:\winnt\system32\test.dll" Alias "TestInitialize" ( Byval val1 As String, Byval  val2 As Integer, Byval val3 As Integer, Byval val4 As Integer ) As Integer
Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
It seems that dll can be found but maybe the function inside the dll isn't exported the right way or not at all?

Author

Commented:
I can call the same function from a form that is in user’s mail database. So, I think that there is no problem with dll.
Top Expert 2007

Commented:
So it works fine on a Client, but not on the Server ?

Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

Author

Commented:
Well, I would say that..
It works on Notes Client when it is called from the lotus script that is executed on click of a button.
It does not work on ‘Domino Web Access’ when it is called from a lotus script web agent that is triggered on click of a button.
In both the cases, the database resides on the server.
Please let me know, if my answer is not clear.
Top Expert 2007

Commented:
IS the DLL local in each case, or is it also on the server ?

Web related buttns may require that the DLL be on the server. I have not tested this, but remember erading i somewhere.

I hope this helps !
Zvonko זְאֵבSystems architect
Top Expert 2006

Commented:
First of all, remove the directory prefix in front of the dll name:  c:\winnt\system32\
That path is for sure in the path search order.
Also if you use some other directories, the print them out for test, because backslash is an escape character.
Check for this: c:\\winnt\\system32\\
Then check Agent execution rights.
Sjef BosmanGroupware Consultant

Commented:
Backslash is escape character in Formula language, not in LotusScript. Anyway, remove the path.

Does the DLL work from a test program in C, i.e. outside the Domino environment?

Author

Commented:
The dll is in the server and it works outside Domino environment. I can't figure out what is wrong with my dll but I created another one from the scratch and it works. I did not have to give the full path but put it in the windows system directory. It is strange that my original dll does not work. Thank you all for the response.
Zvonko זְאֵבSystems architect
Top Expert 2006

Commented:
You are welcome.
Commented:
PAQed with points refunded (500)

GranMod
Community Support Moderator

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial