PDA

View Full Version : Unable to access external dll function



vattipalli
02-23-2005, 05:34 AM
Hi,
I created Blowfish.dll from Blowfish.cls(VB class module). That VB class module has the following function:
Public Function DecryptFile(InPath As String, OutPath As String, Overwrite As Boolean, Key As String, Optional InHex As Boolean) As Boolean

Then i added this dll to support directory in InstallShield project.
Then i added the following code in setup.rul file.


prototype cdecl BOOL Blowfish.DecryptFile( BYREF STRING, BYREF STRING, BOOL, BYREF STRING, BOOL);

UseDLL(SUPPORTDIR ^ "Blowfish.dll");
Blowfish.DecryptFile("C:\My Installations\Caterpillar Electronic Technician\EncryptedFile.ini", "C:\My Installations\Caterpillar Electronic Technician\Setup Files\Compressed Files\Language Independent\OS Independent\DecryptedFile.ini", TRUE, "123456", TRUE);

where "123456" is the key i have used in encrytping the file.
When i build the installshield project , iam getting following runtime error :
An error -5011:0x80040703 has occured while running the setup.

Please let me know how to solve this error.

Regards,
Vattipalli

anitabs
02-23-2005, 07:18 AM
Check this link

http://support.installshield.com/kb/view.asp?pcode=ALL&articleid=Q104985

vattipalli
02-24-2005, 12:03 AM
Hi,
I checked the link... But still unable to solve the error. My main problem is how to access dll that is added to support directory.. Should i do something??
Please let me know how to solve this error.
Regards,
Vattipalli

RadhaK
02-24-2005, 04:53 AM
Hi,

You cannot directly call an external DLL function, call a Windows API or launch an application such as Notepad from an installation script.

For example, function called LaunchAppAndWait that can be used to launch an external application. You can also call any Windows API or DLL function directly from an installation script.

http://helpnet.installshield.com/Robo/BIN/Robo.dll?tpc=%2Frobo%2Fprojects%2Finstallshieldlivinghelp%2FISLivingHelpMain2.htm%3FRINoLog28301%3DT&mgr=agm&wnd=InstallShieldLivingHelp%7CMain&agt=wsm&ctxid=

vattipalli
02-24-2005, 07:28 AM
Hi,
If I cannot call any external DLL, how will i call the function in external DLL
which does all the job for me.. Please help me.. Iam really in need for calling function in external dll and not windows dll.
Regards,
Vattipalli

RobertDickau
02-24-2005, 09:52 AM
You can call functions from (essentially) any C-callable DLL. In your example, perhaps try BYVAL STRING in the prototype instead of BYREF STRING? If you pass that error code to FormatMessage, is there a description of the error?

Oh, I just noticed you're creating a Visual Basic DLL, which isn't C-callable. In that case, you might try registering the VB DLL from InstallScript, and then calling the DLL's methods using COM (CoCreateObject and such like) instead of using UseDLL. Perhaps see www.installsite.org > InstallScript Samples > External Programs > Using a VisualBasic DLL in IS6.