1

I'm trying to call a method from a dll file (C#) but I just get the "could not call proc" error message. Here's my code:

ddl file:

public class InnoEncryption
{
    [DllExport("EncryptText", CallingConvention = CallingConvention.StdCall)]
    public static string EncryptText([MarshalAs(UnmanagedType.LPStr)] string text)
    {
        return SecretKeyEncryption.EncryptText(text);
    }
}

Inno.iss

[Files]
Source: "dll\InnoEncryption.dll"; Flags: dontcopy
Source: "dll\RGiesecke.DllExport.dll"; Flags: dontcopy

[Code]
function EncryptText(text: String): String;
external 'EncryptText@files:InnoEncryption.dll,RGiesecke.DllExport.dll stdcall loadwithalteredsearchpath delayload';

procedure MyProc();
var encryptedText: String;
begin
encryptedText := EncryptText(PasswordEdit.Text);
end

0 Answers0