Hello
I'm trying to create a DLL that will later be used in Inno Setup. I managed to create a DLL using Pelles as an IDE, with the following code:
#include <windows.h>
__declspec(dllexport) int sumT(){
return 2;
}
Then I call map the DLL to a function in Inno Setup, using the following Delphi code:
function Hellow() : Integer ;
external 'sumT@files:yyy.dll stdcall';
It works as expected, returning 2. I can also call it from rundll32.exe - if I add a MsgBox in the DLL, it will appear, proving that everything works as expected.
Now the problem starts when I try to pass a value to the DLL, like that - for example:
#include <windows.h>
__declspec(dllexport) int sumT(int sumTah){
return sumTah;
}
It stops working! In Inno Setup, I gives me the message:
"Runtime Error (at -1:0)"
And if I try rundll32.exe, I get:
Error in yyy.dll
Missing entry:sumT
I'm not going to paste the Delphi code here, because I virtually tried everything, same thing with the C code, I tried using __stdcall instead, declaring the argument as INT, UINT... and other things I forgot.
I also looked up the MSDN, but could not find anything pertaining to this particular problem.
So, can anyone help?
Thanks
EDIT: I am compiling in C, so no need for "extern".