PDA

View Full Version : Error while calling External DLL



vattipalli
12-02-2004, 11:53 PM
Hi,
Iam trying to migrate InstallShield project from 5.5 version to 10.5 version.
I get the following error while compiling .
Linking...
isrt.obl(Service.obs) : error L8407: 'Advapi32.OpenSCManagerA' : conflicts with previous definition
isrt.obl(Service.obs) : error L8407: 'Advapi32.OpenServiceA' : conflicts with previous definition
isrt.obl(Service.obs) : error L8407: 'Advapi32.QueryServiceStatus' : conflicts with previous definition
isrt.obl(Service.obs) : error L8407: 'Advapi32.StartServiceA' : conflicts with previous definition
Setup.inx - 4 error
Iam currently working on Windows xp. Please help me to solve this error..

Christopher Painter
12-03-2004, 12:35 AM
You can't have the same external function declared twice. All of these functions become declared when you #include "ifx.h" ( which eventually includes service.h ) . Read the help file and find the ServiceStopService, ServiceStartService, ectera functions that already exist in InstallScript.

Basically you'll find alot of things that you had to do yourself in 5.5 is now included in 10.

vattipalli
12-03-2004, 01:05 AM
Hi,
////////////////////////////////////////////////////////////////////////////////
// External Prototypes
prototype HWND Advapi32.OpenServiceA(HWND,POINTER,NUMBER);
prototype Advapi32.QueryServiceStatus(HWND,POINTER);
prototype HWND Advapi32.OpenSCManagerA(POINTER,POINTER,NUMBER);
prototype HWND Advapi32.StartServiceA(HWND,NUMBER,POINTER);


this is the code where error is coming.. When i read help it is saying whenever external dll is called the calling convention should be same in the script and dll. But Advapi32 is windows dll. I tried to comment out this code

it is saying error C8025: 'Advapi32' : undefined identifier
Please let me know what to do....

Christopher Painter
12-03-2004, 08:25 AM
The error really isn't where it says it is, it's in your script. Someone in your setup.rul ( or other script files ) you are trying to declare those external functions.

Around 5 years ago when you would have been using InstallShield 5.5 you would have had to manually declare those functions and create your own wrapper classes to handle services. However this is no longer the case. InstallShield provides native functions for dealing with services. These functions declare the same external windows dll functions that you are trying to declare so there is a conflict.

You remove those declarations from your script. Then walk the rest of your code and whereever you find custom code for dealing with services, replace it with InstallScript SCM (ServiceControlMananger) native functions.