1

DLLImportの (A Delphi DLL) は Winform アプリケーションでうまく動作しますが、ASP.net WebForm アプリケーション (IIS 7) で例外が発生します。

誰かが私にその理由と対処方法を教えてもらえますか?

[DllImport("DLL_YINLIAN_INTERFACE.dll", EntryPoint = "YL_SetParam", SetLastError = true, CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
        static extern int YL_SetParam(int iParamIndex, byte[] ucParamBuffer);

デバッグ中の例外は次のとおりです。

System.Runtime.InteropServices.SEHException (0x80004005): 
   External component has thrown an exception.
   at JFTHardAPI.SandTran.YL_SetParam(Int32 iParamIndex, Byte[] ucParamBuffer)
4

1 に答える 1

0

SEHExceptionアンマネージ コードからスローされます。デバッガを使用します: Debug > ExceptionsをオンにThrown flag for Win32 Exceptionsます。

また、使用するアンマネージ関数を変更してみてくださいStdCallCheck the calling conventionマネージド側とアンマネージド側の両方。間違った呼び出し規約を使用すると、呼び出しスタックの状態に影響を与える可能性があります。ここに画像の説明を入力

于 2012-06-15T12:10:25.480 に答える