Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

How to call DLL function from Setup.Rul file.

How to Call DLL function from Setup.rul file.

I have code block for call DLL function. but my DLL structure is completed.

DLL Name :- MyConnectionManager.DLL

I want to call below function :-

public void StoreConnectionStringParts(string connectionName, string serverName, string database, bool integratedSecurity, [string userName = null], [string password = null])

Member of New.Utility.Database.ConnectionManagement.ConnectionManager

How I call this method ?

I am using below code block but it is not working.

UseDLL( svConnMgrDir ^ "MyConnectionManager.dll" );

MyConnectionManager.StoreConnectionStringParts(parameter value);

UnUseDLL( svConnMgrDir ^ "MyConnectionManager.dll" );

If I used dot then also It not allowing. What to do in this case ?

Thank you.
Labels (1)
0 Kudos
(1) Reply
Level 8

I am trying to call a method from a DLL as well. Looks like we are on the same page with the InstallScript code. One thing that I read is that you need to make sure the install has access to the DLL (put it in support files) and the first thing to do before calling UseDLL is ChangeDirectory.

My DLL is in the Support Files, so my call looked like this:

if ( ChangeDirectory(SourceDir) < 0 ) then
MessageBox("Error changing to the Source Directory", SEVERE);

You should replace SourceDir with svConnMgrDir. What I haven't been able to get to work is calling the method.

HTH though 🙂
0 Kudos