Inno Setup“无法从外部dll调用proc”

时间:2017-06-19 12:10:46

标签: inno-setup

我正在尝试从dll文件(C#)调用方法,但我只是得到“无法调用proc”错误消息。 这是我的代码:

ddl文件:

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 个答案:

没有答案