butch22
12th October 2004 11:40 UTC
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
12th October 2004 14:18 UTC
I've found.
I post here the solution :
***********Delphi code****************
function Crypte( varIn:pchar):pchar;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"
Afrow UK
12th October 2004 17:44 UTC
Please use [code] around it because you've got smilies in there :(
-Stu
deguix
12th October 2004 22:15 UTC
With [code] it appears the same, Afrow UK. You (butch22) should disable smiles in your posts which have only codes next time.
butch22
14th October 2004 16:29 UTC
Sorry.
Here is the code :
Delphi :
function Crypte( varIn:pchar):pchar;cdecl;
var
tmp:string;
begin
tmp:= varIn ;
tmp:=Cryptage(tmp);
result:=pchar(tmp);
end;
NSIS :
System::Call "$EXEDIR\Utils::Crypte(t r5) t .r5"