In my installShield-programm I call a delphi-dll with a string-parameter, but I get an error.
How must I hand over this string from installshield to the delphi-dll?
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.

String-Parameter to Delphi-DLL
Started by
SubDir
, Aug 09 2002 16:38
2 replies to this topic
Posted 15 August 2002 - 17:32
In InstallShield script you would have something like this:
prototype INT SierraInstall._FormGetInstallationID
(POINTER, // _lpszInstallID: PChar;
POINTER, // _lpszInstallShareName: PChar;
POINTER, // _lpszTargetDir: PChar;
POINTER, // _lpszInstallationType: PChar;
POINTER, // _lpszCustomInstallationType: PChar;
POINTER); // _lpszCDVersion: PChar): integer;
code section:
nResult = SierraInstall._FormGetInstallationID
(&svInstallationID,
&svInstallationShareName,
&svDir,
&szInstallationType,
&szCustomInstType,
&szCDVersion);
Inside your Delphi DLL specify the DLL as:
function _FormGetInstallationID
(_lpszInstallID : PChar;
_lpszInstallShareName : PChar;
_lpszTargetDir : PChar;
_lpszInstallationType : PChar;
_lpszCustomInstallationType : PChar;
_lpszCDVersion : PChar): Integer; stdcall;
You also need to export your function calls in the project file:
exports
_FormGetInstallationID name '_FormGetInstallationID';
Hope this helps.
prototype INT SierraInstall._FormGetInstallationID
(POINTER, // _lpszInstallID: PChar;
POINTER, // _lpszInstallShareName: PChar;
POINTER, // _lpszTargetDir: PChar;
POINTER, // _lpszInstallationType: PChar;
POINTER, // _lpszCustomInstallationType: PChar;
POINTER); // _lpszCDVersion: PChar): integer;
code section:
nResult = SierraInstall._FormGetInstallationID
(&svInstallationID,
&svInstallationShareName,
&svDir,
&szInstallationType,
&szCustomInstType,
&szCDVersion);
Inside your Delphi DLL specify the DLL as:
function _FormGetInstallationID
(_lpszInstallID : PChar;
_lpszInstallShareName : PChar;
_lpszTargetDir : PChar;
_lpszInstallationType : PChar;
_lpszCustomInstallationType : PChar;
_lpszCDVersion : PChar): Integer; stdcall;
You also need to export your function calls in the project file:
exports
_FormGetInstallationID name '_FormGetInstallationID';
Hope this helps.
John Ames
InstallShield Developer/Configuration Management Specialist
InstallShield Developer/Configuration Management Specialist
Posted 16 August 2002 - 12:35
Thanks for your answer.
What about the solution that I declare in InstallShield a String-Parameter and the DLL expects pChar?
Can I use this also?
At the moment, it works.
What about the solution that I declare in InstallShield a String-Parameter and the DLL expects pChar?
Can I use this also?
At the moment, it works.