1
我知道这个问题有答案,但他不帮我。我看到文章:link和link,但我有问题。我的代码:当在Inno Setup中导入C#DLL时,“Can not Import dll”
C#:
[DllExport("ServerOfDataBases", CallingConvention = CallingConvention.StdCall)]
public static int ServerOfDataBases(
string server, string user, string password,
[MarshalAs(UnmanagedType.BStr)] out string strout)
{
string resultStr = String.Empty;
// ...
strout = resultStr;
return 0;
}
Inno Setup的:
[Files]
Source: "GetDataBases.dll"; Flags: dontcopy
[Code]
function ServerOfDataBases(server, user, password: string; out strout: WideString): Integer;
external '[email protected]:GetDataBases.dll stdcall';
我得到这个错误
无法导入DLL:C:\用户\应用程序数据\ Local \ Temp \ is-ECJ5V.tmp \ GetDataBases.dll
谢谢你的任何想法。
您的文章非常好。它帮助了我。如果有人愿意从C#DLL中返回一个字符串,那么使用文章[link](https://stackoverflow.com/questions/20776847/returning-a-string-from-ac-sharp-dll-with-unmanaged-出口到INNO-设置-凭证)。 –
对不起,我更正了我的评论。我的英语不好。 –
@ДжирайяNp,如果您发现我的文章有帮助,请立即注册。 –