Skip to content
⌘ NSIS Forum Archive

Get value from dll function (delphi)

5 posts

butch22#

Get value from dll function (delphi)

Hello.
I created a custom page.
On it, there's a field i'd like to encrypte.
So i want to make a dll with Delphi;
I Tried this but it doesn't work

********* Delphi code *****************
function Crypte(texte:ShortString):ShortString;
begin
result:='toto';//i can't show you the code 🙁
end;
**********************************

********** NSIS code ************************
System::Call 'DllFunctions::Crypte(t 9) t .9'
MessageBox MB_OK "$9"
**********************************

The value of $9 is "" and not "toto" !?
What's wrong ?
butch22#
I've found.
I post here the solution :

***********Delphi code****************
function Crypte( varIn😛char)😛char;cdecl;
begin
result:=pchar('toto');
end;

***********NSIS code****************

System::Call "$EXEDIR\DllFunctions::test(t 'titi') t .r9"
MessageBox MB_OK "texte récupéré par NSIS $9"
deguix#
With [code] it appears the same, Afrow UK. You (butch22) should disable smiles in your posts which have only codes next time.
butch22#
Sorry.
Here is the code :
Delphi :

function Crypte( varIn😛char)😛char;cdecl;
var
tmp:string;
begin
tmp:= varIn ;
tmp:=Cryptage(tmp);
result:=pchar(tmp);
end;
NSIS :

System::Call "$EXEDIR\Utils::Crypte(t r5) t .r5"