I am successfully calling a function in a DLL from Inno Setup, however upon returning I get a Runtime Error...Exception: Access violation at address XXXXXXX. Write of address XXXXXX.
The function is declared as:
function CompleteInstall(szIntallPath: String) : Integer;
external 'CompleteInstall@files:InstallHelper.dll stdcall setuponly';
And called:
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then begin
CompleteInstall('Parm1'); // ExpandConstant('{app}')
end;
end;
There is no problem if I change the function to not take a parameter. It still occurs if I change it to take a single integer parameter or declare it as a function and change the function to be a void function with an integer parameter.
The called function does nothing but return:
__declspec(dllexport) int CompleteInstall(char* szInstallPath)
{
//AfxMessageBox ("Got here" /*szInstallPath*/, MB_OK);
return 1;
}