2017-08-04 11 views
1

この質問には答えがありますが、彼は私を助けません。私は記事を見た:linklinkが、私は問題があります。私のコード:InnoセットアップでC#DLLをインポートするときに「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:ユーザー\ ... \のAppData \ローカル\ Temp \ is-ECJ5V.tmp \ GetDataBases.dll

ありがとうございました。

答えて

0
私にとって

作品、私は私の答えから、すべての指示に従った場合:
Calling .NET DLL in Inno Setup

だから私はあなたにあなたの.NET/C#プロジェクトのプラットフォームターゲットを設定しなかったことを、推測x86

+0

あなたの記事はとても良いです。それは私を助けた。誰かがC#DLLから文字列を返すことを望むなら、記事[link](https://stackoverflow.com/questions/20776847/returning-a-string-from-ac-sharp-dll-with-unmanaged- exports-inno-setup-scrip)を実行します。 –

+0

申し訳ありませんが、私はコメントを修正しました。私の英語は良いことではありません。 –

+0

@ДжирайяNp、私の記事を参考にしてくれたら、アップしてください。 –