cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Belthazor
Level 2

back stack error

I have an external function in my dll which is defined like this:

extern "C" {
__declspec(dllexport) int (LPCSTR, LPCSTR, LPCSTR, LPCSTR);
}

and like this in InstallScript

prototype INT .(byval STRING,byval STRING,byval STRING,byval STRING);

and call it like this:

if ((szPid, szVer, szEmail, szSerial)=1) then

and when I call the function it does it's business but then I get an error message that says:

Error number: 0x80040704
Description: DLL function call resultet in bad stack POssible incorrect prototyping...
Setup will now terminate.

I've check the data, it transfers to my dll correctly and in the dll everything finishes fine. The dll basically connects to my website to validate the serial number using wininet. I've tried compiling a test exe file to check whether the dll functions returns values and it does so without any errors.

What seems to be the problem?
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

Does it work if your DLL function prototype specifies the __stdcall calling convention, or instead your InstallScript function prototype specifies the cdecl calling convention?
0 Kudos
Belthazor
Level 2

Yes Robert, using cdecl solved the issue. Thank you very much.
0 Kudos