Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

UseDll function fail to load the DLL


2 replies to this topic

Shekhar

Shekhar
  • Members
  • 30 posts

Posted 11 October 2006 - 09:56

Hi,

I am working on installshield MSI project. (ISD10.5 professional). I am using one dll. (installhelper.dll) in this project.

i am calling some dll function in the script.

But when I am trying to load the dll using
UseDll( SUPPORTDIR ^ "InstallHelper.dll"); function then UseDll function failed to load it and return -1 value.

Installation popup the error message showing error number: 0x80040702

i have checked in the Temp folder during installation and found dll is copied there.

I have checked the dependency and copied all the dependencies in SUPPROTDIR during setup execution.

still its failing and not able to understand why so?

Can anybody tell me, why?.


if anyone can help in this regard then it will be very grateful.

Thanks

shekhar



raj_indy

raj_indy
  • Full Members
  • 1 posts

Posted 20 November 2006 - 05:22

We are having a similar issue with UseDLL(). We are loading a Dll like this after doing a changeDir() to the support directory.

szDLLPath = SUPPORTDIR ^ "ICServerInstallA.dll";

if ((nReturnValue = ChangeDirectory(SUPPORTDIR)) < 0) then
NumToStr(szMsg, nReturnValue);
MessageBox(" ChangeDirectory() Error. Directory : " + SUPPORTDIR, SEVERE);
MessageBox(" Error code : " + szMsg, INFORMATION);
endif;

if( (nReturnValue = UseDLL(szDLLPath)) < 0) then
NumToStr(szMsg, nReturnValue);
MessageBox(@ERROR_LOADING_INSTALL_DLL + " " + szDLLPath, SEVERE);
MessageBox(" Error code : " + szMsg, INFORMATION);
abort;

The exception -

---------------------------
Unhandled Exception
---------------------------
Error Number: 0x80040702
Description: Failed to load dll: ICServerInstallAD

Setup will now terminate.
---------------------------
OK
---------------------------

1. The Dll is streamed to the support directory and is in the support dir
2. There are NO missing dependencies.

Any suggestions/solutions will be of great help ....

Thanks, Raj


shankx

shankx
  • Full Members
  • 5 posts

Posted 09 July 2007 - 08:29

After a lot of searching the problem appeared to be connected to the C Runtime library DLL, msvcrt.dll. Changing our DLL so that it linked statically to this (compiling our code with the /MT option instead of the default /Md) fixed the problem.